Jump to content

php forms in flash...


kammithekiller

Recommended Posts

ok, so i made a form in flash...but it isnt working... i read a few tutorials on kirupa.com and gotoandlearn.com, but im still having issues.  Its a simple email form, and it looks like it should work but...

here is the page

http://www.geminiqualityembroidery.com/main2.html

 

i can upload the .fla if needed, here is the .php attached to it...

 

<?php

$sendTo = "[email protected]";

$subject = "subject";

$headers = "From: " . $_POST["name"];

$headers .= "<" . $_POST["email"] . ">\r\n";

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

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

$message = $_POST["body"];

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

?>

 

i made the form a movieclip, instance name is "form"

in the movieclip are the boxes to fill out, with variable names "name" "email" and "body"

kirupa said to make it into a movieclip, but now im not sure....any help would be appreciated...

 

 

 

also i cant get this script to upload+ email, all it's doing currently is uploading the images to a .tmp folder in the site, but then i can view the images:

 

to see the .swf go to:

http://www.gemeniqualityembroider.com/upload2.html

 

<?php

 

$maxwidth = 100;

 

if ($_SERVER['REQUEST_METHOD'] == 'POST') {

// Where the file is going to be placed

$target_path = "temp/";

 

/* Add the original filename to our target path. 

Result is "uploads/filename.extension" */

$target_path = $target_path . basename( $_FILES['file']['name']);

$_FILES['file']['tmp_name'];

 

$target_path = "uploads/";

 

$target_path = $target_path . basename( $_FILES['file']['name']);

if(move_uploaded_file($_FILES['file']['tmp_name'], $target_path)) {

    echo "The file ".  basename( $_FILES['file']['name']).

    " has been uploaded";

$imgname = basename( $_FILES['file']['name']);

echo '

<script type="text/javascript">

window.opener.document.getElementById("filename").value = "'.$imgname.'";

</script>';

 

$image = "uploads/$imgname";

chmod($image, 0644);

$sizes = array_values(getimagesize($image));

list($width, $height, $type, $attr) = $sizes;

$prev = '<img src="'.$image;

$ratio = $maxwidth / $width;

$maxheight = $height * $ratio;

  if ($maxheight > 150) {

    $maxheight = 150;

    $ratio = 150 / $height;

    $maxwidth = $width * $ratio;

  }

$prev =  $prev.'" width="' . round($maxwidth) .'" ';

$prev =  $prev.'height="' . round($maxheight) .'" ';

$prev =  $prev.'border="0">';

if (substr_replace ($imgname, '', 0, -3) == "pdf") {

$prev = "<embed height='150' src='uploads/$imgname";

$prev = $prev."#toolbar=0&navpanes=0&scrollbar=0' type='application/pdf' width='100'>";

echo '

<script type="text/javascript">

window.opener.document.getElementById("preview").innerHTML = "'.$prev.'";

setTimeout ( "window.close()", 2000 );

</script>';

} else {

echo '

<script type="text/javascript">

window.opener.document.getElementById("preview").innerHTML = \''.$prev.'\';

setTimeout ( "window.close()", 2000 );

</script>';

}

 

} else{

    echo "There was an error uploading the file, please try again!";

$url = "uploader.php"; // target of the redirect

$delay = "3"; // 3 second delay

echo '<meta http-equiv="refresh" content="'.$delay.';url='.$url.'">';

}

 

} else {

$loading = ' ';

echo '

<HTML>

<body>

<form enctype="multipart/form-data" id="form1" name="form1" method="post" action="">

  <table border="0" cellspacing="0" cellpadding="0">

    <tr>

      <td valign="top"> <strong> Image:

        <label></label>

            <label></label>

      </strong></td>

      <td align="right"><strong>

        <input type="file" name="file" id="file"/>

        <br />

<input type="hidden" name="MAX_FILE_SIZE" value="10000000" />

        <input onClik="document.body.innerHTML=\''.$loading.';\'" name="upload" type="submit" id="upload" value="Upload" />

          </strong></td>

    </tr>

  </table>

  <p><strong>Click browse to choose file, then click upload to upload your file.</strong></p>

</form>

</body>

</HTML>

';

}

?>

 

like i said, it works, but i want the files emailed to me...i dont know the first thing about .php, this was pretty much a copied/pasted one...

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

...and this is code on the form on the main page....

i cant upload the .fla b/c its bigger than 1mb

 

on (release) {

// send variables in form movieclip (the textfields)

// to email PHP page which will send the mail

form.loadVariables("emailscript.php","POST");

}

 

 

hopefully this is the right place to post, i know its a php/flash question  but hopefully someone out there can help

Link to comment
https://forums.phpfreaks.com/topic/125615-php-forms-in-flash/#findComment-649455
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.