howdy!
Im playing around with forms and php and i found this script on the web..
It works on solaris 8/mysql/php4.21/apache2.0.39 and inserts the form into a mysql database...
But, when I try to run it my linux box, nothing happens. Ive tryed everything..reinstalling apache/php/mysql and it just wont work on the linux box. I know apache/php/mysql are working right.
Does anybody know whay may be wrong?
Will someone try this out to see if it works on their box?
Basically I have the same setup on both machines and it works on the Solaris box but not the linux box =(
heres the script:
<html>
<body>
<?php
if ($submit) {
$username="root";
$password="test";
$database="test";
#$finaldate="$Year-$Month-$Day";
mysql_connect(localhost,$username,$password)or die ("Unable to access the
database");
@mysql_select_db($database) or die( "Unable to select database");
$sql = "INSERT INTO test (first,last,address,position) VALUES
('$first','$last','$address','$position')";
$result = mysql_query($sql);
echo "Thank you! Information entered.\n";
} else{
?>
<form method="post" action="<?php echo $PHP_SELF?>">
First name:<input type="Text" name="first"><br>
Last name:<input type="Text" name="last"><br>
Address:<input type="Text" name="address"><br>
Position:<input type="Text" name="position"><br>
<input type="Submit" name="submit" value="Enter information">
</form>
<?php
}
?>
</body>
</html>