Ik ben dus een beetje simpel bezig met een guestbook , de gegevens worden dan ingevoerd in de Mysql database. Ik ben dus al een paar uur bezig maar krijg het maar niet voor elkaar.
Het probleem is dus dat hij NIETS invoert in MySQL
, ik snap niet wat ik fout doe, het zal wel iets kleins zijn. Ik hoop dat jullie mij kunnen helpen. Ik krijg namelijk ook geen foutmelding. De aangemaakt table guestbook in MySQL is iig goed.
---------------------
Sign.php
---------------------
<body>
<h2> Sign my Guest book</h2>
<form method=post action="create_entry.php">
<b> Name:</b>
<input type=text size=40 name=name>
<br>
<b> Location:</b>
<input type=text size=40 name=location>
<br>
<b> Email: </b>
<input type=text size=40 name=email>
<br>
<b> Home page url: </b>
<input type=text size=40 name=url>
<br>
<b>Comments:</b>
<textarea name=comments cols=40 rows=4 wrap=virtual> </textarea>
<br>
<input type=submit name=submit value="Sign!">
<input type=reset name=reset value="Start Over">
</form>
-----------------------
create_entry.php
------------------------
<body>
<?php
include("dbconnect.php");
if ($submit == "Sign!")
{
$query = "insert into guestbook
(name,location,email,url,comments) values
('$name', '$location', '$email', '$url', '$comments')"
;
mysql_query($query) or
die (mysql_error());
?>
<h2> Thanks!!</h2>
<h2> <a href="view.php"> View My guestbook!!! </a></h2>
<?php
}
else
{
include("sign.php");
}
?>
---------------------
dbconnect.php
----------------------
<?php
mysql_connect("localhost", "root","------") or die ("could not connect to database");
mysql_select_db("guestbook") or die ("could nog connect to database");
?>
Het probleem is dus dat hij NIETS invoert in MySQL
---------------------
Sign.php
---------------------
<body>
<h2> Sign my Guest book</h2>
<form method=post action="create_entry.php">
<b> Name:</b>
<input type=text size=40 name=name>
<br>
<b> Location:</b>
<input type=text size=40 name=location>
<br>
<b> Email: </b>
<input type=text size=40 name=email>
<br>
<b> Home page url: </b>
<input type=text size=40 name=url>
<br>
<b>Comments:</b>
<textarea name=comments cols=40 rows=4 wrap=virtual> </textarea>
<br>
<input type=submit name=submit value="Sign!">
<input type=reset name=reset value="Start Over">
</form>
-----------------------
create_entry.php
------------------------
<body>
<?php
include("dbconnect.php");
if ($submit == "Sign!")
{
$query = "insert into guestbook
(name,location,email,url,comments) values
('$name', '$location', '$email', '$url', '$comments')"
;
mysql_query($query) or
die (mysql_error());
?>
<h2> Thanks!!</h2>
<h2> <a href="view.php"> View My guestbook!!! </a></h2>
<?php
}
else
{
include("sign.php");
}
?>
---------------------
dbconnect.php
----------------------
<?php
mysql_connect("localhost", "root","------") or die ("could not connect to database");
mysql_select_db("guestbook") or die ("could nog connect to database");
?>