DiamondLil
Technical User
Hi guys. I just got to revisted my not-quite-working-yet script trying to update a mysql database from a form(html & php), can you help?
page is supposed to look like: (except of course that the submit button is actually supposed to submit the variables to the db)
I'm using :
<form method="post" action="<?php echo $PHP_SELF?>">
<?php
$HTTP_['loadavaildate','origcity','origstate','destcity','deststate']_VARS;
if ($newentry == "submit" {
$sql = "INSERT INTO prologiloads SET
loaddate='$loadavaildate',
origcity='$origcity',
origstate='$origstate',
destcity='$destcity',
deststate='$deststate'";
if (@mysql_query($sql)) {
echo "<p>Your entry has been added.</p>";
} else {
echo "<p>There has been an error adding your entry: " .
mysql_error() . "</p>";
}
}
//mysql_close();
?>
I'm not sure where to put the HTTP_'variable'_VAR; . I also know the syntax is wrong -the line keeps getting pegged for errors, not sure how to fix it. I have another section before this one that just pulls and displays the info that the user should be able to change, should this go up there or in this php section?
-L.
page is supposed to look like: (except of course that the submit button is actually supposed to submit the variables to the db)
I'm using :
<form method="post" action="<?php echo $PHP_SELF?>">
<?php
$HTTP_['loadavaildate','origcity','origstate','destcity','deststate']_VARS;
if ($newentry == "submit" {
$sql = "INSERT INTO prologiloads SET
loaddate='$loadavaildate',
origcity='$origcity',
origstate='$origstate',
destcity='$destcity',
deststate='$deststate'";
if (@mysql_query($sql)) {
echo "<p>Your entry has been added.</p>";
} else {
echo "<p>There has been an error adding your entry: " .
mysql_error() . "</p>";
}
}
//mysql_close();
?>
I'm not sure where to put the HTTP_'variable'_VAR; . I also know the syntax is wrong -the line keeps getting pegged for errors, not sure how to fix it. I have another section before this one that just pulls and displays the info that the user should be able to change, should this go up there or in this php section?
-L.