PDA

View Full Version : [PHP] Flash vars to PHP to URL..



josuason
December 27th, 2007, 01:50 PM
Not an easy question or maybe its really easy.

I have to URL post form variables to a web address.

Original HTML code [Works]


<form action="http://somewebsite.com/webpush/webpush" action="POST">

Modtager: <input type="text" name="sender">
<br>
Besked: <input type="text" name="personal_message">
<br>
<input type="radio" name="webpush" value="11">SMALL
<br>
<input type="radio" name="webpush" value="12">MEDIUM
<br>
<input type="radio" name="webpush" value="13">X-LARGE
<br>

<input type="radio" name="webpush" value="14">XXX-LARGE
<br>
<input type="hidden" name="message" value="[personal_message] has sent you a message.">
<input type="submit" value="Send" />
</form>

AS code that works inside flash [works]

on (release) {

data_lv = new LoadVars();
data_lv.sender = s_mess.s_film.sender;
data_lv.personal_message = s_mess.s_film.personal_message;
data_lv.webpush = s_mess.s_film.webpush;
data_lv.message = s_mess.s_film.message;
data_lv.onLoad = function (ok)
{
if (ok)
{
trace("Transaction success...");
}
else
{
trace("Error...");
}
}
data_lv.sendAndLoad("http://somewebsite.com/webpush/webpush", data_lv, "POST");

}

AS code to php [Should work]


data_lv.sendAndLoad("post.php", data_lv, "POST");

Here is the big problem I think. I want the php file to send this string.

http://somewebsite.com/webpush/webpush?sender=555123456
&personal_message=Name&webpush=13
&message=%5Bpersonal_message%5D+has+sent+you+a+mess age.

Here is my php code [not working]



<?php
$get_vars = '?';
foreach($_POST as $key=>$val) {
$get_vars .= $key.'='.urlencode($val).'&';
}
$url = 'http://somewebsite.com/webpush/webpush'.$get_vars;
header('location: '.$url);

?>

please help me??????

josuason
December 28th, 2007, 04:55 AM
Problem solved using crossdomain xml file and no PHP