Jump to content

princeofpersia

Members
  • Posts

    208
  • Joined

  • Last visited

    Never

Everything posted by princeofpersia

  1. yup, worked fantastic, u r a star mate. thanks for your time and advice
  2. thanks im trying it but what is going to be some_field here?
  3. there you go ________________________ <?php session_start(); include ("global.php"); //username session $_SESSION['username']=='$username'; $username=$_SESSION['username']; //welcome messaage echo "Welcome, " .$_SESSION['username']."!<p>"; if ($_POST['register']) { //get form data $name = addslashes(strip_tags($_POST['name'])); $update = mysql_query("UPDATE users VALUES ('$_POST[name]') WHERE username='$username'"); } ?> <form action='updateprofile.php' method='POST'> Company Name:<br /> <input type='text' name='name'><p /> <input type='submit' name='register' value='Register'> </form>
  4. Ive changed it to update but still can not see anything added, its funny because i dont even get an error :'(
  5. I have echoed the username in the code echo "Welcome, " .$_SESSION['username']."!<p>"; and it works fine, the username shows up
  6. Thanks for help, I have added the session_start(); but still when i insert name, i can see the name added to my column in phpmyadmin, any ideas?
  7. Hi guys I have a registration form working fine, my database is as below: userid username email password repeatpassword I have added another column which is "name", users can update their profile once they have logged in so I have created updateprofile.php and when I login-->go to update profile and insert my name nothing adds to mysql name column this is my code below: <?php include ("global.php"); //username session $_SESSION['username']=='$username'; $username=$_SESSION['username']; //welcome messaage echo "Welcome, " .$_SESSION['username']."!<p>"; if ($_POST['register']) { //get form data $name = addslashes(strip_tags($_POST['name'])); $update = mysql_query("INSERT INTO users (name) VALUES ('$_POST[name]') WHERE username='$username'"); } ?> <form action='updateprofile.php' method='POST'> Company Name:<br /> <input type='text' name='name'><p /> <input type='submit' name='register' value='Register'> </form> can you please tell me where in this code is wrong? Im new in php so please excuse me if I have silly mistakes. thanks in advance
×
×
  • 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.