PowWeb Forums - The Perfect Community for the Perfect Host  

Register now to interact with over 11,000 members! Registered users have Posting Privileges, free access to Private Messaging, Email Notifications and more.

Go Back   PowWeb Community Forums > The PowWeb Platform > PHP
User Name
Password
Register FAQ Members List Search Today's Posts Mark Forums Read

Closed Thread
 
Thread Tools
Old 9-17-05, 05:41 PM   #1
alexm1971
Guest
 
Posts: n/a
Question PHP form stopped working.

Hi All-

This is probably a silly question. My PHP form I use to gather info. on my site just stopped working a few weeks ago. I didn't code the page (I don't really know much about PHP) but have been able to edit categories and content within the file (it worked after making said changes).

Has there been an update to PHP on powweb's server that I need to take into consideration? I've renamed the location of my form to http://www.brazilfiesta.com/rateformLIVE.php if anybody can take a quick look to see if there is anything blatantly wrong with the code. I just want to know if anybody has a quick fix I can implement as the person who coded the page for me is no longer available.

 
Old 9-17-05, 06:07 PM   #2
satis
 
satis's Avatar
 
Join Date: Oct 2002
Location: Dallas
Posts: 2,914
Reputation: 311
you may want to paste the code here. If it's on the page, we can only see the html portion, not the php (which is probably what's broken).

However, powweb did change the way global variables are handled. I'm willing to be this script relied on register_globals to be on, which it no longer is. IF you paste the code, I'm sure we can help you get it working again.
__________________
Satis Clankiller
Clankiller.com Forums
Clankiller.com
PlasmaSky.com
satis is offline  
Old 9-17-05, 06:36 PM   #3
RTH10260
 
Join Date: Jan 2005
Location: Switzerland
Posts: 2,938
Reputation: 126
Quote:
Originally Posted by alexm1971
Has there been an update to PHP on powweb's server that I need to take into consideration?
I bet you have missed the announcement that the php.ini settings for register_globals has changed to the safer OFF as default. For a form script I suggest you rewrite it to be safe, by using $_POST variables to get the form input, in place of the direct names used now. Don't create a private php.ini in your case.

ref: http://forum.powweb.com/showthread.php?t=55379
__________________
Regards - Richard
RTH10260 is offline  
Old 9-17-05, 11:11 PM   #4
alexm1971
Guest
 
Posts: n/a
code

From the top of the file - here is the php part. Let me know if this is the part of the code you mean, since I am pretty dense when it comes to php.

<?php
//If form has been submitted, send email
if($mailed == "yes")
{
$address = "alexm@brazilfiesta.com, al@brazilfiesta.com, ravyn@brazilfiesta.com";
$subject = "*RATE*REQUEST*";
$send_ok = "Thank you for choosing Brazil Fiesta";
$send_ng = "An error occurred. Please call 415-986-1134 or 800-200-0582 for assistance.";
$message = "First Name: " . $f_name . "\nLast Name: " . $l_name . "\nEmail Address: " . $email . "\nPhone Number: " . $phone . "\nContact Preference: " . $contact . "\nTravel Requested: " . $travel . "\nNumber of Passengers: " . $passengers . "\nIntended Flight Itinerary: " . $itinerary . "\nDeparting Date: " . $departing_month . "/" . $departing_day . "/" . $departing_year . "\nReturning Date: " . $returning_month . "/" . $returning_day . "/" . $returning_year . "\nFlexible Dates: " . $flexible . "\nSpecial Instructions: " . $special_instructions . "\nVisa Needed: " . $visa . "\nReferred By: " . $referral ;
if(mail($address, $subject, $message))
{
$status = "ok";
}
else
{
$status = "ng";
}
}
?>
 
Old 9-17-05, 11:54 PM   #5
RTH10260
 
Join Date: Jan 2005
Location: Switzerland
Posts: 2,938
Reputation: 126
Quote:
Originally Posted by alexm1971
From the top of the file - here is the php part. Let me know if this is the part of the code you mean, since I am pretty dense when it comes to php.

<?php
//If form has been submitted, send email
. . .
?>
at the beginning of your script, before above comment line, add this following code snippet: UNTESTED
PHP Code:
$fields = array ('mailed',
                    
'f_name',
                    
'l_name',
                    
'email',
                    
'phone',
                    
'contact',
                    
'travel',
                    
'passengers',
                    
'itinerary',
                    
'departing_month',
                    
'departing_day',
                    
'departing_year',
                    
'returning_month',
                    
'returning_day',
                    
'returning_year',
                    
'flexible',
                    
'special_instructions',
                    
'visa',
                    
'referral'
                    
);
foreach ( 
$fields as $field ) {
    $
$field strip_tags$_POST[$field] );
}; 
__________________
Regards - Richard
RTH10260 is offline  
Old 9-18-05, 04:55 PM   #6
alexm1971
Guest
 
Posts: n/a
Question inserted code

That didn't seem to resolve it. I tried to insert the snippet just before the comment and then tested it inserting right after the comment.

There used to be a small window that would pop up after submitting the form that would say "thank you" and take them back to the original form. However, the problem is now submitting and then not getting the "thank you" window and no Emails being generated.

*Arghh*
 
Old 9-19-05, 10:56 AM   #7
satis
 
satis's Avatar
 
Join Date: Oct 2002
Location: Dallas
Posts: 2,914
Reputation: 311
is the form you're posting from being submitted as a POST? If so, the code that RTH up there posted should have worked. You would have had to have inserted it above the if($mailed==yes) line.
__________________
Satis Clankiller
Clankiller.com Forums
Clankiller.com
PlasmaSky.com
satis is offline  
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:39 PM.


Contents ©PowWeb, Inc. ~ vBulletin, Copyright © 2000-2007 Jelsoft Enterprises Limited.