ok i added some script that different people sent me into dreamweaver but it still isnt working. Ill put the bits of code here and explain where i put them:
i put this next code at the very top, before the html:
<?php
$db_host = "localhost";
$db_user = "coronagi_andre1";
$db_pwd = "Yvonne4444";
$db_name = "coronagi_SecondUsers";
mysql_connect($db_host, $db_user, $db_pwd);
mysql_select_db($db_name);
?>
Then i put this code right before the form:
<?php
if (!isset($_POST['submit'])) {
?>
<form action="" method="post">
and then this directly after my form ends:
} else {
$FirstName = $_POST['firstname'];
$LastName = $_POST['lastname'];
$City = $_POST['city'];
mysql_query("INSERT INTO `person` (firstname, lastname, city) VALUES ('$FirstName', '$LastName', '$City')");
echo "Success!";
}
?>
the database information is all correct. I have just no idea what im doign and im trying to fit it into my webpage as if i were building frankenstein.
Added php in dreamweaver and form will not submit?
php is a great time and alot of fun ::lol:: but Ive ran into some problems with this stuff before, the best thing to do is obviously make sure you have a mysql database setup, and I usually just setup of phpbb forum or something to test the database since I know how to do that for sure :P
Added php in dreamweaver and form will not submit?
Your form needs an action, try:
<form action="<? $_SERVER['PHP_SELF']; ?>"
Also, since your relying on the submit object being present, are you sure your submit button for the form is similar to:
<input type="submit" name="submit" value="Send Form" />
If that don't help, paste the entire script, and explain exactly what goes wrong plus any errors PHP produces.