josuason Posted December 22, 2007 Share Posted December 22, 2007 I have this html page that works fine. <form action="http://website.com/web/web" action="POST"> Receiver: <input type="text" name="sender"> <br> Message: <input type="text" name="personal_message"> <br> <input type="radio" name="web" value="11">SMALL <br> <input type="hidden" name="message" value="[personal_message] has sent you a message."> <input type="submit" value="Send" /> </form> Problem is that I´ve done the same page in flash and it gathers all the Variables no problems there. When testing the code inside flash or the SWFplayer it works online but inside the html page it dose NOT. What I realy need is help to make that simple HTML page into a PHP page that takes those variables and sends them to a URL like "http://website.com/web/web". The flash part is not a problem but the PHP one is since I usually do not work with PHP. The client wants this Live on the 24th so here I am saturday night at the office.. I´ve been searching all over but I cant find an answer to my problem. Quote Link to comment https://forums.phpfreaks.com/topic/82848-solved-conversion-problem-html-to-php/ Share on other sites More sharing options...
josuason Posted December 22, 2007 Author Share Posted December 22, 2007 I´ve done some email forms in flash with php that lokk like this. <?php $sendTo = "senocular@hotmail.com"; $subject = "My Flash site reply"; $headers = "From: " . $_POST["firstName"] ." ". $_POST["lastname"] . "<" . $_POST["email"] .">\r\n"; $headers .= "Reply-To: " . $_POST["email"] . "\r\n"; $headers .= "Return-path: " . $_POST["email"]; $message = $_POST["message"]; mail($sendTo, $subject, $message, $headers); ?> This is what I want to accomplish but using other variables and another send method. Quote Link to comment https://forums.phpfreaks.com/topic/82848-solved-conversion-problem-html-to-php/#findComment-421342 Share on other sites More sharing options...
Daukan Posted December 22, 2007 Share Posted December 22, 2007 To get form post values into a url <?php $url = ' http://website.com/web/web?personal_message='.$_POST['personal_message'] . '&web='.$_POST['web']. '&message='.$_POST['message']; //to redirect the page to the url header('location: '.url_encode($url)); ?> Quote Link to comment https://forums.phpfreaks.com/topic/82848-solved-conversion-problem-html-to-php/#findComment-421359 Share on other sites More sharing options...
josuason Posted December 22, 2007 Author Share Posted December 22, 2007 To get form post values into a url <?php $url = ' http://website.com/web/web?personal_message='.$_POST['personal_message'] . '&web='.$_POST['web']. '&message='.$_POST['message']; //to redirect the page to the url header('location: '.url_encode($url)); ?> Will this execute in the background? <?php $url = ' http://website.com/web/web?personal_message='.$_POST['personal_message'] . '&web='.$_POST['web']. '&message='.$_POST['personal_message'] 'has sent you a message'; ?> This is the code I will use in flash and the code above is on a page called post.php. on (release) { s_mess.s_film.loadVariables("post.php","POST"); } Quote Link to comment https://forums.phpfreaks.com/topic/82848-solved-conversion-problem-html-to-php/#findComment-421364 Share on other sites More sharing options...
Daukan Posted December 22, 2007 Share Posted December 22, 2007 I tried the code I posted it didn't work to good. This works though. <?php $get_vars = '?'; foreach($_POST as $key=>$val) { $get_vars .= $key.'='.urlencode($val).'&'; } $url = 'http://website.com/web/web/'.$get_vars; header('location: '.$url); ?> If you call the php page it should redirect the page. I'm not positive though I don't use flash to often. You can try it and see what happens. Quote Link to comment https://forums.phpfreaks.com/topic/82848-solved-conversion-problem-html-to-php/#findComment-421367 Share on other sites More sharing options...
josuason Posted December 22, 2007 Author Share Posted December 22, 2007 I think that last code did it.. Its working... Thanks Daukan its midnight in Sweden and I can finally go home.. Quote Link to comment https://forums.phpfreaks.com/topic/82848-solved-conversion-problem-html-to-php/#findComment-421370 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.