Jump to content

sastiger

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

sastiger's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. If you would like to shair that with me chronister then please do also how do I read date from it? Like lets say the petname ? Thanks Everyone for your help :>
  2. Thanks for that andy but on the database it just shows up as blank input ???
  3. Still am getting the same error here is my page which is posting to the php file <html> <head> <title>Pet creation page</title> </head> <body> <form method="post" action="post.php"> <td>Pet name:</td> <input type="text" name="$petname" value="" size="12" /> <br> <td>Type:</td> <input type="text" name="$pettype" value="" size="12" /> <br> <td>Price:</td> <input type="text" name="$petprice" value="" size="12" /> <br> <input type="submit" value="Update Database" /> </form> </body> </html> and here is my php post page <?php $petname = $_POST['name']; $pettype = $_POST['type']; $petprice = $_POST['250']; $host="localhost"; $user="root"; $pass="majick"; mysql_connect ("$host", "$user", "$pass") or die ( mysql_select_db(pet) $result = mysql_query("INSERT INTO animal (name, type, price) VALUES ('$petname', '$pettype', '$petprice'); mysql_query or die (’Error updating database’); ?> PLEASE HELP
  4. I keep getting this Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\htdocs\home\post.php on line 8 Here is my actual code for the post.php page <?php $loginname = $_POST['loginname']; $password = $_POST['password']; mysql_connect ("localhost", "root", "majick") or die ( mysql_select_db ("animal1") $result = mysql_query("INSERT INTO login ($username, $password) VALUES ('$username', $password')"); mysql_query($query) or die (’Error updating database’); echo “database was updated with: ” ".$username.” “.$password.”; ?> Please help me any help would be greatly appreciated!
×
×
  • 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.