Jump to content

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/82848-solved-conversion-problem-html-to-php/
Share on other sites

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.

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));
?>

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");
     
}

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.