Page Crashes in IE

Can anyone tell me why this page keeps crashing in IE? http://www.math2life.com/contact_us.php

I’ll put up the source code and CSS if anyone wants.

FYI: after including itself about 5000 times, the script also throws the following error:

<b>Fatal error</b>: Allowed memory size of 67108864 bytes exhausted (tried to allocate 417 bytes) in <b>/home/mathlif1/public_html/contact_us.php</b> on line <b>100</b><br />

Are contact_us.php and banner.php stored in the same folder?

Try including banner.php like this:


include_once 'banner.php';

It’s in that section that it’s going wrong, check the output of that page:


<!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=utf-8" />
<title>Math 2 Life</title>
<link rel="stylesheet" type="text/css" href="style.css" />

</head>
<body>
<div id="wrapper">

  <!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=utf-8" />
<title>Math 2 Life</title>
<link rel="stylesheet" type="text/css" href="style.css" />

</head>
<body>
<div id="wrapper">

  <!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=utf-8" />
<title>Math 2 Life</title>
<link rel="stylesheet" type="text/css" href="style.css" />

</head>
<body>
<div id="wrapper">

  <!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=utf-8" />
<title>Math 2 Life</title>
<link rel="stylesheet" type="text/css" href="style.css" />

</head>
<body>
<div id="wrapper">
<!-- etc etc * 100 -->

Here’s banner.php
banner.php

<div id="banner">
    <a href="index.php"><img src="pictures/images/banner_logo_small.jpg" /></a>
    <a href="index.php"><img src="pictures/images/button_home.jpg" /></a>
    <a href="gallery.php"><img src="pictures/images/button_gallery.jpg" /></a>
    <a href="preview.php"><img src="pictures/images/button_preview.jpg" /></a>
    <a href="members.php"><img src="pictures/images/button_members_only.jpg" /></a>
    <a href="blog"><img src="pictures/images/button_blog.jpg" /></a>
    <a href="order.php"><img src="pictures/images/button_order.jpg" /></a>
    <a href="contact_us.html"><img src="pictures/images/button_contact_us.jpg" /></a>
 </div><br /><br /><br /><br /><br />

That’s crazy! I didn’t know it was causing that much of a problem. What’s going on exactly? Anyways I fixed up the problem by changing all references to banner.php from include ‘banner.php’; to include_once ‘banner.php’;

Thanks for the tip - I’ll be doing that from now on

I think I have the most updated version of IE now…

Thanks for helping me fix this…err…bypass it rather :stuck_out_tongue:
At least it won’t crash the browser now.

To be honest, I have absolutely no idea what was going on. It was certainly very strange behaviour. :S

Changing to include_once fixed the problem, it seems, but it’s just treating symptoms. The underlying problem is probably still there. If you want to really analyse and solve the problem, try downloading the site to a local development environment (such as XAMPP) to see if you can recreate the problem.

You have check code or try IE 7 that is latest and less error prone.

If you remove (albeit temporarily) this bit:


<?php include 'banner.php'; ?>

What happens then?

contact_us.php

<!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=utf-8" />
<title>Math 2 Life</title>
<link rel="stylesheet" type="text/css" href="style.css" />

</head>
<body>
<div id="wrapper">
  <?php include 'banner.php'; ?>
<div id="form">
	  <form id="mail" action="sendeail.php" method="post">
    	<br />
   	   	<p class="big_text">Contact Form
    	<br />
    						
 		<TABLE width=auto class="table">
 		
        <?php
$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>

