vnichol Posted December 7, 2010 Share Posted December 7, 2010 I know this is very simple, but... Any way here is the code for my form, but it doesn't post to my database and there are no errors shown. Any ideas? thanks <? include("include/session.php");?> <? include('include/headder_login.php'); ?> <h1>Event Information : <? echo $session->username; ?></h1> <form> <form action="protimes.php" method="post" name="event information"> <input name="id" type="text" value=""> <input name="name" type="number" value="name" size="30"> <select name="event"> <option value="1">50 Front</option> <option value="2">50 Back</option> <option value="3">100 Front</option> </select> <input name="time" type="time" value"time" > <input name="date" type="date" value="date"> <input name="submit" type="button" value="submit" align="right"> <input type="reset" name="reset" value="reset"aligh="right"> </form> protimes.php file $sql="INSERT INTO `cbcrusta_test3`.`info` ( `id` , `name` , `event` , `time` , `date` ) VALUES ('$_POST[id]','$_POST[name]','$_POST[event]','$_POST[time]','$_POST[date')"; if (!mysql_query($sql)) { die('Error: ' . mysql_error()); } echo "1 record added"; Link to comment https://forums.phpfreaks.com/topic/220969-php-form-not-working/ Share on other sites More sharing options...
ohdang888 Posted December 7, 2010 Share Posted December 7, 2010 try $sql="INSERT INTO `cbcrusta_test3`.`info` ( `id` , `name` , `event` , `time` , `date` ) VALUES ('".$_POST['id']."','".$_POST['name']."','".$_POST['event']."','".$_POST['time']."','".$_POST['date']."') Link to comment https://forums.phpfreaks.com/topic/220969-php-form-not-working/#findComment-1144200 Share on other sites More sharing options...
Pikachu2000 Posted December 7, 2010 Share Posted December 7, 2010 You don't have display errors = On, if you did you'd get a parse error on the line with the query string. VALUES ( '{$_POST['id']}', '{$_POST['name']}', '{$_POST['event']}', '{$_POST['time']}', '{$_POST['date']}' )"; Link to comment https://forums.phpfreaks.com/topic/220969-php-form-not-working/#findComment-1144202 Share on other sites More sharing options...
vnichol Posted December 8, 2010 Author Share Posted December 8, 2010 this is still not working, but I am guessing that as well as the phrase error, there must be errors created by the includes <? include("include/session.php"); // keeps track of login include('include/headder_login.php'); ?>// gives page menu because the form doesn't even seem to get to the protimes page which should do the processing of the post data. If you have any other ideas thank you very much, if not I will keep looking.... again thanks for the help. vincent. Link to comment https://forums.phpfreaks.com/topic/220969-php-form-not-working/#findComment-1144471 Share on other sites More sharing options...
vnichol Posted December 9, 2010 Author Share Posted December 9, 2010 Thank you all for the help, it was the includes and a , that ended up being the problem. Again thanks for the help. vincent. Link to comment https://forums.phpfreaks.com/topic/220969-php-form-not-working/#findComment-1144912 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.