New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
Web Design and Hosting Creating sites, scripting, and hosting discussions.

PHP help


Post Reply New Thread Subscribe

 
Thread Tools
urble
Guest
 
Posts: n/a

well, i had a friend come to me yesterday and ask me 'why won't this work?' this referring to www.lod4life.net/join.html. what it is supposed to do is send the form to the guys email... after you submit, the php i have doesn't work. i don't know to much php, or well, i don't know any functions and i have it embeded into the next document that follows when you hit submit and this is my script i have so far.
Code:
<?php
$TO = 'midnight_supra@hotmail.com';
$userip;
if (getenv("HTTP_CLIENT_IP")) 
	$userip = getenv("HTTP_CLIENT_IP");
else if(getenv("HTTP_X_FORWARDED_FOR)) 
	$userip = getenv("HTTP_X_FORWARDED_FOR");
else if(getenv("REMOTE_ADDR")) 
	$userip = getenv("REMOTE_ADDR");
else $userip = "UNKNOWN";
return $userip;
$headers  = 'From: Anonymous on $SERVER_NAME <$mail>\n';
            .'X-Mailer: LOD Join Application PHP Mailer\n';
            .'X-host: $userip\n';
$subject = 'LOD Application';
$host = gethostbyaddr($REMOTE_ADDR);
$message = '';
while (list($key, $val) = each($HTTP_POST_VARS)) { 
	$message .= $key.' : '.$val.'\n'; 
} 
$message .= '\nSent by $REMOTE_ADDR\n';
mail($TO, $subject, $message, $headers); 
echo '<p>Application Sent.</p>';
?>
sorry if i am so rediculous off track with that script...any help would be appreciated
QUOTE Thanks
Murlyn

 
Murlyn's Avatar
 
Member Since: Jun 11, 2003
Location: Mount Vernon, WA
Posts: 4,909
Murlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to all
Mac Specs: MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2

Murlyn is offline
Quote:
Originally Posted by urble
Code:
<?php
$TO = 'midnight_supra@hotmail.com';
$userip;
if (getenv("HTTP_CLIENT_IP")) 
	$userip = getenv("HTTP_CLIENT_IP");
else if(getenv("HTTP_X_FORWARDED_FOR)) 
	$userip = getenv("HTTP_X_FORWARDED_FOR");
else if(getenv("REMOTE_ADDR")) 
	$userip = getenv("REMOTE_ADDR");
else $userip = "UNKNOWN";
return $userip;
$headers  = 'From: Anonymous on $SERVER_NAME <$mail>\n';
            .'X-Mailer: LOD Join Application PHP Mailer\n';
            .'X-host: $userip\n';
$subject = 'LOD Application';
$host = gethostbyaddr($REMOTE_ADDR);
$message = '';
while (list($key, $val) = each($HTTP_POST_VARS)) { 
	$message .= $key.' : '.$val.'\n'; 
} 
$message .= '\nSent by $REMOTE_ADDR\n';
mail($TO, $subject, $message, $headers); 
echo '<p>Application Sent.</p>';
?>
Well for one.. you only use return in functions.. so I would just get rid of "return $userip;" and that should do it from the look of it. Plus use \r\n in your header vars, instead of just \n

From the look of it though.. everything else should be fine.

Cheers!
QUOTE Thanks

Post Reply New Thread Subscribe


« Comments on New website.. | Serious Vulnerability »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Setting up PHP and PHP Nuke EvoMac Web Design and Hosting 2 02-18-2005 12:38 PM
Php vtupser Web Design and Hosting 5 02-16-2005 03:36 AM
PHP Help knaggsy Web Design and Hosting 11 10-20-2004 09:53 AM
Is it possible to setup php and databases on pc and mac? knaggsy Web Design and Hosting 7 08-05-2004 06:09 AM
Bogus PHP bug on Mac OS X... mark Web Design and Hosting 19 10-03-2003 07:34 PM

All times are GMT -4. The time now is 06:14 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?