<input type="hidden" name="ip" value="<?php echo $ip ?>" />
<input type="hidden" name="httpref" value="<?php echo $httpref ?>" />
<input type="hidden" name="httpagent" value="<?php echo $httpagent ?>" />
        
        <tr>
    	<td><p class="table_text">
    	    <label for="name">Full name</label><br />			
  	   
        <input type="text" name="visitor" id="name" size="32" class="text_area" /></p></td>
        <td><p class="table_text">
  	    <label for="web">Organization name</label>
   	    <br />
  	    
        <input type="text" name="org_name" id="org_name" size="32" class="text_area" /></td>
   	    </tr>
        <tr>
    	<td><p class="table_text"><label for="email">E-mail</label><br />			
   		
        <input type="text" name="visitormail" id="email" size="32" class="text_area" /></p>        </td>
        <td><p class="table_text">
   		<label for="web">Position/title</label><br />
  	   
        <input type="text" name="position_title" id="position_title" size="32" />
        </td>
        </tr>
    
        <tr>
    	<td><p class="table_text">Phone<br />
  
  	    <input type="text" name="web" id="web" size="32" /></p>   		</td>
        <td><p class="table_text">Contact reason<br />
            <select name="dropdown2" id="dropdown2">
              <option value="BLANK"> </option>
              <option value="New_login">Request username</option>
              <option value="Billing">Billing</option>
              <option value="Shipping">Shipping</option>
              <option value="Sales">Sales inquiry</option>
              <option value="Product Issue">Product issue</option>
              <option value="Teaching/Training">Teaching/training</option>
              <option value="Member">Membership/login</option>
              <option value="Website">Website/technical</option>
              <option value="Feedback">Comments/feedback</option>
              <option value="Other">Other</option>
            </select>
        </td>
        </tr>
    
        <tr>
    	<td><p class="table_text">Contact method<br />&nbsp;
        
        	<select name="dropdown4">
              <option value="BLANK"> </option>
              <option value="Phone">Phone</option>
              <option value="E-Mail">E-Mail</option>
              </option>
            </select>
        </td>
        <td><p class="table_text">How did you hear about us?<br />
            <select name="dropdown3">
              <option value="BLANK"> </option>
              <option value="Referral">Referral</option>
              <option value="Search engine">Search engine</option>
              <option value="Forum">Internet forum</option>
              <option value="Trade show">Trade show/conference</option>
              <option value="Media">Media/publication</option>
            </select></br>
            
            </td>
            </tr>
    
            <tr>
    	    <td><p class="table_text">Best time to call<br />
  			  <select name="dropdown1">
  			  <option value="BLANK"> </option>
 		      <option value="AM">Morning (8AM - Noon CST)</option>
  			  <option value="PM">Afternoon (1PM - 5PM CST)</option>
  			  <option value="Evening">Evening (5PM - 9PM CST)</option>
  			  </select>
   		    </td>
            <td><p class="table_text">
            <label for="web">Please be specific</label><br />
   
   			<input type="text" name="specific" id="specific" size="32" />
            </td>
            </tr>
    
        </TABLE>
 
 <TABLE width="450px" class="table">
 <tr>
    <td>
    <br /><p class="table_text"><label for="message">Message</label><br />
   
   <textarea name="notes" id="message" cols="60" rows="5" wrap = "physical" ></textarea></p>
   <p class="submit"><button type="submit">Send</button></p>
    </td>
    </tr>
 </TABLE>
 </form>



  </div>
  
  <img src="pictures/images/slideshow/slideshow.gif" width="252" height="167" class="slideshow" /><br />
  <img src="pictures/images/slideshow/slideshow_2.gif" class="slideshow" /><br />
  <img src="pictures/images/slideshow/slideshow_3.gif" class="slideshow" />
</div>
</body>
</html>

sendeail.php
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>

<html>
<head>
<meta http-equiv=“Content-Type” content=“text/html; charset=utf-8” />
<title>Sendemail Script</title>
<link rel=“stylesheet” type=“text/css” href=“style.css” />
</head>
<body>

<!-- Reminder: Add the link for the ‘next page’ (at the bottom) –>
<!-- Reminder: Change ‘YourEmail’ to Your real email –>

<?php

$ip = $_POST[‘ip’];
$httpref = $_POST[‘httpref’];
$httpagent = $_POST[‘httpagent’];
$visitor = $_POST[‘visitor’];
$visitormail = $_POST[‘visitormail’];
$notes = $_POST[‘notes’];
$attn = $_POST[‘attn’];
$dropdown1 = $_POST[‘dropdown1’];
$dropdown2 = $_POST[‘dropdown2’];
$dropdown3 = $_POST[‘dropdown3’];
$dropdown4 = $_POST[‘dropdown4’];
$web = $_POST[‘web’];
$org_name = $_POST[‘org_name’];
$position_title = $_POST[‘position_title’];
$specific = $_POST[‘specific’];
if (eregi(‘http:’, $notes)) {
die (“Do NOT try that! ! “);
}
if(!$visitormail == “” && (!strstr($visitormail,”@”) || !strstr($visitormail,“.”)))
{
echo "<h2>You have entered an invalid e-mail address. Please press your browser’s back button and check again.</h2>
";
$badinput = "<h2>Feedback was NOT submitted.</h2>
";
echo $badinput;
die ("Go back! ! ");
}

