PLS HELP: Script to mail

This is a discussion on PLS HELP: Script to mail within the alt.comp.lang.php forums, part of the PHP Programming Forums category; I have a flash site (http://www.myscreenenclosure.com/) that sends email using a php script. The contact page worked ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-08-2006
VB Programmer
 
Posts: n/a
Default PLS HELP: Script to mail

I have a flash site (http://www.myscreenenclosure.com/) that sends email
using a php script.

The contact page worked great until my webhost moved me to another server.
Anyone know why this mail script now fails? Here it is...

Sorry, but I'm not a php guru like you all.... Thanks....

<?

$adminaddress = "feedback@mysite.com";
$siteaddress ="http://www.MyScreenEnclosure.com";
$sitename = "Atlantic Aluminum And Screen";

//No need to change anything below ...
// Gets the date and time from your server
$date = date("m/d/Y H:i:s");

// Gets the IP Address
if ($REMOTE_ADDR == "") $ip = "no ip";
else $ip = getHostByAddr($REMOTE_ADDR);

// ORIGINAL
// else $ip = getHostByAddr($REMOTE_ADDR);

// Gets the POST Headers - the Flash variables
$action = $HTTP_POST_VARS['action'] ;
$name = $HTTP_POST_VARS['name'] ;
$email = $HTTP_POST_VARS['email'] ;
$phone = $HTTP_POST_VARS['phone'] ;
$comments = $HTTP_POST_VARS['comments'] ;

//Process the form data!
// and send the information collected in the Flash form to Your nominated
email address

if ($action == "send") {
//
mail ("$adminaddress","Info Request",
"A visitor at $sitename has left the following information\n
Name: $name
Email: $email
Phone: $phone
The visitor commented:
------------------------------
$comments
------------------------------
Date/Time: $date","FROM:$adminaddress" ) ;

//This sends a confirmation to your visitor
mail ("$email","Thank You for visiting $sitename",
"Hi $name,\n
Thank you for your interest in $sitename!\n
We will get back with you shortly.\n
Thank you,
$sitename
$siteaddress","FROM:$adminaddress") ;

//Confirmation is sent back to the Flash form that the process is complete
$sendresult = "Thank you. You will receive a confirmation email shortly.";
$send_answer = "answer=";
$send_answer .= rawurlencode($sendresult);
echo $send_answer;
} //

?>


Reply With Quote
  #2 (permalink)  
Old 02-09-2006
samudasu
 
Posts: n/a
Default Re: PLS HELP: Script to mail

It's most likely because the new server is setup with the
register_globals setting off. This means that instead of using
$REMOTE_ADDR you'll now use $_SERVER['REMOTE_ADDR']
register_long_arrays is probably set to off also so
$HTTP_POST_VARS['action'] should be changed to $_POST['action']

Reply With Quote
  #3 (permalink)  
Old 02-09-2006
samudasu
 
Posts: n/a
Default Re: PLS HELP: Script to mail

http://de.php.net/manual/en/language...predefined.php

Reply With Quote
  #4 (permalink)  
Old 02-09-2006
VB Programmer
 
Posts: n/a
Default Re: PLS HELP: Script to mail

Thanks! I showed my webhoster this and they fixed it! Thanks again!

"samudasu" <samudasu@hotmail.com> wrote in message
news:1139454965.201929.88720@g43g2000cwa.googlegro ups.com...
> http://de.php.net/manual/en/language...predefined.php
>



Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:12 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0