PowWeb Forums - The Perfect Community for the Perfect Host  

Register now to interact with over 11,000 members! Registered users have Posting Privileges, free access to Private Messaging, Email Notifications and more.

Go Back   PowWeb Community Forums > Web Site Design > Graphic Design/Multimedia/Flash/Shockwave
User Name
Password
Register FAQ Members List Search Today's Posts Mark Forums Read

Closed Thread
 
Thread Tools
Old 1-8-06, 08:18 AM   #1
markoman
Guest
 
Posts: n/a
PHP in SWF problem!

The trubles begun 2 or 3 months ago

the script (mailform in php) works fine

<?

$mymail = "myemail@mail.com";
mail("$mymail", "",
"
Email: $email
");

?>

in the flash i use loadVariables("mailform.php", "", "POST");

but the problem is that the script send mail without typed e-mail in .swf file.
In swf file i use input text and var: for input text email.

whats the problem here, it used to work fine... the same thing works well on other Webservers (not powweb)

do i need install something on my webpage or whats the issue, please help!
 
Old 1-9-06, 05:14 AM   #2
oatesj77
Shiznizal
 
oatesj77's Avatar
 
Join Date: Oct 2003
Location: Portland, OR
Posts: 672
Reputation: 33
you didn't post a lot of information, so not quite sure where your problem might be. check that your variables are still okay in your flash file, then republish and upload in "binary mode" not ascii. sometimes there are problems with swf's uploaded in ascii rather than binary mode. also check the path to your php page to be sure it has not changed. if that's not the problem, post your actionscript and the code you use in your php page and i'll see if i can figure out what the problem is.

here is the code i use in my php page;
PHP Code:
<?php
$sendTo 
"xyz@site.com";
$subject "Message from Site.com";

$headers "From: " $_POST["name"];
$headers .= "<" $_POST["email"] . ">\r\n";
$headers .= "Reply-To: " $_POST["email"] . "\r\n";
$headers .= "Return-Path: " $_POST["email"];
$message $_POST["message"];

mail($sendTo$subject$message$headers);
?>
the above depends on what variables you are sending from your swf, and it works on my site, so there isn't anything you need to upload or change with your account.
__________________
Jackson
stylepoints.net - web/graphic/design/
oatesj77 is offline  
Old 1-17-06, 05:36 PM   #3
clock109
 
Join Date: Apr 2004
Location: Cali
Posts: 41
Reputation: 5
With out hijacking this thread too much, I wanted to thank Jackson for posting his code. That has got me the closest I've ever been to getting my flash contact form working.

If you don't mind could you show me how to add fields to the script. I have 5 inputs on my form. Name, email, phone, subject, and message. The Name and email show up in the headers and the message shows up in the message body with your script. Although I can't seem to ge the other information to show up.

Thanks Again
Craig

Sorry Markoman for using your thread....
clock109 is offline  
Old 1-17-06, 06:06 PM   #4
oatesj77
Shiznizal
 
oatesj77's Avatar
 
Join Date: Oct 2003
Location: Portland, OR
Posts: 672
Reputation: 33
you have your text input for phone number set to phone right? then you just need to collect that variable in your php page;
add this
PHP Code:
change the message line to this;
$message $_POST["message"]."</br>Phone number:".$_POST["phone"]; 
this should add line break at the end of your message body then attache the copy "phone number:" followed by whatever number was put into the form.

try that out post back if it doesn't work
__________________
Jackson
stylepoints.net - web/graphic/design/
oatesj77 is offline  
Old 1-17-06, 09:44 PM   #5
clock109
 
Join Date: Apr 2004
Location: Cali
Posts: 41
Reputation: 5
Thanks again Jackson, That got me the information in the message body, but it all showed up on one line. Here's what it lookes like in the message body. I got a little brave and decided to try and add all the form information.

Name: Craig Lockett</br>Email Address:myemail@your.net</br>Phone number:123-4567</br>Subject:test this</br>Message:testing once more
clock109 is offline  
Old 1-19-06, 12:52 AM   #6
oatesj77
Shiznizal
 
oatesj77's Avatar
 
Join Date: Oct 2003
Location: Portland, OR
Posts: 672
Reputation: 33
that should have been <br/> or just <br>, my bad. that should give you the line returns if your email accepts html coding.
__________________
Jackson
stylepoints.net - web/graphic/design/
oatesj77 is offline  
Old 1-19-06, 04:20 PM   #7
clock109
 
Join Date: Apr 2004
Location: Cali
Posts: 41
Reputation: 5
Thanks Jackson, but that didn't work for me either. I did get it working though my combining parts of another script with yours. I don't really understand php so I'm not sure why it worked. I just got lucky . Here's the final working script in case your interested in checking it out.

Thanks again for all your help. I couldn't have done it without you.....

PHP Code:
<?php 
$sendTo 
"myemail@your.net"
$subject $_POST ["subject"]; 
$name $_POST["name"];
$email $_POST["email"];
$phone $_POST["phone"];
$subject $_POST["subject"];
$message $_POST["message"];

$headers "From: " $_POST["name"]; 
$headers .= "<" $_POST["email"] . ">\r\n"
$headers .= "Reply-To: " $_POST["email"] . "\r\n"
$headers .= "Return-Path: " $_POST["email"]; 
$message "Name:"."$name\n\n"."Email Address:"."$email\n\n"."Phone number:"."$phone\n\n"."Subject:"."$subject\n\n"."Message:\n"."$message";  
   
mail($sendTo$subject$message$headers); 
?>
clock109 is offline  
Old 1-19-06, 08:14 PM   #8
oatesj77
Shiznizal
 
oatesj77's Avatar
 
Join Date: Oct 2003
Location: Portland, OR
Posts: 672
Reputation: 33
yeah, that'll work, you are just combining your variables into one ($message) and then using the mail functio like previously.
__________________
Jackson
stylepoints.net - web/graphic/design/
oatesj77 is offline  
Closed Thread

Thread Tools

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 On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:37 PM.


Contents ©PowWeb, Inc. ~ vBulletin, Copyright © 2000-2007 Jelsoft Enterprises Limited.