if(empty($visitor) || empty($visitormail) || empty($notes )) {
echo "<h2>Use Back - fill in all fields</h2>
";
die ("Use back! ! ");
}

$todayis = date(“l, F j, Y, g:i a”) ;

$attn = $attn ;
$subject = $attn;

$notes = stripcslashes($notes);

$message = " $todayis [EST] \

Attention: $attn \

Message: $notes \

Phone Number: $web \

From: $visitor ($visitormail)\

Call or E-mail: $dropdown4 \

Organization Name: $org_name \

Position Title: $position_title \

Best Time to Call: $dropdown1 \

Contact Reason: $dropdown2 \

Referral: $dropdown3 \

Specific Details: $specific \

Additional Info : IP = $ip \

Browser Info: $httpagent \

Referral : $httpref \

";

$from = "From: $visitormail\r
";

mail(“info@math2life.com”, $subject, $message, $from);

?>

<div id=“wrapper”>
<div id=“banner”>
<img src=“pictures/images/banner_logo_small_dummy.jpg” />
<a href=“index.html”><img src=“pictures/images/button_home.jpg” /></a>
<a href=“gallery.html”><img src=“pictures/images/button_gallery.jpg” /></a>
<a href=“preview.html”><img src=“pictures/images/button_preview.jpg” /></a>
<a href=“members.html”><img src=“pictures/images/button_members_only.jpg” /></a>
<a href=“blog”><img src=“pictures/images/button_blog.jpg” /></a>
<a href=“order.html”><img src=“pictures/images/button_order.jpg” /></a>
<a href=“contact_us.php”><img src=“pictures/images/button_contact_us.jpg” /></a>
</div>
<br class=“clearboth” />

<img src=“pictures/images/logo_message_sent.jpg” class=“message_sent” />
<br />
<br />
<p align=“center”>
Date: <?php echo $todayis ?>
<br />
Thanks for your feedback. Your support of Math2Life is appreciated.

<br />
<br />
This is
an email to confirm that we have received your request and will respond<br />
to it as soon as we can. We look forward to handling your request soon. Thank
you in advance for your patience.<br /><br />

Best regards, <br /><br />

The Math2Life team
<br /><br /><br />

Attention: <?php echo $attn ?>
<br />
Your Phone Number: <?php echo $web ?>
<br />
Call or E-mail: <?php echo $dropdown4 ?>
<br />
Organization Name: <?php echo $org_name ?>
<br />
Position Title: <?php echo $position_title ?>
<br />
Best Time to Call: <?php echo $dropdown1 ?>
<br />
Contact Reason: <?php echo $dropdown2 ?>
<br />
How You Heard About Us: <?php echo $dropdown3 ?>
<br />
<?php echo $specific ?>
<br />
Message:<br />
<?php $notesout = str_replace(“\r”, “<br/>”, $notes);
echo $notesout; ?>
<br />
Your IP address:<br />
<?php echo $ip ?>

<br /><br />
<a href=“http://www.math2life.com”> Return Home </a></p>

</div>
</body>
</html>

Okay I changed it to .html and it seems to work fine. I hope the email goes through when people fill out the form. I just thought that since the form posts to a file called sendeail.php then the form page itself should be a php as well?

It’s still not loading for me. Can you post the source code?

EDIT: Loads now.

Try changing it back to html. Is the page generated by php or is it a normal static html page?

EDIT: Check your php error log, any errors reported regarding that page?

I’ll give that a shot in the next ten seconds…we’ll see what happens. I hope it works because it’s a form that emails someone when it is filled out.

I’ll give that a shot. Didn’t know how to check the output so I’ll see what happens.
Thanks! I’ll get back to you and let you know what’s going on.

What’s in banner.php?

It seems to be continually including itself, leading to a 2MB file which crashes every browser on my computer.

It’s going wrong here:


<div id="wrapper">
  <?php include 'banner.php'; ?>


Yeah all I remember doing is changing the page from .html to .php

It won’t load for me in either IE8 or Chrome. Have you made any changes to that page recently? Did the un-responsiveness start around then?

Oh that’s just for the navigation menu. I saved it in a file called banner.php. Just to consolidate my code so it’s easier to manage.