Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Issues with Contact Forms after upgrade of PHP

Status
Not open for further replies.

jewel464g

Technical User
Jul 18, 2001
198
US
Our sys. admin. recently decided to upgrade our version of PHP to 4.2.3 I don't remember what the previous version was. But currently None of our contact forms are working anymore. I recieve the email but none of the variables show up??

This is my code

<?php

$subject=&quot;Contact Us Form - Crossroads Web Site\r\n&quot;;
$comments=stripslashes(&quot;Square feet of living space: $Square_Feet \r\nBudgeted for your new
home: $Budgeted \r\nStyle preferred: $Style \r\nNumber of Bedrooms: $Bedrooms \r\nNumber of
Bathrooms: $Bathrooms \r\nCurrently have a property: $HaveProperty \r\nProperty located:
$LOACTED \r\nYear you want to build your new home: $Whatyear \r\nName: $Name \r\nAddress:
$Address \r\nCity, State, Zip: $City_State_Zip \r\nPhone: $Phone \r\nEmail Address: $Email
\r\nComments: $comments&quot;);
mail(&quot;jessica@compunet1.com&quot;,$subject, $comments);
Header(&quot;Location: ?>

This is the email.

Square feet of living space:
Budgeted for your new home:
Style preferred:
Number of Bedrooms:
Number of Bathrooms:
Currently have a property:
Property located:
Year you want to build your new home:
Name:
Address:
City, State, Zip:
Phone:
Email Address:
Comments:


It's as if none of the variables are passing from the form anymore.
Check it out if you like. I'm also get a lot of notices about undefined variables that I was getting before.


When faced with a decision, always ask, 'Which would be the most fun?'
 
Change register_globals = Off to register_globals = On in php.ini


Pardon my blonde moment. When faced with a decision, always ask, 'Which would be the most fun?'
 
That is probably the most expedient workaround.

However, you should read this page of the PHP online manual, which describes the dangergs of running PHP with register_globals set to &quot;on&quot;:

I recommend that you not keep register_globals set to off and use the PHP superglobal variables ( First, because of the advice from the above link.

Second, because it can improve code maintainability. If you have to modify your script a year from now, you may not remember how a value got into the variable $foo. But you will know immediately that $_POST['foo'] got its value from a POST-method form input. ______________________________________________________________________
TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top