Jump to content

shawndibble

New Members
  • Posts

    5
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

shawndibble's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Sorry, i am fairly new to php. I will look up what you said. Here is the code for the full page. <!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=utf-8" /> <title>EXpediter</title> <link media="screen" href="style.css" rel="stylesheet" type="text/css" /> <link media="handheld, tty" rel="stylesheet" type="text/css" href="device.css" /> <style type="text/css"> <!-- .style3 {font-size: 12px} --> </style> </head> <body> <table cellspacing="0" cellpadding="0"> <tr> <td rowspan="3" height="500"><img src="images/image_01.jpg" width="35" height="500" /></td> <td valign="top" height="59" style="max-height:59px;height:59px;"><img src="images/image_02.jpg" width="238" height="59" /></td> <td rowspan="3" headers="500"><img src="images/image_03.jpg" width="35" height="500" /></td> </tr> <tr> <td valign="top" height="315"> <?php include 'menu.php'; ?> <div class="content"> <?php if(isset($_POST['add'])) { include 'config.php'; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); mysql_select_db($dbname); $firstname = $_POST['firstname']; $lastname = $_POST['lastname']; $business = $_POST['business']; $phone = $_POST['phone']; $email = $_POST['email']; $address = $_POST['address']; $city = $_POST['city']; $state = $_POST['state']; $zip = $_POST['zip']; $country = $_POST['country']; $step = $_POST['step']; $comments = $_POST['comments']; $query = "INSERT INTO clients (firstname, lastname, business, phone, email, address, city, state, zip, country, step, comments) VALUES ('$firstname', '$lastname', '$business', '$phone', '$email', '$address', '$city', '$state', '$zip', '$country', '0', '$comments')"; mysql_query($query); mysql_close($conn); } ?> <form method="post"> <table cellpadding="0" cellspacing="0"> <tr> <td><input name="firstname" type="text" id="firstname" value="First Name" size="13" /> <input name="lastname" type="text" id="lastname" value="Last Name" size="13" /></td> <td><a href="clientlist.php" style="padding-left:0px;">Return to client list</a></td> </tr> </table> <input name="business" type="text" id="business" value="Business Name" size="30" /> <input name="phone" type="text" id="phone" value="Phone Number" size="30" /> <input name="email" type="text" id="email" value="Email Address" size="30" /> <input name="address" type="text" id="address" value="Address" size="30" /> <input name="city" type="text" id="city" value="City" size="20" /> <input name="state" type="text" id="state" value="State" size="3" /> <input name="zip" type="text" id="zip" value="Zip" size="12" /> <input name="country" type="text" id="country" value="Country" size="11" /> <textarea name="comments" id="comments" size="30" rows="4" wrap="virtual">Comments</textarea> <br /> <input name="add" id="add" type="submit" value="SAVE" /> <?php if(isset($_POST['add'])) { echo "New User Added"; header ("Location: http://www.newsalesparadigm.com/ex-sample/pretest.php"); } ?> </form></div> <div class="footer">©<?php echo date(Y); ?> <em>The EXpediter</em> Morgen Facilitations,Inc.</div> </td> </tr> <tr> <td valign="bottom" height="126"><img src="images/image_05.jpg" width="238" height="126" /></td> </tr> </table> </body> </html>
  2. Yes they are. I have another page that pulls all the records and they are there and show up. It is just on the create client page, I want it to go to a specific page after the client is created instead of just reloading the create client page.
  3. I have tried that and it doesn't forward. Also, I can't pull the id of the data that was just inserted. So no $sID for the url.
  4. I have a page that inserts information to a database. But right now, it just refreshes the page when done. What I want to do is for the user to be directed to a specific page with the ID of the last insert in the url. As you can see, I am using the following To pull the id from the last insert $sID = mysql_insert_id(); To take the user to the next page after inserting the data header ("Location: http://www.newsalesparadigm.com/ex-sample/pretest.php?id=$sID"); <div class="content"> <?php if(isset($_POST['add'])) { include 'config.php'; include 'opendb.php'; $firstname = $_POST['firstname']; $lastname = $_POST['lastname']; $business = $_POST['business']; $phone = $_POST['phone']; $email = $_POST['email']; $address = $_POST['address']; $city = $_POST['city']; $state = $_POST['state']; $zip = $_POST['zip']; $country = $_POST['country']; $step = $_POST['step']; $comments = $_POST['comments']; $query = "INSERT INTO clients (firstname, lastname, business, phone, email, address, city, state, zip, country, step, comments) VALUES ('$firstname', '$lastname', '$business', '$phone', '$email', '$address', '$city', '$state', '$zip', '$country', '0', '$comments')"; mysql_query($query); $sID = mysql_insert_id(); include 'closedb.php'; } ?> <form method="post"> <table cellpadding="0" cellspacing="0"> <tr> <td><input name="firstname" type="text" id="firstname" value="First Name" size="13" /> <input name="lastname" type="text" id="lastname" value="Last Name" size="13" /></td> <td><a href="clientlist.php" style="padding-left:0px;">Return to client list</a></td> </tr> </table> <input name="business" type="text" id="business" value="Business Name" size="30" /> <input name="phone" type="text" id="phone" value="Phone Number" size="30" /> <input name="email" type="text" id="email" value="Email Address" size="30" /> <input name="address" type="text" id="address" value="Address" size="30" /> <input name="city" type="text" id="city" value="City" size="20" /> <input name="state" type="text" id="state" value="State" size="3" /> <input name="zip" type="text" id="zip" value="Zip" size="12" /> <input name="country" type="text" id="country" value="Country" size="11" /> <textarea name="comments" id="comments" size="30" rows="4" wrap="virtual">Comments</textarea> <br /> <input name="add" id="add" type="submit" value="SAVE" /> <?php if(isset($_POST['add'])) { echo "New User Added"; header ("Location: http://www.newsalesparadigm.com/ex-sample/pretest.php?id=$sID"); } ?>
×
×
  • 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.