Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jan 2010
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    enter value from form to database table

    in my php page , ther is a form for ntering email , shown below ..
    whenever a user enters email , i need to add tat to my database table 'log_table'.

    Code:
    <tr><td>email</td><td><input type="text" id="email" name="email" value=""/></td></tr>
    to add to table , i used the foll , query

    s
    PHP Code:
    ql_query("INSERT INTO log_table (email) VALUES ('$_POST['email]')"); 
    but it doesnt work.. pls give me a solution ..

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,864
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    What's ql_query() ?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    I think the code was cut off, it's suppose to be this.

    PHP Code:
    mysql_query("INSERT INTO log_table (email) VALUES ('$_POST['email]')"); 
    Rowsdower! has accused me of having mental problems, and the administrator allowed it. What a great forum huh?

  • #4
    Regular Coder
    Join Date
    Jul 2003
    Posts
    117
    Thanks
    0
    Thanked 17 Times in 17 Posts
    make it simpler!
    PHP Code:
    $email=$_POST['email'];
    //do email validation here, remove any quotes
    // from the email input or else expect sql injection attacks!

    mysql_query("INSERT INTO log_table (email) VALUES ('$email')"


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •