Jump to content

Flash & PHP


StealthRider

Recommended Posts

Hello everyone,

  I new here and my first post I'm in need of some help with a flash form that allows you to attach any file to and email and send.

 

The Flash form is located at: http://spec-works.com/flashlastproject/advanced/mail_php/blue-blue.swf

 

I'm looking for a PHP code that will allow me to attach any file and send it through the flash for.

 

I'm new to PHP and I don't know anything about it.

 

Thanks in advance.

 

Stealthrider

 

Thanks

 

 

Link to comment
https://forums.phpfreaks.com/topic/154750-flash-php/
Share on other sites

That flash form appears to submit data to a php page called email.php. If you have the flash form why do you not have the php file also?

 

EDIT: the php page is giving an error:

<br />

<b>Parse error</b>:  syntax error, unexpected '=', expecting ',' or ';' in <b>/homepages/26/d95323311/htdocs/flashlastproject/advanced/mail_php/email.php</b> on line <b>27</b><br />

 

If this is your page, post details so we can see where you are at at the moment and offer advice.

Link to comment
https://forums.phpfreaks.com/topic/154750-flash-php/#findComment-813795
Share on other sites

so you want it sent as an attachment or just uploaded to the server ? how about just sending a link to the attached file ? :-P You may also want to look into a class named phpMailer (http://sourceforge.net/project/showfiles.php?group_id=26031)...very handy for adding attachments and sending out mail... :-)

 

if you just want to upload the file...then flash can take care of the uploading for you, hope your familiar with actionscript....

look into the FileReference Class, then you can use php to move the file..

 

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/FileReference.html  <--adobe labs manual...

 

http://markshu.ca/imm/flash/tutorial/fileReference.html <--nice tutorial on using flash & php to handle move.... :-)

 

cheers!

Link to comment
https://forums.phpfreaks.com/topic/154750-flash-php/#findComment-813798
Share on other sites

Here is my PHP code, I sure it missing the main part that uploads the file. The php file is named email.php

 

 

I'm sure there should be and action from the Attachment button calling the email.php. Not sure how to do this..

 

Once again thanks for the help in advance.

 

<?php

/***************************************************\

* PHP 4.1.0+ version of email script. For more

* information on the mail() function for PHP, see

* http://www.php.net/manual/en/function.mail.php

\***************************************************/

 

 

// First, set up some variables to serve you in

// getting an email.  This includes the email this is

// sent to (yours) and what the subject of this email

// should be.  It's a good idea to choose your own

// subject instead of allowing the user to.  This will

// help prevent spam filters from snatching this email

// out from under your nose when something unusual is put.

 

$sendTo = "[email protected]";

$subject = "My Flash site reply";

 

// variables are sent to this PHP page through

// the POST method.  $_POST is a global associative array

// of variables passed through this method.  From that, we

// can get the values sent to this page from Flash and

// assign them to appropriate variables which can be used

// in the PHP mail() function.

 

 

// header information not including sendTo and Subject

// these all go in one variable.  First, include From:

$headers = "From: " . $_POST["firstName"] ." ". $_POST["lastname"] . "<" . $_POST["email"] .">\r\n";

// next include a replyto

$headers .= "Reply-To: " . $_POST["email"] . "\r\n";

// often email servers won't allow emails to be sent to

// domains other than their own.  The return path here will

// often lift that restriction so, for instance, you could send

// email to a hotmail account. (hosting provider settings may vary)

// technically bounced email is supposed to go to the return-path email

$headers .= "Return-path: " . $_POST["email"];

 

// now we can add the content of the message to a body variable

$message = $_POST["message"];

 

 

// once the variables have been defined, they can be included

// in the mail function call which will send you an email

mail($sendTo, $subject, $message, $headers);

 

?>

Link to comment
https://forums.phpfreaks.com/topic/154750-flash-php/#findComment-813840
Share on other sites

looking at the php, you have nothing in there that deal with a file upload.....its just group of variable that will be used by the mail() function at the end of your script...I would probably suggest looking into a few of the file upload tutorials for flash (off topic for this forum/site) so that you can monitor the file upload status, or maybe have the attach button on your flash form have teh user select a path to a file, then forward that file name to the server in the background, while the php page returns a message to the flash file after it completes the upload...

 

http://us3.php.net/manual/en/features.file-upload.post-method.php  //php manual on form uploads, which you would need to compensate/adjust with some adjustments with the URLVariable's object in flash.

 

but I highly suggest using flash to handle you upload and php to move your file like this AS2 tutotial shows....

http://markshu.ca/imm/flash/tutorial/fileReference.html

 

also how comforable are you with Flash (Actionscript to be more exact?) and PHP ?

Link to comment
https://forums.phpfreaks.com/topic/154750-flash-php/#findComment-813861
Share on other sites

Well to be honest I'm just trying to Help my wife. Hahahahaha I really don't NO anything about flash or PHP. The main goal here is allow someone that vist her website to be able to send a comment and also be able to send an attachment if they like. Once the mail its sent, would like for the attached file to be deleted from the server. So over al its just a website with a contact form, but the contact from allows the viewer atached a file. Once the comment is sent is there was and attached file, the file would be deleted from the server.

Link to comment
https://forums.phpfreaks.com/topic/154750-flash-php/#findComment-813868
Share on other sites

http://www.flashattach.com/Smooth-Blue.php from http://www.flashattach.com/

 

I found the attachment while browsing HotScript.com to try and help you out with something....looks a bit familiar.. :-P ...if you purchased this product from them...and its not doing what its supposed to do I would suggest contacting them...since I think some of these concepts that make this function might be beyond your grasp at the moment...

 

and further reading suggest that the php code you are using or trying to is far detached from the php code the original authors intended to be used....(http://www.flashattach.com/phpscreenshot.php)....

 

Cheers!

Link to comment
https://forums.phpfreaks.com/topic/154750-flash-php/#findComment-813887
Share on other sites

Yes,

  I got the setup from a friend, that tried to used this once before but for some reason couldn't firgure it out. I was just trying to get this to work, this way my wife would creat here own design and use some of these action script/php codes.

 

Well I guess I will need to study alot more as this is out of my leauge right now.

 

Hahahahahahahha

 

 

Link to comment
https://forums.phpfreaks.com/topic/154750-flash-php/#findComment-813895
Share on other sites

very nice....I just recently came into the world of Flash & Flex, and have read a few books on the subject, I feel fairly capable...feel free to PM me, Im more than willing to help you out in your path to learning, if you have AIM, you can also catch me on there...just take out the "a" from my screen name....good luck...

 

Cheers!

Link to comment
https://forums.phpfreaks.com/topic/154750-flash-php/#findComment-813914
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.