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 10 of 10
  1. #1
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Unhappy PHP contact form stoped working please help!!

    my PHP contact form stopped working on my site.(hosted on Yahoo server) I still able to receive it, but without any data input, or contents.Just like that:
    Hi,
    Following are the details of new request from "Report technical issue" form.
    Name:
    Company:
    Address:
    Email Address:
    Phone Number:
    Type of Issue:
    Comments:
    Thank You,

    Here is the code:
    Hi,<br>
    <p>Following are the details of new request from \"Report technical issue\" form.</p>
    <p><strong>Name</strong>: $yname<br>
    <strong>Company</strong>: $company<br>
    <strong>Address</strong>: $address<br>
    <strong>Email Address</strong>: $emailadd<br>
    <strong>Phone Number</strong>: $phone<br>
    <strong>Type of Issue</strong>: $type<br>
    <strong>Comments</strong>: $questions</p>
    <p><strong>Thank You,<br>
    <a target=\"_blank\" style=\"text-decoration:none;\" href=\"http://www.mysite.com/\">mysite.Com</a></strong><br>
    <a style=\"text-decoration:none;\" href=\"mailto:info@mysite.com\">info@mysite.com</a></p>
    </font>
    ";
    $emailto = "info@mysite.com";

    $tsubject = "Technical issue Found";
    $headers = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    @mail($emailto, $tsubject, $ttext, $headers);

    header("Location: $thankyoupage");
    exit;
    ?>



    Any ideas what could be a problem? I really appreciate it.

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,511
    Thanks
    8
    Thanked 1,090 Times in 1,081 Posts
    Show us the whole script ...
    We can't see the part where your form variables get $_POST-ed in the script.

  • #3
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    also please CODE wrap your script!


    Please wrap PHP codes using the [PHP][/PHP] tag

  • #4
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    this is whole script.

    <?
    $thankyoupage = "http://www.interlot.com/thanks-for-supplier.html";
    $ttext = "
    <font size=\"2\" color=\"#333333\" face=\"Verdana, Arial, Helvetica, sans-serif\">
    Hi,<br>
    <p>Following are the details of new request from \"Report technical issue\" form.</p>
    <p><strong>Name</strong>: $yname<br>
    <strong>Company</strong>: $company<br>
    <strong>Address</strong>: $address<br>
    <strong>Email Address</strong>: $emailadd<br>
    <strong>Phone Number</strong>: $phone<br>
    <strong>Type of Issue</strong>: $type<br>
    <strong>Comments</strong>: $questions</p>
    <p><strong>Thank You,<br>
    <a target=\"_blank\" style=\"text-decoration:none;\" href=\"http://www.interlot.com/\">InterLot.Com</a></strong><br>
    <a style=\"text-decoration:none;\" href=\"mailto:sales@interlot.com\">sales@interlot.com</a></p>
    </font>
    ";
    $emailto = "sales@interlot.com";

    $tsubject = "Technical issue Found";
    $headers = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    @mail($emailto, $tsubject, $ttext, $headers);

    header("Location: $thankyoupage");
    exit;
    ?>

  • #5
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    this isn't the whole script, where are these variables coming from ?? I don't see any form requests.

    also, please WRAP your script as posted above.

  • #6
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    Quote Originally Posted by angst View Post
    this isn't the whole script, where are these variables coming from ??
    Not necessarily. It could have been coded for PHP4, or perhaps PHP5 assuming register_globals.
    Are you a Help Vampire?

  • #7
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    Quote Originally Posted by tomws View Post
    Not necessarily. It could have been coded for PHP4, or perhaps PHP5 assuming register_globals.
    yes, that might be. from what he is describing it sounds like could be the case, if php was upgraded on the server.

  • #8
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Yes, i just found out that PHP has been upgraded and Register Globals are disallowed . i'm not sure how to fix that?

  • #9
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    You didn't provide the form's code, so I'll guess it's sending data by POST. There are a couple of ways to use that data.

    First, you can just use the $_POST array where you need it. For example, assuming your variables are the field names:
    PHP Code:
    $ttext "
    <font size=\"2\" color=\"#333333\" face=\"Verdana, Arial, Helvetica, sans-serif\">
    Hi,<br>
    <p>Following are the details of new request from \"Report technical issue\" form.</p>
    <p><strong>Name</strong>: "
    .$_POST['yname']."<br>
    ...and so on..."

    In some form handling cases, that introduces security problems. Therefore, many get in the habit of "catching" the posted data before doing anything with it. So, near the top of the form handler code, they might have lots of these:
    PHP Code:
    $yform $_POST['yform']; 
    This might be the easier method for you so that you don't actually need to modify the long message body string. Just add one for each variable.

    You should also probably do some reading on PHP5 form handling so that you know when to sanitize the form data.
    Are you a Help Vampire?

  • Users who have thanked tomws for this post:

    batas (01-08-2010)

  • #10
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    it worked. Thanks a Million!!!!!! U're a genius!!!


  •  

    Posting Permissions

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