Jump to content

PHP form not working


vnichol

Recommended Posts

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

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']}' )";

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.