Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 07-12-2004, 12:39 AM   #1
PHPlearner
Registered User
 
Join Date: Jul 2004
Posts: 5
Default mail() register globals off problem :(

Hey all you smart people , i've been looking everywhere for my problem , but haven't found a solution yet , so i hope you can help me out here ....

My host have register globals turned off , so i can't get the mail() function to work

On my host's website , it is stated that i can open a connection to their internal smtp server , but it doesn't say how , and im still in the learning process of php.

Can someone please help me out with getting the mail() to work with or without the smtp connection , i don't really care , as long as it will work .

Thanks in advance
PHPlearner is offline   Reply With Quote
Old 07-12-2004, 05:05 AM   #2
PHPlearner
Registered User
 
Join Date: Jul 2004
Posts: 5
Default

Anyone ?
PHPlearner is offline   Reply With Quote
Old 07-12-2004, 05:26 AM   #3
freddycodes
Master of Nothing
 
Join Date: Dec 2002
Location: San Diego, CA
Posts: 2,468
Default

The only register_globals will affect is how you access incoming data.

Instead of accessing variables in their global state you will need to go through the appropriate input arrays.

So instead of things like $name and $email it would be $_POST['name'] or $_GET['name']
freddycodes is offline   Reply With Quote
Old 07-12-2004, 06:08 AM   #4
PHPlearner
Registered User
 
Join Date: Jul 2004
Posts: 5
Default

Thanks for answering that Freddy , but whats wrong with this script then ?

Code:
<?php

$toEmail = $_POST['[email protected]'];
$subject = $_POST['subject'];
$message = $_POST['message'];

$from = $_POST['email'];

mail($toEmail, $subject, $message, $from);


?>
Im going crazy over this
PHPlearner is offline   Reply With Quote
Old 07-12-2004, 03:43 PM   #5
freddycodes
Master of Nothing
 
Join Date: Dec 2002
Location: San Diego, CA
Posts: 2,468
Default

this line.
Code:
$toEmail = $_POST['[email protected]'];
[email protected] is not a valid property name, what was the variable name. You are only assigning this value in php right, its not coming from flash?

Code:
$toEmail = "[email protected]";

Also
Code:
mail($toEmail, $subject, $message, $from);
the fourth param to the mail call is the header param
It needs to be formatted correctly. A simple email address is not enough, and where does $from get populated from?
freddycodes is offline   Reply With Quote
Old 07-13-2004, 06:40 AM   #6
PHPlearner
Registered User
 
Join Date: Jul 2004
Posts: 5
Default

Hey Freddy , yes im only assigning that value in php and not in Flash .

Can you please define why the " A simple email address is not enough " isn't enough ?

Also if i would like to include the users , ip , browser info , in the mail im recieving , how would i add that to the header ? PHP is confusing
PHPlearner is offline   Reply With Quote
Old 07-13-2004, 12:41 PM   #7
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

What he is saying is that you are not using the mail() function correctly...

Open up the PHP manaul and look for mail() function to see how you can use header stuff... PHP manual is mighty handy and it's got lots of code snippets...
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 07-14-2004, 03:52 PM   #8
PHPlearner
Registered User
 
Join Date: Jul 2004
Posts: 5
Default

Yeah thanks guys , i got it working
PHPlearner is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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. The time now is 02:30 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.