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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    406
    Thanks
    0
    Thanked 0 Times in 0 Posts

    page not working properly

    I have a form (contact_us.php) and when a user submits the form it displays a thank you page (thankyou.php) and sends an email to me. The intermediate page which does all the functionality is called contact_action.php. When I opened the contact_us.php and clicked the submit button, instead of showing the thankyou.php the page opens a blank page and the address bar says contact_action.php. Why is this happening? Is it some thing wrong with my code or something to do with the server? Because 2 days ago everything was working fine.

    Can some one tell me is there anything wrong with my code or this is somehting to do with the server?

    Here is the code:
    contact_us.php:
    <?
    $section="contact us";
    $title="contact us";
    $head="";
    $content = <<< CONTENT
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td style="width:375px;border:0px;border-right:10px;border-color:#FFFFFF;border-style:solid;" align="left" valign="top"><img src="assets/imgs/contactus_photo.jpg" width="375" height="432"></td>
    <td style="background-color:#FF0099;" align="center" valign="top">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin:10px;">
    <form action="contact_action.php" method="post">
    <tr><td style="padding-top:20px;padding-bottom:10px;font-size:11px;font-weight:bold;">Please join our mailing list:</td></tr>
    <tr> <td align="center" valign="top">
    <table width="75%" border="0" cellspacing="4" cellpadding="0" align="center">
    <tr><td class="form-field-name-cell" nowrap>Name:</td>
    <td><input type="text" name="name" class="form-field"></td></tr>
    <tr>
    <td class="form-field-name-cell" nowrap>Email:</td><td><input type="text" name="email" class="form-field"></td></tr>
    <tr>
    <td class="form-field-name-cell" nowrap>Company:</td><td><input type="text" name="company" class="form-field"></td></tr>
    <tr>
    <td class="form-field-name-cell" nowrap>Address:</td><td><input type="text" name="address" class="form-field"></td></tr>
    <tr>
    <td class="form-field-name-cell" nowrap>State / Zip</td><td><input type="text" name="zip" class="form-field"></td></tr>
    <tr>
    <td class="form-field-name-cell" nowrap>Phone:</td><td><input type="text" name="phone" class="form-field"></td></tr>
    </table></td></tr>
    <tr><td style="padding-left:2px;vertical-align:top;font-size:11px;">Message/Where did you find our site?</td></tr>
    <tr><td style="padding-top:10px;" valign="top" align="center"><textarea name="message" style="width:260px;height:100px;"></textarea></td></tr>
    <tr><td style="padding-top:20px;padding-left:20px;">
    <input type="image" border="0" name="imageField" src="assets/imgs/send_brown.gif" width="71" height="26">
    <input type="image" onClick="this.form.reset();return false;" border="0" name="imageField2" src="assets/imgs/clear_brown.gif" width="71" height="26">
    </td></tr></form></table>
    </td></tr></table>
    CONTENT;
    ?>

    Here is the contact_action.php:
    <?
    $name = $_REQUEST["name"];
    $email = $_REQUEST["email"];
    $company = $_REQUEST["company"];
    $address = $_REQUEST["address"];
    $zip = $_REQUEST["zip"];
    $phone = $_REQUEST["phone"];
    $message = $_REQUEST["message"];

    $message = <<< STREAM_IN
    Name: $name
    Email: $email
    Company: $company
    Address: $address
    Zip: $zip
    Phone: $phone
    Message: $message
    STREAM_IN;

    $headers = "From: $email\r\n"
    ."Reply-To: $email\r\n"
    ."X-Mailer: PHP/" . phpversion();

    mail("mymail@gmail.com", "Kiki Riki : Contact Us Mail", $message, $headers);
    //mail("@hotmail.com", "Kiki Riki : Contact Us Mail", $message, $headers);

    header("Location: thankyou.php");
    ?>

    Here is the thakyou.php:
    <?

    $section="contact us";
    $title="contact us";
    $head="";

    $content = <<< CONTENT
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td style="width:375px;border:0px;border-right:10px;border-color:#FFFFFF;border-style:solid;" align="left" valign="top"><img src="assets/imgs/contactus_photo.jpg" width="375" height="432"></td>
    <td style="background-color:#FF0099;" align="center" valign="top">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin:10px;">
    <tr>
    <td style="padding-top:20px;padding-bottom:10px;font-size:11px;font-weight:bold;">You will be added to our mailing list shortly.<br/><br/>Thank you.</td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    CONTENT;


    ?>

  • #2
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Check with your host to see if they have done any updating or tweaking of PHP.

    Try putting this at the top of contact_action.php
    PHP Code:
    error_reporting(E_ALL); 
    Why use heredoc? Sorry, I just don't like it

  • #3
    $object->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Jun 2003
    Posts
    3,096
    Thanks
    2
    Thanked 23 Times in 23 Posts
    Look in your server error log. You probably have something there that will tell you what's wrong.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    SNAP to it!


  •  

    Posting Permissions

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