My first post! Need a little help on a very simple script.
The above code does NOT forward to view.php after everything else is finished. Doesn't return an error - doesn't do anything. Just stays on the current (blank) page.PHP Code:<?php
$host = "yada";
$user = "blah";
$database = "blahblah";
$id = mysql_connect($host,$user);
mysql_select_db($database, $id);
//while (list ($key, $val) = each ($HTTP_POST_VARS)) {
// echo "<br>$key: $val";
//}
$title=$HTTP_POST_VARS["title"];
$startDate=$HTTP_POST_VARS["startDate"];
$endDate=$HTTP_POST_VARS["endDate"];
$description=$HTTP_POST_VARS["description"];
$address=$HTTP_POST_VARS["address"];
$city=$HTTP_POST_VARS["city"];
$state=$HTTP_POST_VARS["state"];
$zip=$HTTP_POST_VARS["zip"];
$phone=$HTTP_POST_VARS["phone"];
$email=$HTTP_POST_VARS["email"];
$web=$HTTP_POST_VARS["web"];
$sql = "INSERT INTO calender(ID,title,startDate,endDate,description,address,city,state,zip,phone,email,web) VALUES('','$title','$startDate','$endDate','$description','$address','$city','$state','$zip','$phone','$email','$web')";
$result = mysql_query($sql);
Header("Location: view.php");
?>
Also, is there a better way to assign values to each of my post vars?
If I don't declare them like this:
$web=$HTTP_POST_VARS["web"];
then I can't refer to them by name. Example, I can't use the variable $web unless I declare it as above -- even though it was passed as a post var with the name of web already?
Hmmm...
Thanks everyone
EDIT: I'm using "Small HTTP Server" and PHP 4 on windows 98, if that helps.









Bookmarks