We help IT Professionals succeed at work.

PHP file read with errors

sblanken
sblanken asked
on
Hi,

Recently we decided to move our website in house, to one of our servers (Windows Server 2008 R2 SP1). We installed the latest PHP version (php-5.3.8-nts-Win32-VC9-x86) but still something is going wrong with one of our php files. Please have a look http://www.h5.com/about/contact.php , at the form at the bottom of the page. I am not an PHP expert, but I guess I just miss something.

Thanks,
IT
Comment
Watch Question

My guess is that this version of php is not set up to allow for short tags.
Try changing all the <? to <?php and see if that works instead.

Author

Commented:
When I replace it everywhere it doesn't work, stating that the page has some programming error. However when I replace it to some short table entries it seems to work, but I there still is something. Please have a look here: http://www.h5.com/about/contact.php . Any suggestions? I also noticed that, when "Submit request" is clicked no action is taken.

Thanks,
IT
That's because when you view the source this line  <? if ($send != "yes") {
      <form method="post" action="contact.php">
<form method="post" action="contact.php">
is italicized like the browser does not recognize it as valid html so when you click that button it does not know what to do.  
Fix the <? from the if($send) statement to <?php and that should solve it.
CERTIFIED EXPERT

Commented:
Or just set in your system php.ini

short_open_tag = On

Author

Commented:
I cannot see the italicised line you are mentioning. Maybe because I am viewing it with just Emeditor? Sorry, first time with php.
@xterm: no improvement with that.

Thanks,
IT
This is the view source from firefo, sorry copy/paste strips out the formatting.
From the end of line 124 to 125 is showing up as italicized in the view source for me.
The end of that if statement is supposed to be on 195 as far as I can tell.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en"><!-- InstanceBegin template="/Templates/section.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
	<script src="../SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="../SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<!-- InstanceBeginEditable name="doctitle" -->
	<title>H5: Contact Us</title>
	<!-- InstanceEndEditable -->

	<link rel="stylesheet" type="text/css" href="../inc/styles.css" media="all" />
	<script type="text/javascript" src="../inc/scripts.js"></script>
    <!-- InstanceBeginEditable name="head" -->
    <style type="text/css">
