Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 8 of 8

Thread: php form...Help

  1. #1
    Junior Member
    Join Date
    Nov 2003
    Location
    Miami
    Posts
    13
    Member #
    3813
    could some tell me what did I do wrong with this form? Everything seems to work fine but the form email is never sent... Here's the link

    http://www.psend.com/users/spyko05/form.php

    and

    http://www.psend.com/users/spyko05/sendeail.php :bandit:
    ------------------------------------------------------
    www.webdesignerforum.org
    ------------------------------------------------------

  2.  

  3. #2
    Senior Member rosland's Avatar
    Join Date
    Jul 2003
    Location
    Norway
    Posts
    1,944
    Member #
    2096
    The sendeail.php code won't be visible to us as it resides on the server. You have to copy/paste it to your forum post if you want it to be reviewed.
    There are some issues with your form. I only skimmed through it as I'm in a hurry.
    Your radiobuttons aren't working. You can select both at the same time. The value you are passing is "radiobutton" and not the choice made by the user.
    Code:
    <input name="logo_yes" type="radio" value="radiobutton" checked>
              Yes 
              <input type="radio" name="logo_no" value="radiobutton">
    
    <!--should be-->
    
    <input name="radiobutton" type="radio"  value="logo_yes"checked><label>Yes</label>
              <input type="radio" name="radiobutton"  value="logo_no" >
              <label>No</label>
    It's also a good habit to name all elements, including your form (though it won't effect its functionality).
    S. Rosland

  4. #3
    Junior Member
    Join Date
    Nov 2003
    Location
    Miami
    Posts
    13
    Member #
    3813
    I attached the second file....take a look at it.
    ------------------------------------------------------
    www.webdesignerforum.org
    ------------------------------------------------------

  5. #4
    Senior Member rosland's Avatar
    Join Date
    Jul 2003
    Location
    Norway
    Posts
    1,944
    Member #
    2096
    I see you've removed the page "formtables.php" from your site. Could you resubmit that code. You don't need to attach it as a separate file, you can just paste it between these tags:

    [code] (paste code here)[/code ]

    I can't see any obvious error in your php code (as long as the mailserver is properly configured, and you're authorized to access it).

    I don't use the "mail()" function myself, but I think the mail function requires three mandatory arguments; "mail($to, $subject, $message)". I don't know what happens when you add a fourth argument. Since your last argument only contains your own email, why not skip it?

    You have however an unnecessary "if clause"
    PHP Code:
    if ($myemail != ""
    mail($myemail$subject$message$from); 
    That variable is predefined at the top of your page, and will always be set.

    What kind of errors do you get? Do you get any error messages, or is it just that the mail doesn't get sent?
    Have you read through this at PHP.net?
    S. Rosland

  6. #5
    Junior Member
    Join Date
    Nov 2003
    Location
    Miami
    Posts
    13
    Member #
    3813
    http://www.psend.com/users/spyko05/form.php

    I dont get any errors, its just that the email is never sent
    ------------------------------------------------------
    www.webdesignerforum.org
    ------------------------------------------------------

  7. #6
    Senior Member splufdaddy's Avatar
    Join Date
    Feb 2003
    Location
    Boston, MA
    Posts
    4,488
    Member #
    735
    Try sending it to a different email address. I had this problem once, and the problem was that the email address that the server sent the email out on, was being marked by the recipient's host as spam. Use the code above to definte the from address.

  8. #7
    Junior Member
    Join Date
    Nov 2003
    Location
    Miami
    Posts
    13
    Member #
    3813
    changed email adress. no mail...I have no idea what is wrong even tho I dont know TOO MUCH about php.
    ------------------------------------------------------
    www.webdesignerforum.org
    ------------------------------------------------------

  9. #8
    Senior Member rosland's Avatar
    Join Date
    Jul 2003
    Location
    Norway
    Posts
    1,944
    Member #
    2096
    I wrote a short send-email-script (a scaled down version of yours) and uploaded it to my server.

    The script works fine, and all my emails came through. I also tested the "mail()" function with a fourth argument to see wether it would list the sender or corrupt the function. That mail came through same as the first ones, but instead of listing the sender it just added the sender information to the message body.

    The value you get (or will get) in the "from" field in your recieved email, will be the value specified in the send_from directive in the php.ini file residing on the server.

    So in short:
    • Your form should work in its present form
    • Your PHP script is properly set up
    • Your server is probably properly configured and you are authorized to access it, otherwise it would most probably have generated some sort of error message.


    One thing came to mind though;
    If your server is configured with "register_globals = OFF", you should try to alter the code in your PHP file such:
    PHP Code:
    /* at the very top of your script, on the line after the php-start-parsing tag
    insert the following:*/

    $visitor=$_POST["visitor"];
    $visitormail=$_POST["visitormail"];
    $id=$_POST["id"];

    /*and so forth, till you have picked up all variable posted by your form.
    The message content ($notes) where does that come from? I can't see it anywhere in your form.*/ 
    See if that works.
    S. Rosland


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 09:56 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com