Hi can anyone help me with passing values from one form to a pop-up
form and in doing so how can you add more than one onclick to one button.
Here is the code
<SCRIPT LANGUAGE=”JavaScript”>
<!– Original: Eric King (
<!– Web Site: [url]http://redrival.com/eak/
<!– This script and many more are available free online at –>
<!– The JavaScript Source!! [url]http://javascript.internet.com
<!– Begin
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width – w) / 2;
var wint = (screen.height – h) / 2;
winprops = ‘height=’+h+’,width=’+w+’,top=’+wint+’,left=’+winl+’,resizable’
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
// End –>
</script>
<DIV style=”Z-INDEX: 8; WIDTH: 150px; POSITION: absolute; TOP: 1005px; HEIGHT: 10px; LEFT: 10px”><font face=”verdana” font size=”1″><b>Add Picture:</b>
<INPUT TYPE=”button” VALUE=”Click to send Image”
<a href=”
<DIV
<DIV
[code=php]<?php
##################################################
#####
# This script is Copyright 2003, Infinity Web Design #
# Distributed by <a href="http://www.webdevfaqs.com" target="_blank">http://www.webdevfaqs.com</a> #
# Written by Ryan Brill - [email][email protected][/email] #
# All Rights Reserved - Do not remove this notice #
# Also thanks goes to Shimon and Shrine Designs #
##################################################
#####
// email to...
$first = "[email protected]";
$second = "[email protected]";
$subject = "PSRA web form."; // set the subject line
$from = $_POST['bemail'];
$forward = 0; // redirect? 1 : yes || 0 : no
$location = "http://www.psra.com.au/nrdata/thanks.htm"; // set page to redirect to, if 1 is above
// date and time
$date = date("l, F jS, Y");
$time = date("h:i A");
$message = "Below is the result of your feedback form. It was submitted on {$date} at {$time}.nnIP: {$_SERVER['REMOTE_ADDR']}nn";
$method = ($_SERVER['REQUEST_METHOD'] == 'POST') ? $_POST : $_GET;
foreach($method as $key => $value)
{
$key = ucfirst($key);
$message .= "{$key}: {$value}n";
}
$subject = $_POST['PSRA IMAGE'];
$fileatt = $_FILES['fileatt']['tmp_name'];
$fileatt_type = $_FILES['fileatt']['type'];
$fileatt_name = $_FILES['fileatt']['name'];
$headers = "From: $from";
if (is_uploaded_file($fileatt)) {
// Read the file to be attached ('rb' = read binary)
$file = fopen($fileatt,'rb');
$data = fread($file,filesize($fileatt));
fclose($file);
// Generate a boundary string
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
// Add the headers for a file attachment
$headers .= "nMIME-Version: 1.0n" .
"Content-Type: multipart/mixed;n" .
" boundary="{$mime_boundary}"";
// Add a multipart boundary above the plain message
$message = "This is a multi-part message in MIME format.nn" .
"--{$mime_boundary}n" .
"Content-Type: text/plain; charset="iso-8859-1"n" .
"Content-Transfer-Encoding: 7bitnn" .
$message . "nn";
// Base64 encode the file data
$data = chunk_split(base64_encode($data));
// Add file attachment to the message
$message .= "--{$mime_boundary}n" .
"Content-Type: {$fileatt_type};n" .
" name="{$fileatt_name}"n" .
"Content-Transfer-Encoding: base64nn" .
$data . "nn" .
"--{$mime_boundary}--n";
}
// Send the message
mail($first,$subject,$message,$headers);
if($second != NULL)
{
mail($second,$subject,$message,$headers);
}
//mail($to, $subject, $message, $headers);
if($forward == 1)
{
header("location :$location");
}
else
{
echo "Thank you for submitting our form. We will get back to you as soon as possible.";
}
?>[/code]
Save this file as the mailer.php (maybe after cleaning it up a bit) and set it as the one and only form's action with the file thingy inside like you already did it.0.1.9 — BETA 5.21