Help me prevent a php related suicide (contact form help)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
wsdavies
Forum Newbie
Posts: 3
Joined: Sun Jul 05, 2009 3:03 pm

Help me prevent a php related suicide (contact form help)

Post by wsdavies »

OK here's the scenario. I'm basically duplicating a site for a cab company in michigan http://www.marquettecab.com they've opened another location and want the same site with a the names modified. So I made the changes..duplicated the site and loaded to the web server. For some reason all my PHP pages are giving off an internal server error. It kind of baffles me because it's the same site hosted exactly the same way on the same server, but doesn't work. http://www.houghtoncab.com Here is the code for the /contact.php page. Any ideas???

Code: Select all

<?php 
if (array_key_exists('ewComments', $_POST)) {
    // mail processing script
    //initialize variables
    $to = 'marquettecab@gmail.com'; //my e-mail address
    $subject = 'Feedback from MCAB Contact Form ';
    
    // build the message
    $message = 'From: '.$_POST['name']."\n\n";
    $message .= 'From: '.$_POST['email']."\n\n";
    $message .= 'Comments: '.$_POST['message'];
    
    //send the mail
    mail($to, $subject, $message);
    header("Location: thanks.htm");
    }
    
    ?>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Contact Houghton Cab</title>
<style type="text/css">
<!--
body {
    background-color: #F5BF17;
}
.style1 {
    color: #000000;
    font-size: xx-large;
    font-weight: bold;
}
.style2 {   font-size: 14px;
    font-family: Arial, Helvetica, sans-serif;
}
-->
</style>
</head>
 
<body>
<div align="center">
  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="878" height="290">
    <param name="movie" value="navmenu.swf" />
    <param name="quality" value="high" />
    <embed src="navmenu.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="878" height="290"></embed>
  </object>
  <br />
</div>
<table width="878" border="0" align="center" cellpadding="1">
  <tr>
    <th bgcolor="#FFFFFF" scope="col"><img src="Images/checkerbanner.jpg" width="547" height="73" /></th>
  </tr>
  <tr>
    <th height="787" bgcolor="#FFFFFF" scope="col"><p><br />
      Your feedback is welcome.<br />
Call us at:<br />
<span class="style1">906-482-2777</span><br />
<em>or send an email below:</em><br />
    <img src="Images/smallfleet.jpg" width="650" height="199" /></p>
 
 
 
<form id="contactForm" name="contactForm" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
      <p>
        <label for="name">Name:</label>
        <br />
        <input type="text" name="name" id="name" />
      </p>
      <p>
        <label for="email">Email:</label>
        <br />
        <input type="text" name="email" id="email" />
      </p>
      <p>
        <label for="message">Message:</label>
        <br />
        <textarea name="message" id="message"></textarea>
      </p>
      <p>
        <input name="ewComments" type="submit" id="ewComments" value="Send comments" />
      </p>
    </form>
      <p>&nbsp;</p>
      <p><img src="Images/crosslink.jpg" width="800" height="150" border="0" usemap="#Map" /></p>
      <div align="center"><br />
          <table width="878" border="0" cellpadding="1">
            <tr>
              <th bordercolor="#D4D0C8" bgcolor="#FFFFFF" scope="col"><span class="style18 style2"><a href="index.htm">HOME</a> | <a href="fares.htm">FARES</a> | <a href="services.htm">SERVICES</a> | <a href="res.htm">RESERVATIONS</a> | <a href="quote.htm">GET QUOTE</a> | <a href="Contact.htm">CONTACT US</a></span> </th>
            </tr>
          </table>
        <map name="MapMap" id="MapMap">
            <area shape="rect" coords="66,23,364,119" href="http://www.upvacation.com" target="_blank" />
            <area shape="rect" coords="450,19,721,117" href="http://www.marquetteliving.com" target="_blank" />
        </map>
      </div>      <p>&nbsp;</p></th>
  </tr>
</table>
 
<div align="center"><br />
    <map name="Map" id="Map">
      <area shape="rect" coords="66,23,364,119" href="http://www.upvacation.com" target="_blank" />
      <area shape="rect" coords="450,19,721,117" href="http://www.marquetteliving.com" target="_blank" />
    </map>
</div>
</body>
</html>
User avatar
paqman
Forum Contributor
Posts: 125
Joined: Sun Nov 14, 2004 7:41 pm
Location: Burnaby, BC, Canada

Re: Help me prevent a php related suicide (contact form help)

Post by paqman »

I'd say contact the host and see if they can help you - the code looks fine and it works in the other account...
wsdavies
Forum Newbie
Posts: 3
Joined: Sun Jul 05, 2009 3:03 pm

Re: Help me prevent a php related suicide (contact form help)

Post by wsdavies »

Exactly...that is what has me scratching my head..this makes no sense. Everything is identical except for some edited photos and a few text changes in the body of each page. How that effects how the server processes the php is beyond me...hmmmm
paqman wrote:I'd say contact the host and see if they can help you - the code looks fine and it works in the other account...
wsdavies
Forum Newbie
Posts: 3
Joined: Sun Jul 05, 2009 3:03 pm

Re: Help me prevent a php related suicide (contact form help)

Post by wsdavies »

Looks like we got it sorted :D

Hello,

The problem was with the file permissions of "quote.php". All files (except cgi files) should have their permissions set to 644, and all directories should have there permissions set to 755. Never set the permissions of any file or directory to 777.

I've run a permission fix on all the files in the account's public_html directory, and http://houghtoncab.com/quote.php appears to be working fine.
Post Reply