1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

php form help

Discussion in 'PHP' started by drew68, Sep 13, 2006.

  1. #1
    i have this page...

    http://www.nodents.com/paintless_dent_repair_courseenrollment.html

    and i have this for generating it...

    <?
    if ($REQUEST_METHOD == "POST") {

    // Just to be safe, I strip out HTML tags
    $realname = strip_tags($realname);
    $email = strip_tags($email);
    $feedback = strip_tags($feedback);

    // set the variables
    // replace $me@mysite.com with your email
    $sendto = "$benjijaded123@yahoo.com";
    $subject = "Paintless Dent Repair Course Enrollment";
    $message = "$fullname, $email\n\n$dayphone";

    // send the email
    mail($benjijaded123@yahoo.com, $Paintless Dent Repair Course Enrollment, $fullname, $email\n\n$dayphone);

    }
    ?>


    however i keep getting this...

    The requested URL /< was not found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


    can someone help me figure out what's wrong with the way i coded this?

    thanks!
     
    drew68, Sep 13, 2006 IP
  2. surefire

    surefire Guest

    Messages:
    40
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can't have

    in a page that ends in .html (unless you get fancy with the .htaccess file)

    And since this is in the action of your opening form tag, your server is dutifully indicating that no such page exists. View the source of the file you linked to and you'll see what I mean.
     
    surefire, Sep 13, 2006 IP
  3. drew68

    drew68 Well-Known Member

    Messages:
    582
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    128
    #3
    surefire i see what you mean..i got rid of that but the result is the same but with this error...

    The requested URL /METHOD= was not found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
     
    drew68, Sep 13, 2006 IP
  4. drew68

    drew68 Well-Known Member

    Messages:
    582
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    128
    #4
    can anyone put there 2cents into this?

    really need to get this form up and running.

    i had to create this form in php and i'm not a php guru but i got it to the point now when you click on submit it won't give me a parsing error. but it stays on the same page and does nothing.

    help anyone?
     
    drew68, Sep 14, 2006 IP
  5. falcondriver

    falcondriver Well-Known Member

    Messages:
    963
    Likes Received:
    47
    Best Answers:
    0
    Trophy Points:
    145
    #5
    <form action="method="post">
    Code (markup):
    must be something like
    <form action="sendmail.php" method="post">
    Code (markup):
    , or whatever is the name of your mail script.
     
    falcondriver, Sep 14, 2006 IP
  6. wmtips

    wmtips Well-Known Member

    Messages:
    598
    Likes Received:
    70
    Best Answers:
    1
    Trophy Points:
    150
    #6
    You have
    
    <form action="method="post">
    
    HTML:
    This is wrong, you have empty action and unclosed quotes. You need something like that:
    
    <form action="yourfile.php" method="post">
    
    HTML:
    Try this:
    
    <form action="<?=$_SERVER['PHP_SELF']?>" method="post">
    
    PHP:
     
    wmtips, Sep 14, 2006 IP
  7. drew68

    drew68 Well-Known Member

    Messages:
    582
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    128
    #7
    thanks guys alot for the responses...

    i tried this

    <form action="<?=$_SERVER['PHP_SELF']?>" method="post">

    but it's still not working.

    should i have it as...
    http://www.nodents.com/paintless_dent_repair_courseenrollment.html
    or
    http://www.nodents.com/paintless_dent_repair_courseenrollment.php
    ????


    should it be a php page or an html page?


    with the php page it's not going anywhere when i click submit but with the html page it's giving me this error again...

    The requested URL /< was not found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
     
    drew68, Sep 14, 2006 IP
  8. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
  9. drew68

    drew68 Well-Known Member

    Messages:
    582
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    128
    #9
    it didn't work...so i changed the form entirely to this...

    "From: $_POST";
    $sub1 = 'New comment (nodents.com)';
    $message1 = 'Full Name : ' .$_POST["fullname"] ."\r\n";
    $message1 .= 'Email : ' .$_POST["email"] ."\r\n";
    $message1 .= 'Day Phone : ' .$_POST["dayphone"] ."\r\n";
    $message1 .= 'Mailing Address : ' .$_POST["mailingaddress"] ."\r\n";
    $message1 .= 'Desired Date(s) : ' .$_POST["desireddate"] ."\r\n";
    $message1 .= 'Location(s) : ' .$_POST["location"] ."\r\n";
    $message1 .= '50% deposit provided by : ' .$_POST["50%depositprovidedby"] ."\r\n";
    mail ($admin_email, $sub1, $message1, $headers1);
    header("Location: http://nodents.com/thank_you.html");
    exit;
    }
    ?>


    i called that sendmails.php.

    now i get this error...
    "From: $_POST[Email]"; $sub1 = 'New comment (nodents.com)'; $message1 = 'Full Name : ' .$_POST["fullname"] ."\r\n"; $message1 .= 'Email : ' .$_POST["email"] ."\r\n"; $message1 .= 'Day Phone : ' .$_POST["dayphone"] ."\r\n"; $message1 .= 'Mailing Address : ' .$_POST["mailingaddress"] ."\r\n"; $message1 .= 'Desired Date(s) : ' .$_POST["desireddate"] ."\r\n"; $message1 .= 'Location(s) : ' .$_POST["location"] ."\r\n"; $message1 .= '50% deposit provided by : ' .$_POST["50%depositprovidedby"] ."\r\n"; mail ($admin_email, $sub1, $message1, $headers1); header("Location: http://nodents.com/thank_you.html"); exit; } ?>

    can someone advise?
     
    drew68, Sep 14, 2006 IP
  10. falcondriver

    falcondriver Well-Known Member

    Messages:
    963
    Likes Received:
    47
    Best Answers:
    0
    Trophy Points:
    145
    #10
     
    falcondriver, Sep 15, 2006 IP