Ik heb de php/mysql tutorial van http://hotwired.lycos.com...page4.html?tw=programming gevolgd.
Ik heb pws 4 en php 4.3.0 geinstalleerd, waarbij in PWS alle directories alle rechten hebben.
Dit ging goed totdat er een script stond waarmee data via een form in een database wordt gezet.
Script ziet er zo uit:
<html>
<body>
<?php
if ($submit) {
// process form
$db = mysql_connect("localhost", "root");
mysql_select_db("mydb",$db);
$sql = "INSERT INTO employees (first,last,address,position) VALUES ('$first','$last','$address','$position')";
$result = mysql_query($sql);
echo "Thank you! Information entered.\n";
} else{
// display form
?>
<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
} // end if
?>
</body>
</html>
Als ik dit zo uitvoer krijg ik een http 405 error.
Volgens mij is er wat met php_self maar wat?
Ik heb pws 4 en php 4.3.0 geinstalleerd, waarbij in PWS alle directories alle rechten hebben.
Dit ging goed totdat er een script stond waarmee data via een form in een database wordt gezet.
Script ziet er zo uit:
<html>
<body>
<?php
if ($submit) {
// process form
$db = mysql_connect("localhost", "root");
mysql_select_db("mydb",$db);
$sql = "INSERT INTO employees (first,last,address,position) VALUES ('$first','$last','$address','$position')";
$result = mysql_query($sql);
echo "Thank you! Information entered.\n";
} else{
// display form
?>
<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
} // end if
?>
</body>
</html>
Als ik dit zo uitvoer krijg ik een http 405 error.
Volgens mij is er wat met php_self maar wat?