Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 04-13-2012, 11:09 PM   #1
bumpn
Registered User
 
Join Date: Apr 2012
Posts: 5
Default cant get form to work

im creating a website made of flash i cant get the form to work i have var and name on the boxes and the following action on the submit button on release geturl to link to the processing form ie name box has the var name assigned to it now releasing the button sends the mail but none of the info is there it looks like this always empty.
is there anyway to get the processing script completely in action script? or to get my form working?
Name:
Phone Number:
Email Address:
[message]
messages:
---
End of message




here is the php

<?php

if (!isset($_POST['submit'])) {
echo "<h1>Error</h1>\n
<p>Accessing this page directly is not allowed.</p>";
exit;
}

$email = preg_replace("([\r\n])", "", $email);

$find = "/(content-type|bcc:|cc/i";
if (preg_match($find, $name) || preg_match($find, $email) || preg_match($find, $url) || preg_match($find, $comments)) {
echo "<h1>Error</h1>\n
<p>No meta/header injections, please.</p>";
exit;
}


/* form will be sent to these email addresses */
$myemail = "[email protected]";


/* headers*//*this syntax makes it show up inbox not spam*/
$subject = "subject here";
$headers = 'From:[email protected]' . "\r\n" .
'Cc:[email protected]' . "\r\n" .
'Bcc:[email protected]' . "\r\n" .
'Reply-To:[email protected]' . "\r\n" .
'X-Mailer: PHP/' . phpversion();

/* syntax// $php item = $action ['$value on form'];*/
/* defines whats included in mail message */
$name = $_POST ['name'];
$phone = $_POST ['phone'];
$email = $_POST ['email'];

$comments = $_POST ['comments'];


/* message how I want it to appear inbox*/
/* defines what form items are*/
$message = "
Name: $name
Phone Number: $phone
Email Address: $email
[message]
message: $comments
---
End of message
";


/* Send the message using mail() function */
mail($myemail,$subject,$message,$headers);


/* Redirect visitor to the thank you page */
header('Location: url');
exit();


?>

Last edited by bumpn; 04-13-2012 at 11:14 PM.
bumpn is offline   Reply With Quote
Old 04-13-2012, 11:26 PM   #2
bumpn
Registered User
 
Join Date: Apr 2012
Posts: 5
Default

the max character option on the var was set to 0. my work is at work cant test it could this be it?
bumpn is offline   Reply With Quote
Old 04-14-2012, 11:01 AM   #3
Prid
Prid - Outing
 
Prid's Avatar
 
Join Date: Oct 2009
Location: Halden, Norway
Posts: 1,191
Send a message via MSN to Prid Send a message via Skype™ to Prid
Default

Everything seems OK, so it must be something wrong in your Flash file, as it's probably not sending the variables to the PHP file, and if I read correctly, you said that you used getURL to navigate to the PHP page? If so, then that's completely wrong, as that won't send any variables. Instead of getURL, try this code:

ActionScript Code:
loadVariables("yourphpfile.php", this, "POST");

See if that works. Max Chars set to 0 means that there's no limit to how many characters you can type, so that's not wrong, and no, you can't send a mail using completely Flash!
__________________
I have returned, and am now 18
Prid 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 07:00 AM.

///
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.