Guys From hours I am working on a small simple php data entry form but due to some reasons I am fail, please check this code When I click submit after data entry a blank page opens and url turns like "http://www.globalcashsite.com/manager/signup1.php?submit=&desc=ksjdkasdjlksdj&email=lsjdalkjdlksdjs%40gamic.om&type=Site&status=Active&remarks=asdasdsa&submit=Submit" I don't know where I am making mistake. GCS
assuming you have register globals turned off, you should assign the posted vars to your own var first... eg: $desc = $_POST['desc']; then, looking at your sql, you can easily tell that it will cause an error because the fields does not match up with the data, make sure the field and data match up accordingly
Thanks buddy, actually I tried this without adding record in database. Instead of adding record in database I tried to print some comments or tried Alert box but script was not coming into if($submit) loop? GCS
so that confirms that you have register globals off.. try to view the posted vars and values using this code... if( !empty($_POST['submit') ) { echo '<pre>'; print_r($_POST); }
not yet, at this point $submit is an empty variable, since you havent assigned anything to it unless you do this... $submit = $_POST['submit']; when your server have Register Globals Off (and by default this is usually off for security reasons) your posted variables does not in any way magically become variables, you need to assign them explicitly
Thank you buddy, I was understanding logic why my code was not working and you helped me to understand this. Although I paid money to someone for custom data entry form and get this problem solved but it is also important to understand logic. GCS
change <FORM name=signup action=signup1.php method=post"> this line to <FORM name="signup" action="" method="post">