<!--
.style2 {color: #333}
-->
    </style>
    <!-- InstanceEndEditable -->
	<!-- InstanceParam name="section" type="text" value="about" -->
	<!-- InstanceParam name="subsection" type="text" value="contact" -->
	<!-- InstanceParam name="logo" type="text" value="" -->

    <link href="../inc/print.css" rel="stylesheet" type="text/css" media="print" />
</head>

<body id="about">
<a name="top"></a>
<div id="wrapper">
  <div id="tnav">
    <ul><li><a href="contact.php">Contact Us</a></li>
      <li><a href="../sitemap.html">Site Map</a></li></ul>
  </div>

  <div id="logo">
    
    <a href="../index.html"><img src="../img/logo.gif" width="133" height="83" alt="H5 logo" /></a>   
    </div>
  <div id="sprynav">
<ul id="MenuBar1" class="MenuBarHorizontal">
  <li><a class="MenuBarItemSubmenu" href="index.html" id="nvabout">About Us</a>
      <ul>
        <li><a href="who_we_are.html">Who We Are</a></li>
        <li><a href="clients.html">Our Clients</a></li>

        <li><a href="our_name.html">Our Name</a></li>
        <li><a href="contact.php">Contact Us</a></li>
      </ul>
  </li>
  <li><a href="../solutions/index.html" class="MenuBarItemSubmenu" id="nvsol">Solutions</a>
    <ul>

      <li><a href="../solutions/litigation_and_investigations.html">Litigation and Investigations</a></li>

      <li><a href="../solutions/information_governance.html">Information Governance</a></li>	  
      <li><a href="../solutions/h5edgeclassifier.html">H5 EDGE™ Classifier</a></li>	  
      <li><a href="../solutions/technology.html">Our Technology</a></li>
      <li><a href="../solutions/clientsuccesses.html">Client Successes</a></li>
    </ul>
    </li>
  <li><a class="MenuBarItemSubmenu" href="../resources/index.html" id="nvres">Resources</a>

      <ul>
        <li><a href="../resources/whitepapers.html">White Papers</a></li>
        <li><a href="../advisorvideo/index.html">Conversations with H5's Advisory Board</a></li>
        <li><a href="../resources/industryresources.html">Industry Resources</a></li>
      </ul>
  </li>
  <li><a href="../news/index.html" class="MenuBarItemSubmenu" id="nvnews">News &amp; Events</a>

      <ul>
        <li><a href="../news/inthenews.html">In the News</a></li>
        <li><a href="../news/presskit.html">For the Media</a></li>
        <li><a href="../news/press_releases.html">Press Releases</a></li>
        <li><a href="../news/events.html">Events</a></li>
      </ul>
  </li>

  <li><a href="../careers/index.html" class="MenuBarItemSubmenu" id="nvcar">Careers</a>
    <ul>
      <li><a href="../careers/culture.html">Our Culture</a></li>
      <li><a href="../careers/openings.html">Openings</a></li>
    </ul>
  </li>
</ul>
</div>

  
  <div id="contentwrapper"> 
    <div id="content"><!-- InstanceBeginEditable name="content" --> <img src="../img/t-contact.gif" width="559" height="27" alt="Contact Us" id="pagetitle" /> 
        <h2>H5 San Francisco</h2>
        <p>H5<br />
        71 Stevenson Street<br />
        San Francisco, CA 94105</p>
        <p><a href="directions.html">Driving Directions</a><br />

          <br />
          <strong>Phone:</strong> 415.625.6700<br />
          <strong>Fax:</strong> 415.625.6799<br />
        </p>
      <h2>H5 New York</h2>

        <p>H5<br />
        340 Madison Avenue<br />
        Suite 12B<br />
        New York, NY 10173</p>
        <p><a href="http://maps.google.com/maps?hl=en&amp;q=340+madison+avenue+new+york+ny&amp;um=1&amp;ie=UTF-8&amp;split=0&amp;gl=us&amp;ei=hbN4Ss2qBcyolAfdo72ZBQ&amp;sa=X&amp;oi=geocode_result&amp;ct=title&amp;resnum=1" target="_blank">Map</a></p>
        <p><strong>Phone:</strong> 212.818.1600<br />

          <strong>Fax:</strong> 212.818.1604<br />
        </p>
      <h2>Email Contacts</h2>
      <p class="style2">For all inquiries or requests regarding H5's information management and document review solutions, please <a href="mailto:services@h5.com">click here</a> to email H5's Global Practice Management Group or fill out the request form below. You may contact individual practice directors directly from our <a href="practicedirectors.html">practice director profiles page</a>.</p>

      <p>General Information Requests: <a href="mailto:info@h5.com">info@h5.com</a><br />
        Media and Analyst Inquiries: <a href="mailto:ssong@h5.com">ssong@h5.com</a><br />
		Webmaster: <a href="mailto:webmaster@h5.com">webmaster@h5.com</a></p>
      <h2>Career Information</h2>
      <p>For information about career opportunities at H5, visit our <a href="../careers/openings.html">career openings section</a>.</p>

      <h2>Request Form</h2>
      <p>Please enter your information, comments or questions in the fields below, then send the form by clicking the <strong>Submit Request</strong> button at the bottom of the page. </p><p class="required">* = Required</p>	 <?
if ($send != "yes") {
	<form method="post" action="contact.php">
        <table>
          <tr> 
            <td colspan="2" class="required">* Request Type (Choose one): 
              <select name="category">

                <option value="General Inquiry">General Inquiry</option>
                <option value="Schedule Informational Presentation">Schedule Informational 
                Presentation</option>
                <option value="Schedule Cost Analysis">Schedule Cost Analysis</option>
                <option value="Media / Analyst Inquiry">Media / Analyst Inquiry</option>
                <option value="Request Company Literature">Request Company Literature</option>
            </select> </td>

          </tr>
          <tr> 
            <td class="required">* Name:</td>
            <td><input name="name" type="text" value=""/></td>
          </tr>
          <tr> 
            <td class="required">* Title:</td>
            <td><input name="title" type="text" value=""/></td>
          </tr>

          <tr> 
            <td class="required">* Company:</td>
            <td><input name="company" type="text" value=""/></td>
          </tr>
          <tr> 
            <td class="required">* Email Address:</td>
            <td><input name="email" type="text" value=""/></td>
          </tr>
          <tr> 
            <td>Phone Number:</td>

            <td><input name="phone" type="text" value=""/></td>
          </tr>
          <tr> 
            <td>Address 1:</td>
            <td><input name="address" type="text" value=""/></td>
          </tr>
          <tr> 
            <td>Address 2:</td>
            <td><input name="address2" type="text" value=""/></td>

          </tr>
          <tr> 
            <td>City:</td>
            <td class="content"><input name="city" type="text" value=""/> 
              &nbsp;&nbsp;&nbsp;&nbsp;State: 
              <input name="state" type="text" value="" size="3" /> 
              &nbsp;Zip: 
              <input name="zip" type="text" value="" size="10" />            
          	</td>
          </tr>
          <tr> 
          <td colspan="2">Questions or Comments:<br /><textarea cols="40" rows="6" name="comments"></textarea></td>

          </tr>
          <tr> 
            <td></td>
            <td><br /> <input type="hidden" name="ds" value="send" /> <input type="submit" value="Submit Request"/></td>
          </tr>
        </table>
      </form>
      <p style="font-size: 80%">H5 will not share your information with anyone 
        without your permission.<br />

        For more information, see our <a href="../privacy.html">Privacy Policy</a>.</p>
        }?> <--this is the end of that if statement from 124/125
	  
      <!-- InstanceEndEditable --></div>
    <div id="related"><!-- InstanceBeginEditable name="related" --> <!-- InstanceEndEditable --></div>
    <div id="snav">  
      <ul>
        <li><a href="who_we_are.html">Who We Are</a> 
        <li><a href="clients.html">Our Clients</a></li>

        <li><a href="our_name.html">Our Name</a></li>
        <li><a href="contact.php">Contact Us</a></li>
         
          <ul>
            <li><a href="directions.html">Directions</a></li>
            </ul>
          
      </ul>
           </div>

  </div>
  <!-- #BeginLibraryItem "../Library/footer.lbi" --><div id="footer">
  <ul><li><a href="../sitemap.html">Site Map</a></li>
    <li><a href="contact.php">Contact Us</a></li>
    <li><a href="../privacy.html">Privacy Policy</a></li>
    <li><a href="../terms.html">Terms of Use</a></li></ul>
<p>&copy; 2000-2010 H5. All rights reserved.</p>

</div><!-- #EndLibraryItem --></div>

<script type="text/javascript" language="javascript">i=12189</script> 
<script type="text/javascript" language="javascript" src="http://t3.trackalyzer.com/trackalyze.js"></script>

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-3480066-1");
pageTracker._initData();
pageTracker._trackPageview();
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
</script>

</body>
<!-- InstanceEnd --></html>

Open in new window

CERTIFIED EXPERT

Commented:
You need to restart the web server after you make the change to php.ini - did you do that?

Author

Commented:
I installed firefox and was able to see what you see, but no clue why is that happening (only in firefox).
I have IIS7.5 on this server, and installed the prementioned php version. Is there any other configuration that I should do on this server?
Thanks!

Author

Commented:
I managed to fix the previous issue, but I have another one now. In the php file I use mail() function to send an email bt it fails with this error:

Final-Recipient: rfc822;info@h5.com
Action: failed
Status: 5.3.5

any ideas?

Thanks!
CERTIFIED EXPERT
Commented:
This is a fully unrelated problem, and probably now needs to be moved into the category of SMTP/mail, but the message bounced with code 5.3.5

RFC1893 says that

5 = permanent failure
3.5 = system incorrectly configured or "The system is not configured in a manner which will permit it to accept this message."

So the remote mail system rejected the message.  Try changing the target address in the mail to one of your personal hotmail/gmail/yahoo addresses and see if the mail goes through.  It's possible that h5.com has some strong filters in place.

Author

Commented:
Thank you all for your kind help!!

IT

Author

Commented:
The issue is at relaying between the two servers. As xterm suggested, it works with personal emails.

Thank you very much for your help guys!
IT