473,407 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

PHP4 to PHP5 ?

I have a couple accounts through godaddy.com and they can't tech support it because it's a custom script. But on one account (i'm assuming its running php4) the script works fine, on the other account (running php5) it doesn't work hardly at all. What happens, is the information is emailed successfully, however, the information that the browser inputed does not POST to the server and the email contains the fields, but the answers are completely blank.

I also notice that no matter what I put for the email, it always errors out and says it's invalid (another suspicion). I modified the php.ini file to be the exact same as that of the other account (just switching one thing that was "off" to "on") and the global.inc.php file is the exact same as well.

Please help if you can! Thanks!!!!

Here is the script from the process.php page:


Expand|Select|Wrap|Line Numbers
  1.   <?php
  2. include("global.inc.php");
  3. $errors=0;
  4. $error="The following errors occured while processing your form input.<ul>";
  5. pt_register('POST','name');
  6. pt_register('POST','phone');
  7. pt_register('POST','phoneeve');
  8. pt_register('POST','time');
  9. pt_register('POST','city');
  10. pt_register('POST','state');
  11. pt_register('POST','Email');
  12. pt_register('POST','info');
  13.  
  14. if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$Email)){
  15. $error.="<li>Invalid email address entered<p><a href=javascript:history.back()>Go Back</a>";
  16. $errors=1;
  17. }
  18. if($errors==1) echo $error;
  19. else{
  20.  
  21. $where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
  22. $message="Name: ".$name."
  23. Day Phone: ".$phone."
  24. Evening Phone: ".$phoneeve."
  25. Convient time to call is: ".$time."
  26. City:  ".$city."
  27. State:  ".$state."
  28. Email:  ".$email."
  29. More Info: ".$Info."
  30. ";
  31. $message = stripslashes($message);
  32. mail("myemailaddress@yahoo.com","Free Life Stratgey Submittal",$message,"Free Life Stratgey Submittal");
  33. ?>
Apr 17 '08 #1
3 2319
Markus
6,050 Expert 4TB
I have a couple accounts through godaddy.com and they can't tech support it because it's a custom script. But on one account (i'm assuming its running php4) the script works fine, on the other account (running php5) it doesn't work hardly at all. What happens, is the information is emailed successfully, however, the information that the browser inputed does not POST to the server and the email contains the fields, but the answers are completely blank.

I also notice that no matter what I put for the email, it always errors out and says it's invalid (another suspicion). I modified the php.ini file to be the exact same as that of the other account (just switching one thing that was "off" to "on") and the global.inc.php file is the exact same as well.

Please help if you can! Thanks!!!!

Here is the script from the process.php page:


Expand|Select|Wrap|Line Numbers
  1.   <?php
  2. include("global.inc.php");
  3. $errors=0;
  4. $error="The following errors occured while processing your form input.<ul>";
  5. pt_register('POST','name');
  6. pt_register('POST','phone');
  7. pt_register('POST','phoneeve');
  8. pt_register('POST','time');
  9. pt_register('POST','city');
  10. pt_register('POST','state');
  11. pt_register('POST','Email');
  12. pt_register('POST','info');
  13.  
  14. if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$Email)){
  15. $error.="<li>Invalid email address entered<p><a href=javascript:history.back()>Go Back</a>";
  16. $errors=1;
  17. }
  18. if($errors==1) echo $error;
  19. else{
  20.  
  21. $where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
  22. $message="Name: ".$name."
  23. Day Phone: ".$phone."
  24. Evening Phone: ".$phoneeve."
  25. Convient time to call is: ".$time."
  26. City:  ".$city."
  27. State:  ".$state."
  28. Email:  ".$email."
  29. More Info: ".$Info."
  30. ";
  31. $message = stripslashes($message);
  32. mail("myemailaddress@yahoo.com","Free Life Stratgey Submittal",$message,"Free Life Stratgey Submittal");
  33. ?>
Have you tried changing those pt_register fields to POST?
[php]
pt_register('POST', 'info');
#becomes
$info = $_POST['info'];
[/php]
Apr 17 '08 #2
That was the right way to POSt but the rest of the script was incorrect. I ended up finding a script online to get the job done. thank you though!
Apr 23 '08 #3
Markus
6,050 Expert 4TB
That was the right way to POSt but the rest of the script was incorrect. I ended up finding a script online to get the job done. thank you though!
Ok mate!

Catch ya later
Apr 23 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Tim Tyler | last post by:
I'm sure this is a FAQ - but I could not find a coherent statement of the answer: Some of my clients want PHP4. Other ones want PHP5. Can I run both PHP4 and PHP5 under the same instance of...
0
by: Dave Pham | last post by:
I just cleaned my comp, and I am trying to re-config my webserver... I am trying to setup apache 2 so it runs both php4 and php5, I also have two instances of mysql running. I know this can be...
1
by: dk_sz | last post by:
Is it just me... Or is PHP5 XML very limited? Or am I missing something very obvious? Any way to use PHP4 Dom XML in PHP5? Does anyone know why support for it was dropped? I have following...
4
by: Kevin | last post by:
Hi all, I've got a PHP4 app that I developed which I'm trying to get to run on a PHP5 server. Everything works great, except for one thing. There's a particular routine that creates an...
5
by: sinister | last post by:
I'm starting a database/web interface project, using Linux and postgresql. I've programmed in PHP4 in the past, and for this new project am unsure whether to use PHP4 or PHP5. My main concerns...
2
by: Stefan Huber | last post by:
Hi I've got a really strange problem, and can't find out why it's not working as intended. in order to use php4 and 5 together on a webserver and the requirement for running as different...
12
by: Drazen Gemic | last post by:
How long will PHP4 be supported ? When is PHP4 end of life scheduled ? DG
3
by: xhe | last post by:
I have just upgraded my php version form php4 to php5. and I met this problem, and don't know if you know the solution. My site was written in PHP4, and most parts can be running smoothly in PHP5,...
8
by: FFMG | last post by:
Hi, I am slowly moving my code to php5. But I would like to make it backward compatible in case something bad happens, (and to make sure I understand what the changes are). The way the...
3
by: jmark | last post by:
I am currently running php 4.4.7 in windows xp and apache 2. If I enter php in command line. I get the following error The application has failed to start because php5ts.dll was not found" I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.