Jump to content

Zigster316

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Zigster316's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. That is exactly what I needed thanks. I am a newbie in this stuff so I love these forums!
  2. I am making a database that stores hockey players with their : Name Age Number Position How would I be able to make it so that if I displayed all the info in the table that it were to order it in by the player's number?
  3. I want to make a skin chooser out of a drop down menu but have no idea what to do. I know I need to use cookies bu what else do I need to do?
  4. Could I please see what is in header.php and footer.php? Also what does the $user->id do? I have no idea what -> does! (I am sort of new to some PHP)
  5. Okay so you connected to the database but did you select market1?
  6. Andy you got the problem right! I forgot a database select query! Now I have the query in there and it works! Thank you.
  7. The form code is: <form action="handle_form.php" method="post"> <fieldset><legend>Suggestions Form</legend> <p><b>Name:</b><input type="text" name="name" maxlength="40"></p> <p><b>Email:</b><input type="text" name="email" maxlength="60"></p> <p><b>Email Subject:</b><input type="text" name ="subject" maxlength="40"></p> <p><b>Gender:</b><input type="radio" name="gender" value="M">M <input type="radio" name="gender" value="F">F</p> <p><b>Age:</b><select> <option value ="012">0-12</option> <option value ="1320">13-20</option> <option value ="2140">21-40</option> <option value ="4060">40-60</option> <option value ="61over">61+</option> </select></p> <p><b>Comments:</b><textarea name="comments" rows="5" cols="40"></textarea></fieldset> <center><input type="submit" value="Submit">
  8. I am using a server that has MySQL v4.1 and my code is supposed to take data entered into an HTML for and insert it into a database. All that is happening though is that I am only having on field fill out and that is my person id which isn't retrieved from the form. Any ideas?! Here is the whole code(with php) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Form Output</title> </head> <body> <?php include("header.php"); ?> <?php $con=mysql_connect ("localhost", "prince_Prince", "password");//not real password for security if (!$con) { die('Could not connect: ' . mysql_error()); } $name = mysql_real_escape_string($_POST["name"]); $gender = mysql_real_escape_string($_POST["gender"]); $email = mysql_real_escape_string($_POST["email"]); $comments = mysql_real_escape_string($_POST["comments"]); mysql_query("INSERT INTO `emails` (`Name`, `Gender`, `Email`, `Comments`) VALUES ('$name', '$gender', '$email', '$comments')"); mysql_close($con); ?> <?php $name = $_REQUEST['name']; $email = $_REQUEST['email']; $subject = $_REQUEST['subject']; $age = $_REQUEST['age']; $gender = $_REQUEST['gender']; $comments = $_REQUEST['comments']; $to = "ziggy6005@gmail.com"; $subject = "$subject"; $message = "$name $email $gender $comments"; mail($to,$subject,$message); echo "Thank you $name. I have now received an email containing the following information: <br/> Name: $name <br/> Email: $email <br/> Email Subject: $subject <br/> Age: $age <br/> Gender: $gender <br/> Comments: $comments"; ?> <?php include ("footer.php"); ?> </body> </html>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.