|
-
Great info in this thread! However, it's not helping my situation:
I just changed hosts, found my PHP mail forms no longer worked, came here and saw this thread. My new server is running PHP 4.3.3, so I assumed that was the problem. The weird thing is, register_globals is turned "on" on my server, and my scripts still won't receive my variables from Flash. I've tried several of the suggestions here, and it still doesn't work. The script sends me an email like it's supposed to, and prints a "success" message back to the Flash movie, but the email doesn't contain my variables!
I just tried using the script via an html form, and it does work, so it's just from Flash. I'm using the absolute URL too, but that doesn't seem to help.
Being a total PHP n00b, I'm a little stumped 
Anyone have any ideas?
Last edited by NocturnalGuy; 12-19-2003 at 11:13 PM.
-
Follow-up: I realized that everything works fine in IE; I had been trying it in Opera. Weird. Now to figure that one out...
-
HI People have gravitated here because i too am on php 4.2.3 and the register_globals is indeed off and I dont have that 'H$$P'-whatever code on my script and as many of you have suffered I can see, I too am not getting any variables from my flash to the php and thus to my Database. I am presuming this means I wont be able to fish anything out of the Database via the php file using flash either.
The flash just dont wanna talk to my php file!!!
My php file works great without it!! so......
Now i am a simple person.
All I want is one method to get the vars out of flash and be seen by the php and visa-versa-vista-vusta etcc..
I am using flash 5 so be kind.
hope that someone can explain to me how I can get my vars to be picked up by the php file.
thanks
Shaf
-
imagination through stupidity
Originally posted by shafak cangil
HI People have gravitated here because i too am on php 4.2.3 and the register_globals is indeed off and I dont have that 'H$$P'-whatever code on my script and as many of you have suffered I can see, I too am not getting any variables from my flash to the php and thus to my Database. I am presuming this means I wont be able to fish anything out of the Database via the php file using flash either.
The flash just dont wanna talk to my php file!!!
My php file works great without it!! so......
Now i am a simple person.
All I want is one method to get the vars out of flash and be seen by the php and visa-versa-vista-vusta etcc..
I am using flash 5 so be kind.
hope that someone can explain to me how I can get my vars to be picked up by the php file.
thanks
Shaf
do
getURL("www.mydomain.com/phppage.php?id=var1&id2=var2&blah=var3");
the string has to be constructed first, but that is the basic idea.
Then from php you can do HTTP_GET_VARS[var1] or whatever/
Nothing to see here, move along.
-
Grrrrr
Sorry if this has already been covered but theres alot of posts to go through.
ok so actionscript 2 flash CS3
Code:
var senderLoad:LoadVars = new LoadVars();
var recieveLoad:LoadVars = new LoadVars();
Sender.onRelease = function() {
senderLoad.theName = theName.text;
senderLoad.theGladiatusName = theGladiatusName.text;
senderLoad.theEmail = theEmail.text;
senderLoad.theSubject = theSubject.text;
senderLoad.theMessage = theMessage.text;
senderLoad.sendAndLoad("http://ultimate-signatures.com/form.php", recieveLoad);
}
recieveLoad.onLoad = function(){
if(this.sentOK) {
_root.gotoAndStop(300);
}
else{
_root.gotoAndStop(305);
}
}
Returns - Error opening URL 'http://ultimate-signatures.com/form.php'
the url is correct i have also tried putting within a subfolder and targeting that too.
PHP
Code:
<?PHP
$to = "[email protected]";
$subject = "The Legion Contact Forum";
$message = "Name: " . $theName;
$message .= "\nGladiatusName: " . $theGladiatusName;
$message .= "\nEmail: " . $theEmail;
$message .= "\n\nSubject: " . $theSubject;
$message .= "\nMessage: " . $theMessage;
$headers = "From: $theEmail";
$headers .= "\nReply-To: $theEmail";
sentOK = mail($to,$subject,$message,$headers);
echo "sentOK=" . $sentOK;
?>
Please can somebody help me ;
Thanks in advance.
Andy
-
HI, If i send to flash vars this way, i have no problem seeing them in a dynamic text box :
PHP Code:
$myTotal=45;
echo "&myTotal=$myTotal&";
But actually i get the $myTotal value from a POST:
PHP Code:
PHP Code:
$myTotal=$_POST['total'];
echo "&myTotal=$myTotal&";
And this way i get no value in my dynamic text box
Any ideas?
I´ve already search the forum ,with no clues.
-
Perverse Futurist
 Originally Posted by BADGROOVY
