automatically submitting pages

N

nutts4life

Hey guys,

I'm trying to submit a form that does two things:

1/ Sends me an email using an email form (this has been tested and
works)
2/ Uploads a file.

The form on the initial page looks like:

<form action='upload.php' enctype='multipart/form-data' method='post'>
Name:<input type='text' title='Visitor\'s Name' name='sendername'
STYLE='width: 200px'>
Email:<input type='text' title='Visitor\'s Email address'
name='senderemail' STYLE='width: 200px'>
Comments:<textarea title='Visitor\'s Comments and/ or Questions'
name='sendermessage' STYLE='width: 250px' rows='4'></textarea>
File:<input type='file' name='file' size='30'>
<input value='Upload' type='submit' class='submitbutton'>
</form>

This as you can see above calls upload.php:

<html>
<head>
</head>
<body>
##################
## Php upload txt goes here
###################

<p>Sending Files</p>
<p>Please wait..................</p>
<form name='emailUpload'
action='http://www.mysite.net/cgi-bin/cgiemail/email/emailme.txt'
method='post' enctype='text/html'>
<input type='hidden' name='sendername'>
<input type='hidden' name='senderemail'>
<input type='hidden' name='sendermessage'>
<input type='hidden' name='subject' value='Upload'>
<input type='hidden' name='redirect'
value='http://www.mysite.net/index.php?page=sent'>
</form>
<script type='text/javascript' language="JavaScript">
<?php
print "document.emailUpload.sendername.value = " .
$_POST['sendername'] . "\n";
print "document.emailUpload.senderemail.value = " .
$_POST['senderemail'] . "\n";
print "document.emailUpload.sendermessage.value = " .
$_POST['sendermessage'] . "\n";
?>
document.emailUpload.submit();
</script>
</body>
</html>


I've left out the upload php part as it is not causing the problem.

The upload php part uploads the files successfully, but i can't get
the form to submit the email and return to the home page.

I am also unable to pass over the 'sendername' id to the upload.php
but all the other variables are passed over fine.

Any ideas?

Thanks in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,067
Latest member
HunterTere

Latest Threads

Top