Jump to content

Recommended Posts

Hi everyone,

 

i need my web form to send the info submitted as a txt file and not just an email... here is my current code...

 

<?php
  $email = $_REQUEST['email'] ;
  $zip = $_REQUEST['zip'] ;
  $name = $_REQUEST['name'] ;
  $phone = $_REQUEST['phone'] ;
  $order1 = $_REQUEST['RadioGroup1'] ;

  mail( "email@domain.com", "subject line",
  "$order1\n $zip\n $name\n $email\n $phone\n", "From: x@domain.com" );
  header( "Location: thankyou.html" );
?>

 

anyone know of a way to do this? i guess i need it to write the form as a txt on the server then attach it to an email with a subject line.

Link to comment
https://forums.phpfreaks.com/topic/85581-web-form-sending-a-file/
Share on other sites

 

im not sure, but it doesn't look like this code does write. i need it to right the data from the form to a text file first and send it, not attach a file from the users machine.

 

im not sure, but it doesn't look like this code does write. i need it to right the data from the form to a text file first and send it, not attach a file from the users machine.

 

well you need to do both, right?

 

look up fwrite()  on php.net:

http://us2.php.net/fwrite

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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