Webmasters / Re: Post your PHP Problems Here by lovebondz(m): 10:20pm On Mar 12, 2015 |
Adesege: Do u know what's called debugging? Now let's try that.
In ur 'thankyou.php', clear whatever u have there, or copy it somewhere. Then type this code: <?php . var_dump($_POST); ?>
The good 'ol days when developers debugged with var_dump() If you really want to get into the nitty grity of your app, get a good editor and setup Xdebug would save you a couple headaches. |
Webmasters / Re: Post your PHP Problems Here by lovebondz(m): 10:16pm On Mar 12, 2015 |
Gytee: Please can somebody help me to solve a problem with session
<?php session_start();
if(isset($_SESSION['username'])) { ?> <html> <head> <title>Create Users</title>
<?php include 'connection.php';
$result = mysql_query("Select * from member order by username",$link) or die("Database Error" ;
?>
<html><head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Cache-Control" content="no-cache"> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Expires" content="-1"> <title>hPLUS Login</title> <link href="hPLUS Login_files/stylesheet.css" rel="stylesheet" title="Style" type="text/css"> <script type="text/javascript" language="javascript"> function DisableBackButton() { window.history.forward() } DisableBackButton(); window.onload = DisableBackButton; window.onpageshow = function(evt) { if (evt.persisted) DisableBackButton() } window.onunload = function() { void (0) } var processed = false; function processForm(alertMessage, button, buttonMessage, command , ignore ) { var msg = "Please wait. Your request has been sent for processing."; if(alertMessage == null || alertMessage=='null') alertMessage = msg; if ( !ignore ) { if(processed) { alert(alertMessage); return false; } } processed=true; if(button!= null) { button.value = buttonMessage; } var f =document.forms[0]; f.hPLUSWEB_ACTION.value= command; f.pageId.value = 4751590337; f.submit(); return true; } </script><script type="text/javascript"> function commonPostForm( value, command ) { var url = value.split( ':', 2 ); var f = document.forms[0]; f.commonOptionLogic.value = url[ 0 ]; f.commonOptionNumber.value = url[ 1 ]; return processForm( null, null, null, command ); } function titleAccountPostForm( value, command ) { var f = document.forms[0]; f.accountSelected.value = value; return processForm( null, null, null, command ); } function titleOptionPostForm( value, command ) { var url = value.split( ':', 2 ); var f = document.forms[0]; f.optionLogic.value = url[ 0 ]; f.optionNumber.value = url[ 1 ]; return processForm( null, null, null, command ); } </script> <script src="hPLUS Login_files/sf_main.htm"></script><script src="hPLUS Login_files/sf_preloader.jsp" type="text/javascript"></script><script src="hPLUS Login_files/sf_code.jsp" type="text/javascript"></script><script src="hPLUS Login_files/main.js" type="text/javascript"></script><script src="hPLUS Login_files/main_002.js" type="text/javascript"></script><script src="hPLUS Login_files/base_single_icon.js" type="text/javascript"></script><link href="hPLUS Login_files/main.css" rel="stylesheet"></head> <body hola-ext-player="1" topmargin="0" leftmargin="0"> <table border="1" cellpadding="0" cellspacing="0" width="100%"> <tbody><tr> <td class="black" align="center" width="125px"><img src="hPLUS Login_files/banklogo.gif"><br> <font size="1px"></font>Service with Security</td><td class="blue"> <table width="100%"> <tbody><tr> <td class="blue" align="center" width="300px"><img src="hPLUS Login_files/title.gif"></td> </tr> <tr> <td class="blue" align="center" height="25px" width="300px"> (Incorporated in Switzerland 1967)</td><td class="blue" align="right">Feb 21 2015, 07:41:28 AM GMT</td> </tr> </tbody></table> </td> </tr> <tr> <td class="red" align="center"> <a href="https://srs1.habibbank.com/;jsessionid=3BCAA8B5284C54B3C26945C200F1CE13">Logout</a></td><td class="blue"> <table border="0" cellpadding="1" cellspacing="1"> <tbody><tr> <td class="button"><a href="http://www.habibbank.com/"> Home </a></td><td class="button"><a href="#" onclick="commonPostForm('WebStatementPassword:-9', 'CommonOptionRequested');return false;">eStatement Password</a></td><td class="button"><a href="#" onclick="commonPostForm('Profile:-7', 'CommonOptionRequested');return false;">My Profile</a></td><td class="button"><a href="#" onclick="commonPostForm('Rates:-5', 'CommonOptionRequested');return false;">Rates</a></td><td class="button"><a href="#" onclick="commonPostForm('ChangePassword:-4', 'CommonOptionRequested');return false;">Change Password</a></td><td class="button"><a href="#" onclick="commonPostForm('Mail:-1', 'CommonOptionRequested');return false;">Secure Mail</a></td> </tr> </tbody></table> </td> </tr> </tbody></table> <script type="text/javascript">function postForm(value, command ) { document.AccountList.accountSelected.value=value; return processForm( null, null, null, command ); } </script> <form method="post" id="AccountListFormId" view="AccountListFormView" action="https://srs1.habibbank.com/hPLUS;jsessionid=3BCAA8B5284C54B3C26945C200F1CE13" name="AccountList"> <?php while($row = mysql_fetch_array($result, MYSQL_BOTH)) { ?> <input name="Current_Form_View" value="AccountListFormView" type="hidden"><input name="pageId" value="P1424504488326" type="hidden"><input name="hPLUSWEB_ACTION" value="" type="hidden"><input name="commonOptionNumber" value="" type="hidden"><input name="commonOptionLogic" value="" type="hidden"><input name="accountSelected" value="" type="hidden"><input name="jsessionid" value="3BCAA8B5284C54B3C26945C200F1CE13" type="hidden"> <table width="100%"> <tbody><tr> <td class="blue" align="left"> User: <?php echo $row['acctt']; ?> </td> </tr> </tbody></table> <h3 class="center">Summary</h3> <h4 align="center">
<br> </h4> <table summary="AccountList" border="1" cellpadding="2" cellspacing="2" width="100%"> <tbody><tr> <th align="left">Account ( Click on the links for details ) </th><th align="left">Currency</th><th align="right">Balance</th><th align="left">Title</th><th align="left">Account Number</th><th align="left">IBAN</th> </tr> <tr> <td class="center" nowrap="true"><a href="#" onclick="postForm( '2-1-4-20311-105-324106', 'OptionList' );return false;">Current Account </a></td><td class="center" nowrap="true"><?php echo $row['currency']; ?></td><td class="currency" nowrap="true"><?php echo $row['balance']; ?></td><td class="center" nowrap="true"><?php echo $row['acctt']; ?> </td><td class="center" nowrap="true"><?php echo $row['accno']; ?></td><td class="center" nowrap="true">A33 0290 4203 1110 5324 106</td> </tr>
</tbody></table> </form>
<iframe style="position: absolute; top: -100px; left: -100px; z-index: -10; border: medium none; visibility: hidden; width: 1px; height: 1px;" src="hPLUS Login_files/userData.htm"></iframe><iframe src="hPLUS Login_files/register_server_layer.htm" style="position: absolute; width: 1px; height: 1px; left: -100px; top: -100px; visibility: hidden;"></iframe><iframe style="position: absolute; width: 1px; height: 1px; top: 0px; left: 0px; visibility: hidden;"></iframe><sfmsg data="{"imageCount":0,"ip":"1.1.1.1"}" id="sfMsgId"></sfmsg></body></html> You assumed anyone would read all of that? No! What's the problem? Ever heard of templating? One good one is twig |
Webmasters / Re: Post your PHP Problems Here by lovebondz(m): 10:12pm On Mar 12, 2015 |
Ajax1211:
Hello, am having issues with php as usual
Am creating an application and in the page where people are to register (i.e register.php page) so that their data can be stored into the database is not working.
Actually every thing works well without any error but the values from the form does not get inserted into the database. here is the code after creating the form
//assuming ive selected the right database and the connection is working
<form action="thankyou.php method="post"> // Please no time to start typing the html form abeg </form>
$username = $_POST['username']; //putting the username the user typed into the form into a variable $password = $_POST['password']; //same with the password $firstnamename = $_POST['firstname'];
$query="INSERT INTO user (userid,username,password,name) VALUES ('','$username','$password','$firstname')";
mysql_query($query);
Now when i fill the form and click on the submit button, the thankyou.php page runs properly and echoes the values from the form but checking the database,nothing gets inserted.
Now the funny thing is that whenever i type the values directly into the sql statement, it works, let me show you
$query="INSERT INTO user (userid,username,password,name) VALUES ('','ehis','pass','ehinome')";
When i type in the values i want inserted into the form, it works and gets inserted but when i try using variables that contains the values typed into a form, it does not get inserted.
What could be the problem, ive being on this for days. Thanks Ever heard of prepared statements? Could save you from Injection. See here or here |
Webmasters / Re: Post your PHP Problems Here by lovebondz(m): 7:29pm On Feb 27, 2015 |
kentc3: This code Uploads a picture into a database, but when i try to retrieve it and display it, the result is blank... i need you guys assistant on how to overcome this coz i ve been stuck here for weeks.. i will really appreciate it... Below is the Upload Script
if(isset($_POST['submit'])) { $name=$_POST['name']; $email=$_POST['email']; $pic=$_FILES['photo']['name'];
if((!empty($_FILES['photo'])) && ($_FILES['photo']['error']==0)) { $filename=basename($_FILES['photo']['name']); $ext= substr($filename, strrpos($filename,'.')+1); if(($ext == "jpg" || $ext == "gif" || $ext == "JPG" || $ext == "jpeg" || $ext == "JPEG" || $ext == "PNG" || $ext == "png" || $ext == "GIF" &&($_FILES['photo']['size']<100000000)) {
$newname=dirname(__FILE__).'/images1/'.$filename; if(!file_exists($newname)) { if((move_uploaded_file($_FILES['photo']['tmp_name'],$newname))) {
mysql_connect("Localhost","Gospel","gospel" or die("Could not connect" ; mysql_select_db("picture" or die("could not select db" ; $insert=mysql_query("INSERT INTO `pix`(`sn`, `fname`, `lname`, `image`) VALUES (NULL,'".$name."','".$email."','".$newname."')" or die("database not found" ; echo "<img src='$pic' alt='' height='300' width='500'>"."<br>"; echo "<img src='$newname' alt='' height='300' width='500'>"."<br>"; echo "its done! the file has been saved as:".$newname; } else { echo "Error! problem occured"; }} else { echo "error file:".$_FILES['photo']['name']."already exist"; }} else { echo "File format not supported"; }} else { echo "thank you, no file uploadedd"; } }
BELOW IS THE RETRIEVE AND DISPLAY SCRIPT
<?php mysql_connect("Localhost","Gospel","gospel" or die("Could not connect" ; mysql_select_db("picture" or die("could not select db" ;
$select=mysql_query("SELECT * from `pix` WHERE sn= 23 " or die("could not find" ; if(mysql_num_rows($select)==true) { $me=mysql_fetch_array($select); ?> <img src="<?php echo $me['image']; ?>" alt="" height="200" width="120"> <?php } ?>
Please i need a solution... Thanks
Properly check if a file is an image using exif-imagetype |
|
Webmasters / Re: Post your PHP Problems Here by lovebondz(m): 9:50pm On Feb 01, 2015 |
aje75:
except u right?? Oh, on the contrary, I am uber paranoid about my apps especially web apps. Always looking for vulnerabilities and testing with known attack vectors. So, I do understand what he was talking about. 1 Like |
Webmasters / Re: Post your PHP Problems Here by lovebondz(m): 12:05am On Jan 31, 2015 |
xyluz: But maybe its just me being paranoid Oh, okay. I guess its the same for most developers. 1 Like |
Webmasters / Re: Post your PHP Problems Here by lovebondz(m): 11:39pm On Jan 30, 2015 |
|
Webmasters / Re: Post your PHP Problems Here by lovebondz(m): 2:16pm On Jan 30, 2015 |
xyluz: You might also want to take note of your file and folder naming convention, its too predictable... Too predictable? I don't understand. With directory listing turned off using proper htaccess and only allowing specified routes to be accessed, I don't get how predictable naming conventions are a problem. Take me for example, my uploads and libraries are not in a publicly accessible path but other files are. Enlighten me. |
Webmasters / Re: Post your PHP Problems Here by lovebondz(m): 8:34pm On Jan 28, 2015 |
ispeaklight: mine is not realy a problem, i need to know what platfrom was myschool.com.ng built on, and how can i learn to build a site like that? Check Built with 1 Like |
Webmasters / Re: Help With Xammp Installation by lovebondz(m): 5:03pm On Jan 28, 2015 |
Although I prefer WAMP, your problem has a solution. Get Apache to listen to a different port or free up port 80 and your problem will be resolved. You probably have Skype, TeamViewer, or IIS installed. If you want to check the program using Port 80, open Command Prompt as administrator and run netstat -b -o -n -a | more You are looking for any program using 127.0.0.1:80 Check for the program using the port, if found check the settings for the program and change the port it listens to. If none of that works out. To get Apache to use a different port, edit your httpd.conf file and change Listen 80 to listen 8080. Restart Apache. If you use a port other than 8080, you'll have to visit http://localhost:<port> to see your pages. |
Webmasters / Re: Redesign Of Forexbyteemy.com by lovebondz(m): 10:59pm On Jan 27, 2015 |
teemy: Looking on to your contributions. Cheers and thanks. Ok then, you should start by turning off errors on your production server then.... I have seen things. 1 Like |
Webmasters / Re: Post your PHP Problems Here by lovebondz(m): 10:24pm On Jan 27, 2015 |
Walexwal: Pls knidly help me on my site problem. www.agripreneurforum.com. I just uploaded this script. I was told the problem is with my mysql database but I don't know how to create it. Pls kindly help! You don't know how to create a MySQL database? First, check the FAQ page of your hosting provider for their MySQL connection configuration. Open your website via FTP and change the settings in Connections/forum.php to the one from your host (check line 9) Your site should work. Login to your cpanelUnder PHP settings, turn off Display Errors. 1 Like |
Webmasters / Re: Redesign Of Forexbyteemy.com by lovebondz(m): 9:58pm On Jan 27, 2015 |
teemy:
My wamp has been failing me ever since I tampered with my windows features. Been looking for how to reset it to default. Uninstalling, reinstalling just does not work which sort of keeps discouraging me. Which Windows feature did you mess with? |
Webmasters / Re: Redesign Of Forexbyteemy.com by lovebondz(m): 9:56pm On Jan 27, 2015 |
teemy:
If you in, I would really appreciate you commiting to this project. Just prompts to, do this - do that. You get my drift.
Where is the project? You could put it on a public or private git server and I'll be happy to send you pull requests. PHP 5.4 up though... I could still reinstall that. |
Webmasters / Re: Redesign Of Forexbyteemy.com by lovebondz(m): 10:30am On Jan 25, 2015 |
When does the "week" start? |
Webmasters / Re: Fellow Weblanders, Help Me Review This Website. by lovebondz(m): 9:37pm On Jan 22, 2015 |
It isn't responsive. But since you asked for the review to be done from a pc, I assume you have a mobile site. There are 3 google-site-verification codes on the site, any particular reason? Your HTML markup starts with <xml>, you could fix that. You have 2 <body> tags © 2014 should be 2015 As for the content, its ok. You could make the header a little more inviting though, a moving text and a spinning image don't cut. Your contact page could use a little more work though. All websites we design are SEO friendly You apply that to your site with meta info. All in all, its good for a start. |
TV/Movies / Re: Jumong Vs Game Of Throne by lovebondz(m): 1:41pm On Jan 16, 2015 |
1 Like |
Webmasters / Pushing My Site Live For Testing. by lovebondz(m): 10:35pm On Jan 15, 2015 |
I have been working for a while (a long while) on a web project for messaging. When I started then, I just wrote everything together, had over 2000 lines hand written CSS excluding Bootstrap. I was just about pushing live then, found a few errors and it took me a while to track down. What I did was rewrite my site the OOP way, separating view from controller using a very light framework ~65KB. * What I do now is use GIT to track changes and deploy when necessary. * Use Bower and Composer for dependency management. * Use CoffeeScript to save time writing JS * Use Less to separate and combine css. * Use Chrome for cross platform testing and Firefox for Devs for responsive testing. * Use NodeJS and Grunt for automated testing. There are still some kinks I feel like I need to work out but again, I feel like I can't get them all until I push live. Do you think I should? Or just get it done on my pc and push live for production and work out the kinks when users submit support requests? |
Webmasters / Re: Have I Been Hacked? (pics) by lovebondz(m): 10:17pm On Jan 15, 2015 |
I use GoDaddy and their support has been valuable a few times. |
Webmasters / Re: Have I Been Hacked? (pics) by lovebondz(m): 10:51pm On Jan 11, 2015 |
Possibly. Can't know for sure. GoDaddy plans usually have an "unlimited" disk space with some restrictions.
First thing you should have done is to contact GoDaddy support. |