# [web] help needed with php mail form

This topic is 4839 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

i wanted to create an application form on my web site so people could send in an example of their work and details etc. though at the moment it dosen't seam to be working. dose any one know whats wrong or have any tutorials on how to make one with a file field? my web page is: http://www.womangeeks.com/paper/join.html the php file is: <? $from =$_REQUEST['email'] ; $to = 'admin@womangeeks.com';$message = 'Name: ' $_REQUEST['name'], '\n AKA forum handel: '$_REQUEST['username'], '\n what age you are:' $_REQUEST['age'], '\n gender: '$_REQUEST['gender'], '\n what you would write about: ' $_REQUEST['what'], '\n whats skills i have: '$_REQUEST['skills'], '\n web site:' $_REQUEST['website'], '\n where are you from: '$_REQUEST['country'], '\n what time your normaly online: ' $_REQUEST['timeonline'], '\n url: '$_REQUEST['example']; $attachment =$_REQUEST['exampleupload'] ; function mail_attachment ($from ,$to, 'jointeam', $message,$attachment) header( "Location: http://www.example.com/thankyou.html" ); ?>

##### Share on other sites
I would look into using PHPMailer rather than rolling out your own script. This short tutorial will show you how to allow users to upload files so that you can attach them to the emails.

##### Share on other sites
I wouldn't use attachments... It's abusable if you don't put in some restrictions and is difficult to get working I hear. I *think* you might be able to do it using pear though if it's that important. Rather maybe just have them link to their online work? :)

In your script, I see you started to define a new function but didn't finish it. :p I'm not sure what you were doing there, but I rewrite a bit of what you did to get it more organized as well as making use of the mail() function to get it to work. You'd just have to make sure to change the html form to ask for a url rather than an attachment/upload.

<?php$to = 'admin@womangeeks.com';$subject = 'Wanting to Join Our Team?';$headers = "From: {$_REQUEST['email'}"];$body = "Name: {$_REQUEST['name']},\n";$body .= "AKA forum handel: {$_REQUEST['username']}\n";$body .= "What age you are: {$_REQUEST['age']}\n";$body .= "Your Gender: {$_REQUEST['gender']}\n";$body .= "What you would write about: {$_REQUEST['what']}\n";$body .= "What skills you have: {$_REQUEST['skills']}\n";$body .= "What your web site is: {$_REQUEST['website']}\n";$body .= "Where you are from: {$_REQUEST['country']}\n";$body .= "What time you're normaly online: {$_REQUEST['timeonline']}\n";$body .= "A link to your example: {$_REQUEST['example']}\n";mail ($to,$subject, \$body);header('Location: http://www.example.com/thankyou.html');?>

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 9
• 9
• 9
• 14
• 12
• ### Forum Statistics

• Total Topics
633294
• Total Posts
3011242
• ### Who's Online (See full list)

There are no registered users currently online

×