SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: form submission

  1. #1
    SitePoint Member
    Join Date
    Sep 2005
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    form submission

    The following isn't working, and I'm not sure why.

    I've got a basic form to add email addresses

    PHP Code:
    <html
    <
    head><title>Do Not Email</title></head
    <
    body
    ****<
    form action="donotemailphp.php" method="POST">
    Enter your email address to take your name off the list.<br><br>
    <
    input type="text" name="email" size="30">
    <
    p><input type="submit" name="submit" value="Submit"></p>
    </
    form>
    </
    body
    </
    html
    and the donotemailphp.php file
    PHP Code:
    <?
    include_once('/usr/home/fss/websites/fivestarsports.net/inc/func.inc.php');
    $db_conn five_connect_db();
    mysql_select_db('fivestar',$db_conn);
    $sql "INSERT INTO donotemail(email) VALUES ('', '$_POST[email]')";
    if (
    mysql_query($sql$db_conn)) {
    echo 
    "record added!";
    }else{
    echo 
    "something went wrong in database communication";
    }
    ?>
    Does anyone see anything wrong? I'm still a newb by the way.
    Thanks.

  2. #2
    SitePoint Wizard
    Join Date
    Mar 2004
    Posts
    1,647
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    <? 
    include_once('/usr/home/fss/websites/fivestarsports.net/inc/func.inc.php'); 
    $db_conn five_connect_db(); 
    mysql_select_db('fivestar',$db_conn); 
    $email $_POST["email"];
    $sql mysql_query("INSERT INTO donotemail VALUES ('', '$email')"); 
    if (
    $sql) { 
    echo 
    "record added!"
    }else{ 
    echo 
    "something went wrong in database communication"

    ?>
    for this use the php forum not php application design forum...
    cheers


Bookmarks

Posting Permissions

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