Hello, this is my first post here so please bear with my newbness.
First a little background:
I am getting married soon and I am trying to make it so that guests can RSVP online. I have been studying HTML, PHP, and mysql for the last few days so that I can make this happen. I have NO background in any of these things except what I have taught myself online in order to make my wedding website and to try to do this online reservation thing.
I have an account with godaddy.com. My website is not hosted with them but I have a mysql database hosted through them.
Basically what I have done so far is created a form for people to fill out. What I have not been able to successfully do is make it so that when the "submit" button is pushed the data is sent to a table in my mysql database.
I'm not even sure that I know how to connect to the database through a webpage.. anyways, I am going to post what I have and would appreciate it if someone could tell me where to go from here.
How do I go from this to submitting this to my database?
Quote:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN" "http://www.w3.org/TR/html4/loose.dtd">
<?php
$attending = $_POST["attending"];
$numberguests = $_POST["numberguests"];
$firstname = $_POST["firstname"];
$lastname = $_POST["lastname"];
$emailaddress = $_POST["emailaddress"];
if (!isset($_POST['submit'])) {
?>
<html>
<head>
<title>Wedding Reservations</title>
<script>
var p=confirm("The reservation process is password protected. The password is located on the wedding invitation you received in the mail. Do you have the password?")
if(p){
var ans="5302010"
var pass=prompt("Please enter the password.")
if(pass!==ans)
{
alert("Sorry, that is incorrect. Please try again. If you are unable to gain access to the reservation page please contact me at andrew.scott.dale@gmail.com.")
//wrong
window.location="http://www.drewandjess.net"
}else{alert("Thank you!");}
}else{window.location="http://www.drewandjess.net"}
</script>
</head>
<body>
<form method="post" action="<?php WHATGOESHERE???? ;?>">
Will you be attending the wedding?
<br />
<input type="radio" name="attending" value="Yes" /> Yes
<br />
<input type="radio" name="attending" value="No" /> No
<br /><br />
Including yourself, how many guests will be in your party?
<select name="numberguests">
<option value="oneguest">1</option>
<option value="twoguests: selected="selected">2</option>
<option value="threeguests">3</option>
<option value="fourguests">4</option>
<option value="fiveguests">5</option>
<option value="sixguests">6</option>
<option value="sevenguests">7</option>
<option value="eightguests">8</option>
<option value="nineguests">9</option>
<option value="tenguests">10</option>
</select>
<br />
First name:
<input type="text" name="firstname" />
<br />
Last name:
<input type="text" name="lastname" />
<br />
Email Address:
<input type="text" name="emailaddress" />
<br /><br />
<input type="submit" value="Submit Your Reservation!" name="submitbutton">
</form>
</body>
</html>
|
Thanks in advance guys.
Drew