HI, If i send to flash vars this way, i have no problem seeing them in a dynamic text box :
PHP Code:
$myTotal=45;
echo "&myTotal=$myTotal&";
But actually i get the $myTotal value from a POST:
PHP Code:
PHP Code:
$myTotal=$_POST['total'];
echo "&myTotal=$myTotal&";
And this way i get no value in my dynamic text box
Any ideas?
I´ve already search the forum ,with no clues.
Shouldn't you be getting your variable from $_REQUEST['total']?
Did you check the php file on it's own to see if it output $myTotal as the value in the name/value pair string?
-
 Originally Posted by villain2
Shouldn't you be getting your variable from $_REQUEST['total']?
Yes, i use $_REQUEST.
 Originally Posted by villain2
Did you check the php file on it's own to see if it output $myTotal as the value in the name/value pair string?
Yes, its echo´s fine.
But it doesnt appear in Flash.
But actually Musicman gave me a nice tip that works , i already have the values in my php, and with flash i was trying to call them again to the server, so instead of that i use FLASH VARS.
THKS ANYWAY.
-
Sybersnake: many thanks but I have in fact tried that too and it doesnt work.
I did contact my hosting site to ask why i had an existing php/flash emailing system working fine on the site and suspected that the register_globals were on and not off like it was on my machine. I had developed the emailing php/flash thing a while ago ona nother machine and as this is a new machine i had to install apache and php etc anew and had my suspicions....
Guess what. I was right.
"register_globals are On , many scripts including oscommerce require them to be on, there are many features in php that are more secure set to off, but we have to compromise for usability
"
so, I am happy.
i can set my register_globals to on also on my machine and check out if the thing works now, which I highly suspect
-will.
Please note other developers and fustrated hair yanking gurus, check with your hosting site first to see if they have their settings as mentioned, set to on and then set your own the same.
Mind you its only by using all help given here and (falling on your face a thousand times!) does anyone finally get the right answer. having said that. i hope this is. LOL!
"..and thats the way the cookie crumbles.."
cheers!
Shaf
-
imagination through stupidity
Originally posted by shafak cangil
Sybersnake: many thanks but I have in fact tried that too and it doesnt work.
I did contact my hosting site to ask why i had an existing php/flash emailing system working fine on the site and suspected that the register_globals were on and not off like it was on my machine. I had developed the emailing php/flash thing a while ago ona nother machine and as this is a new machine i had to install apache and php etc anew and had my suspicions....
Guess what. I was right.
"register_globals are On , many scripts including oscommerce require them to be on, there are many features in php that are more secure set to off, but we have to compromise for usability
"
so, I am happy.
i can set my register_globals to on also on my machine and check out if the thing works now, which I highly suspect
-will.
Please note other developers and fustrated hair yanking gurus, check with your hosting site first to see if they have their settings as mentioned, set to on and then set your own the same.
Mind you its only by using all help given here and (falling on your face a thousand times!) does anyone finally get the right answer. having said that. i hope this is. LOL!
"..and thats the way the cookie crumbles.."
cheers!
Shaf
It could be many things, it does work tho. I do such things often.
Try posting your AS and PHP Code
Nothing to see here, move along.
-
I have managed to get the flash/php combo working now on my hosting site. It takes up variables and plops them into the database just fine.
I am now having trouble getting the php file to return variables to the flash thou.
If I use:
Sreturnmessage = "1";
-it doesnt work.
if I use:
print"_root.returnmessage = 1";
-it doesnt work,
if I use:
print "test = 1";
any clues as to what it SHOULD be in order for the flash to see it?
also i have an if statement like:
if(returnmessage ==1)
{
gotoAndPlay(2); //there is an affirmative message there.
}
else
{
gotoAndPLay(3);//there is a no message there.
}
This is because the flash is all in one frame and I didn't know if I needed to loop it in order for 'returnmessage' to be seen again by flash or not.
thanks:
Shaf
(but going really well otherwise)
-
yet another non-working php.
http://www.humanwine.com
if you go to the muzik section and then click on of the song titles at the bottom to get the lyrics the page dims and just sits.
iam am almost certain that my php is valid.
-
miscellaneum :
Your page works fine for me on IE PC 6.0. The lysics show up as I click on the individual song titles.
-
PHP Version 4.3.8
Yup this is the place to post this. My Flash to PHP to MySQL was working great with our old hosting company but now we need to move it. UGH
So I started reading this chat and I made my phpinfo file and found out that its running php4.3.8. Yes my variables are not making it into the table. So can someone please recap what to do. Here is my PHP code (the one that used to work)
<?
include ('include.inc');
mysql_connect($DBhost,$DBuser,$DBpass);
@mysql_select_db("$DBName") or $results="mysql_error()";
print "&results=" .$results;
$fname=mysql_escape_string($fname);
$lname=mysql_escape_string($lname);
$email=mysql_escape_string($email);
$address=mysql_escape_string($address);
$city=mysql_escape_string($city);
$state=mysql_escape_string($state);
$zip=mysql_escape_string($zip);
$age=mysql_escape_string($age);
$query = "INSERT INTO freemusic (fname, lname, email, address, city, state, zip, age) VALUES ('$fname','$lname','$email','$address','$city','$s tate','$zip','$age')";
$result = mysql_query($query) or $results="mysql_error()";
echo $results;
print "&results=" .$results;
$results= "entered";
echo $results;
print "&results=" .$results;
print "&loading=NO";
print "&status=DONE.";
?>
So that and where do I add this extra security code stuff that I need?
Mark Gooodman
www.markcgoodman.com
-
Hi,
I usually put something like this near the top of the file (or if there are multiple sections using different variables, near the top of each section)
PHP Code:
$vars = array("fname","lname","email",address",..."age");
foreach($vars as $var)
if(isset($_POST[$var]))
$$var = $_POST[$var];
BTW: once working, please try with a name like O'Connor - it is well possible that your new server has magic_quotes on and the mysql_escape_string do escape the ' a second time
Musicman
-
WORKED LIKE A CHARM
I don't know how many times you helped me out MusicMan or even FlashKit. What a resource. I don't really understand that php code but it worked. I did try O'conner and that seemed to work fine.
THANKS A MILLION
Mark Gooodman
www.markcgoodman.com
-
Help! I have hooked up all of this new .php, it sends mail and everything, BUT it fills out some information incorrectly in the email. Message says "message" Email says "message" Fax number says "message" Help, its weird. Here is the .php
<?
// Enter your contact email address here
$adminaddress = "[email protected]";
// Enter the address of your website here include http://www.
$siteaddress ="http://www.company.com/";
// Enter your company name or site name here
$sitename = "Site Name";
/************************************************** *****
No need to change anything below ...
************************************************** *****/
foreach($HTTP_GET_VARS as $name => $value) { $$name = $value;}
foreach($HTTP_POST_VARS as $name => $value) { $$name = $value;}
foreach($HTTP_GET_VARS as $title => $value) { $$title = $value;}
foreach($HTTP_POST_VARS as $title => $value) { $$title = $value;}
foreach($HTTP_GET_VARS as $company => $value) { $$company = $value;}
foreach($HTTP_POST_VARS as $company => $value) { $$company = $value;}
foreach($HTTP_GET_VARS as $address => $value) { $$address = $value;}
foreach($HTTP_POST_VARS as $address => $value) { $$address = $value;}
foreach($HTTP_GET_VARS as $city => $value) { $$city = $value;}
foreach($HTTP_POST_VARS as $city => $value) { $$city = $value;}
foreach($HTTP_GET_VARS as $state => $value) { $$state = $value;}
foreach($HTTP_POST_VARS as $state => $value) { $$state = $value;}
foreach($HTTP_GET_VARS as $zip => $value) { $$zip = $value;}
foreach($HTTP_POST_VARS as $zip => $value) { $$zip = $value;}
foreach($HTTP_GET_VARS as $country => $value) { $$country = $value;}
foreach($HTTP_POST_VARS as $country => $value) { $$country = $value;}
foreach($HTTP_GET_VARS as $telno1 => $value) { $$telno1 = $value;}
foreach($HTTP_POST_VARS as $telno1 => $value) { $$telno1 = $value;}
foreach($HTTP_GET_VARS as $telno => $value) { $$telno = $value;}
foreach($HTTP_POST_VARS as $telno => $value) { $$telno = $value;}
foreach($HTTP_GET_VARS as $faxno1 => $value) { $$faxno1 = $value;}
foreach($HTTP_POST_VARS as $faxno1 => $value) { $$faxno1 = $value;}
foreach($HTTP_GET_VARS as $faxno => $value) { $$faxno = $value;}
foreach($HTTP_POST_VARS as $faxno => $value) { $$faxno = $value;}
foreach($HTTP_GET_VARS as $message => $value) { $$message = $value;}
foreach($HTTP_POST_VARS as $message => $value) { $$message = $value;}
foreach($HTTP_GET_VARS as $email => $value) { $$email = $value;}
foreach($HTTP_POST_VARS as $email => $value) { $$email = $value;}
// 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);
//Process the form data!
// and send the information collected in the Flash form to Your nominated email address
if ($action != ""):
mail("$adminaddress","Message from $company",
"A visitor to $sitename has left the following information\n
Name: $name
Title: $title
Company: $company
Address: $address
$city
$state
$zip
Country: $country
Phone: ($telno1) $telno
Fax: ($faxno1) $faxno\n
Email: $email\n
Message:
$message
Logged Info :
------------------------------
Using: $HTTP_USER_AGENT
Hostname: $ip
IP address: $REMOTE_ADDR
Date/Time: $date","FROM:$adminaddress");
//This sends a confirmation to your visitor
mail("$email","Thank You for the message to $sitename",
"Hello $name,\n
------------------------------
This is an automated message from $sitename, we will respond
to your message as quickly as possible.\n
$sitename
$siteaddress","FROM:$adminaddress");
//Confirmation is sent back to the Flash form that the process is complete
$sendresult = "Thank you for your message.";
$send_answer = "answer=";
$send_answer .= rawurlencode($sendresult);
echo "$send_answer";
endif;
?>
Now here is the email it sends to me :
Name: cixe
Title: ms
Company: spinaroonie
Address: po box
town
ca
90210
Country: usa
Phone: (555) 555-5555
Fax: (555) message
Email: message
Message:
message
Logged Info :
------------------------------
Using:
Hostname: no ip
IP address:
Date/Time: 10/20/2004 11:12:29
I also noticed the no ip thing... It does that sometimes, but not others. Can someone tell me what I'm doing wrong?
Thank you all so much, this post is a huge help!
-
imagination through stupidity
Last edited by Sybersnake; 10-20-2004 at 12:14 PM.
Nothing to see here, move along.
-
imagination through stupidity
try this
Code:
<?
// Enter your contact email address here
$adminaddress = "[email protected]";
// Enter the address of your website here include http://www.
$siteaddress ="http://www.company.com/";
// Enter your company name or site name here
$sitename = "Site Name";
/ **************************************************
*****
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);
//Process the form data!
// and send the information collected in the Flash form to Your nominated email address
if ($action != ""):
mail("$adminaddress","Message from $company",
"A visitor to $sitename has left the following information\n
Name: $HTTP_POST_VARS["name"]
Title: $HTTP_POST_VARS["title"]
Company: $HTTP_POST_VARS["company"]
Address: $HTTP_POST_VARS["address"]
$HTTP_POST_VARS["city"], $HTTP_POST_VARS["state"] $HTTP_POST_VARS["zip"]
Country: $HTTP_POST_VARS["country"]
Phone: ($HTTP_POST_VARS["telno1"]) $HTTP_POST_VARS["telno"]
Fax: ($HTTP_POST_VARS["faxno1"]) $HTTP_POST_VARS["faxno"] \n
Email: $HTTP_POST_VARS["email"] \n
Message:
$HTTP_POST_VARS["message"]
Logged Info :
------------------------------
Using: $HTTP_USER_AGENT
Hostname: $ip
IP address: $REMOTE_ADDR
Date/Time: $date","FROM:$adminaddress");
//This sends a confirmation to your visitor
mail("$email","Thank You for the message to $sitename",
"Hello $name,\n
------------------------------
This is an automated message from $sitename, we will respond
to your message as quickly as possible.\n
$sitename
$siteaddress","FROM:$adminaddress");
//Confirmation is sent back to the Flash form that the process is complete
$sendresult = "Thank you for your message.";
$send_answer = "answer=";
$send_answer .= rawurlencode($sendresult);
echo "$send_answer";
endif;
?>
Make sure your flash form is using the POST Method.
Nothing to see here, move along.
-
Hate to say this, but the .php you gave me didn't work, due to that whole new PHP 4.1 thing that we are all here posting about. The only way I can get the code to work with the PHP 4.1 is that weird looking code I posted where everything is doubled over. And yes my Flash form does call for POST, its like every other flashform here at the flashkit.com
Thank you for your help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|