36 users online (0 members and 36 guests)  


Page 1 of 3 1 2 3 Last
  Results 1 to 15 of 31

Related

  1. Please Help Me - CGI Mail Form    Forum: CGI Perl Forum
    Replies: 1
  2. Help, form mail    Forum: PHP Forum
    Replies: 0
  3. mail form birthdate    Forum: PHP Forum
    Replies: 1
  4. E-mail to a friend Form    Forum: HTML Forum
    Replies: 5
  1. #1
    FrozenGecko's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2005
    Posts
    13

    PHP Form Mail Problem

    Greetings, I am having a problem with my php forum mail. The error i'm getting is that it says that there isa blank box but I filled it all out. Here's the form page.
    PHP Code:
    <form name="contactform" action="formmailhosting.php" method="post">
    Name:<br>
    <
    input type="text" name="name" size="30"><br>
    Age:<br>
    <
    input type="text" name="age" size="30"><br>
    Gender:<br>
    <
    input type="text" name="gender" size="30"><br>
    Email:<br>
    <
    input type="text" name="email" size="30"><br>
    AIMMSNICQ and Yahoo! if you have it:<br>
    <
    input type="text" name="" size="30"><br>
    Do 
    you know FTP:<br>
    <
    input type="text" name="ftp" size="30"><br>
    Link to your site or link to screenshots:<br>
    <
    input type="text" name="site" size="30"><br>
    Username(name.frozen-gecko.net):<br>
    <
    input type="text" name="username" size="30"><br>
    Password:<br>
    <
    input type="text" name="password" size="30"><br>
    Geckos:<br>
    <
    input type="text" name="geckos" size="30"><br>
    Tell me about yourself:<br>
    <
    input type="text" name="about" size="30"><br>
    Any questions:<br>
    <
    input type="text" name="questions" size="30"><br>
    <
    input type="submit" value="Send" name="submitform"
    <
    input type="reset" value="Clear"
    Now the 2nd page
    PHP Code:
    <?php
    // Form processing Script : formmailhosting.php
    // Perform Form Validation Here
    if ($name=="" || $age=="" || $gender=="" || $email=="" || $instamsger=="" || $ftp==""|| $username==""|| $password==""|| $geckos==""|| $tagb2cam=="" || $about=="" || $questions=="")
    {
    echo 
    "Blank submission or you didn't fill in some fields. Go back.";
    }
    else {
    //do email format validation
     
    if(!eregi('^([._a-z0-9-]+[._a-z0-9-]*)@(([a-z0-9-]+\.)*([a-z0-9-]+)(\.[a-z]{2,3})?)$'$email)) {
    echo 
    "That does not look like a valid email address, please re-enter.";
    exit;
    }
    // Ok, now send email
    $youremail="********@yahoo.com";
    $headers "From: \"$name\" <$email>\n";
    $subject="Hosting"
    $message "
    Name: 
    $name
    Age: 
    $age
    Gender: 
    $gender
    Email: 
    $email
    IM, MSN, ICQ and Yahoo! if you have it: 
    $instamsger
    Do you know FTP: 
    $ftp
    Username(name.frozen-gecko.net): 
    $username
    Password: 
    $password
    Geckos??: 
    $geckos
    Tagboard, b2 or deskcam: 
    $tagb2cam
    Tell me about yourself: 
    $about
    Any questions: 
    $questions
    "
    ;
     
    mail("$youremail""$subject"$message$headers); 
    echo 
    "Thanks $name, your email has been sent. I will problay host ya";

    ?>
    Last edited by HTML; 10-07-2005 at 08:07 PM. Reason: removed email

  2. #2
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel

    Re: PHP Form Mail Problem

    It looks like you did not fill the name attribute for the instant mess.

    <input type="text" name="" size="30"><br>
    Do
    you know FTP:<br>
    AHFBWEB Less customers per server, more power for you!

    Business Class Shared Hosting

  3. #3
    ALL's Avatar
    Super Dooper Nerd

    Status
    Offline
    Join Date
    Feb 2005
    Location
    localhost
    Posts
    382

    Re: PHP Form Mail Problem

    if that doesnt help, try doing this insted:

    chane this line:
    PHP Code:
    if ($_FORM['name']=="" || $_FORM['age']=="" || $_FORM['gender']=="" || $_FORM['email']=="" || $_FORM['instamsger']=="" || $_FORM['ftp']==""|| $_FORM['username']==""|| $_FORM['password']==""|| $_FORM['geckos']==""|| $_FORM['tagb2cam']=="" || $_FORM['about']=="" || $_FORM['questions']==""
    i can't remember how to do it, but to use the variables like that you have to turn something on in the php settings. (which they might already be set that way!)

    just a seggestion,
    -ALL

  4. #4
    FrozenGecko's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2005
    Posts
    13

    Re: PHP Form Mail Problem

    After fixing the missing name for insta msger and change the "if" line it still says blank submission.

  5. #5
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel

    Re: PHP Form Mail Problem

    I did not see an input for $tagb2cam==""

    maybe...hopefully?

    AHFBWEB Less customers per server, more power for you!

    Business Class Shared Hosting

  6. #6
    ALL's Avatar
    Super Dooper Nerd

    Status
    Offline
    Join Date
    Feb 2005
    Location
    localhost
    Posts
    382

    Re: PHP Form Mail Problem

    Could you give the complete (up to date) php code?

    I'll run it on my server and play with it till i get it! (sounds like something simple that is being over looked!)

  7. #7
    FrozenGecko's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2005
    Posts
    13

    Re: PHP Form Mail Problem

    Here you go ^^ Thanks for your help so far
    Attached Files Attached Files

  8. #8
    vinyl-junkie's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    721

    Re: PHP Form Mail Problem

    If I may be permitted to jump in here, you need to first fix this statement in formmailhosting.php:

    Code:
    if ($_FORM['name']=="" || $_FORM['age']=="" || $_FORM['gender']=="" || $_FORM['email']=="" || $_FORM['instamsger']=="" || $_FORM['ftp']==""|| $_FORM['username']==""|| $_FORM['password']==""|| $_FORM['geckos']==""|| $_FORM['tagb2cam']=="" || $_FORM['about']=="" || $_FORM['questions']=="")
    {
    echo "Blank submission or you didn't fill in some fields. Go back.";
    }
    Where it says $_FORM, replace all those with $_POST.

    Secondly, in hosting.php, for each place you have one of those form variable(it will read name="something"), make sure you have a name="whatever" that corresponds to the $_POST variable in formmailhosting.php.

    For example, I found this in hosting.php:

    Code:
    <input type="text" name="email" size="30"><br>
    AIM, MSN, ICQ and Yahoo! if you have it:<br>
    <input type="text" name="" size="30"><br>
    Do you know FTP:<br>
    Note the blank name="" field underneath the email form element. I believe that should say name="ftp"

    Get all that sorted out and you should be on your way.

  9. #9
    FrozenGecko's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2005
    Posts
    13

    Re: PHP Form Mail Problem

    Still doesn't work.

  10. #10
    vinyl-junkie's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    721

    Re: PHP Form Mail Problem

    Did you do everything I said to do? Are you still getting the same error as before?

    A farily painless way to identify just which variables your script is barking at is to do something like this just before that if statement I pointed out that needed fixing:

    Code:
    echo "Name = ". $_POST['name'] . "<br>";
    Do that for each of the variables you have defined in your form, then see which ones think they still don't have a definition. Compare your form definition (in hosting.php) to what you have in your $_POST variable (in formmailhosting.php). Make sure they're referenced in both places and that they have the same naming convention in both scripts. You should be able to get past this error if you do this.

  11. #11
    ALL's Avatar
    Super Dooper Nerd

    Status
    Offline
    Join Date
    Feb 2005
    Location
    localhost
    Posts
    382

    Re: PHP Form Mail Problem

    i cant give you a test page because, my host is having problems with PHP, but it should work...

    try these, and somone see if they work!?!?

    PS: i ment $_POST, i dont know why i said $_FORM, i think perl has a similer variable called $FORM that i used once!
    Attached Files Attached Files

  12. #12
    vinyl-junkie's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    721

    Re: PHP Form Mail Problem

    I tried, but the files look like hieroglyphics. Will wait for you to post another set of files before trying again.

  13. #13
    FrozenGecko's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2005
    Posts
    13

    Re: PHP Form Mail Problem

    Still doesn't work... Here are the latest files.
    Attached Files Attached Files

  14. #14
    vinyl-junkie's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    721

    Re: PHP Form Mail Problem

    You Have $_POST['tagb2'] in formmailhosting.php, but you have b2tag in hosting.php. Fix the name in one file or the other but make sure the name is the same in both files.

    You're getting closer.

  15. #15
    ALL's Avatar
    Super Dooper Nerd

    Status
    Offline
    Join Date
    Feb 2005
    Location
    localhost
    Posts
    382

    Re: PHP Form Mail Problem

    don't you just hate it when this kina stuff happens?...

    you know it is something simple, but you just cant get the darn thing to work... i cant even count how many times i have asked for help with my scripting, then it turnes out to be something like a miss named variable!

    i know it is a simple solution... one of the eassiest ways to fix this problem is to do an if statment on each if statment... something like this:

    PHP Code:
    if($_POST['tagb2']){
    echo 
    "1";
    }elseif(
    $_POST['ftp']){
    echo 
    "2";
    }
    //do it all the way down the line of if's when it stopps then cross refrence the number with the name, untill you find which one(s) are causing the problem 
    just one of ALL's quick tips!

    -ALL



Page 1 of 3 1 2 3 Last

Tags for this Thread