PHP forms submitted as an attachment rather than email?

How do I get my PHP forms submitted as an attachment rather than email?
Meaning, if I set up a form on my website and someone completes and submits it, how can I get the responses as an attachment rather than in email text?
Much appreciated.
G

Hi Gunter
I have spent so much time on this now.
I have tried to convert the php to an attached .txt or .csv file.
Learnt a lot but still can not seem to get the form data to be submitted as an attached file.
Here are two of my attempts, please assist:
<?php
$email=$_REQUEST['email'];
$firstName=$_REQUEST['firstName'];
$lastName=$_REQUEST['lastName'];
//The Attachment
$cr = "\n";
$data = "Email" . ',' . "First Name" . ',' . "Last Name" . $cr;
$data .= "$email" . ',' . "$firstName" . ',' . "$lastName" . $cr;
$fp = fopen('reservationTest.csv','a');
fwrite($fp,$data);
fclose($fp);
// Mail to
$email = "myemailaddress";
//subject
$subject = "Test Budget reservation";
//Header
$headers("Content-type: application/octet-stream");
$headers("Content-Disposition: attachment; filename=reservationTest.csv");
$headers("Pragma: no-cache");
$headers("Expires: 0");
//Message
$message = "".
"Email: $email" . "\n" .
"First Name: $firstName" . "\n" .
"Last Name: $lastName";
mail($email, $subject, $message, $headers);
?>
<html>
<body>
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<div align="center">Guperman Your Test Message Has Been Submitted</div>
</td>
</tr>
</table>
</body>
</html>
EOD;
echo "$theResults";
OR
<?php
/* subject and email variables */
$email = $_POST['email'];
$lastname = $_POST['lastname'];
$firstname = $_POST['firstname'];
    $to = 'myemailaddress';
    $emailSubject = 'Test Form';
    $headers = "From: $email\n";
$message = "A new reservation test.\n
Last Name</b>: $lastname
Name</b>: $firstname
Email</b>: $email
    mail($to,$emailSubject,$headers,$message);
//open the file and choose the mode
$fh = fopen("reservationTest.txt", "a");
fwrite($fh, $email);
//close the file
fclose($fh);
?>
<html>
<body>
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<div align="center">Guperman Your Test Message Has Been Submitted</div>
</td>
</tr>
</table>
</body>
</html>
On both accounts when I test these files I get the following types of messages.
Warning:  fopen(reservationTest.csv) [function.fopen]: failed to open stream: Permission denied in \\HOSTING\DFS\20\1\9\1\2028751191\user\sites\mywebsite.com\www\reservationTest.php on line 11
Warning:  fwrite(): supplied argument is not a valid stream resource in \\HOSTING\DFS\20\1\9\1\2028751191\user\sites\mywebsite.com\www\reservationTest.php on line 12
Warning:  fclose(): supplied argument is not a valid stream resource in \\HOSTING\DFS\20\1\9\1\2028751191\user\sites\mywebsite.com\www\reservationTest.php on line 13
Fatal error:  Function name must be a string in \\HOSTING\DFS\20\1\9\1\2028751191\user\sites\mywebsite.com\www\reservationTest.php on line 22
And then to give the .php files permission I left click on the already uploaded files and try and set the permission to 777, but then I get a response like: Setting Access Properties failed for:
Your assistance is much appreciated. Regards

Similar Messages

  • How can I sent photos as attachment rather than embedded in the email?

    For work, I need to send photos to my editor via email. In Mail, the jpgs automatically become embedded in the body of the the email, but my editor would prefer to receive them as attachments. Is there any way to send photos as attachments in Mail, rather than embedded email itself?

    LaSylphide, the Mail forum shows up as one of the categories within the "Mac OS and System Software" forum. Click on whichever version of OSX you're using, and you'll see the list of categories.
    There are several threads on this topic, and I've seen three solutions:
    1. Check the "Send Windows-Friendly Attachments" box. Some people say it works, some say it doesn't.
    2. Open Terminal and type:
    defaults write com.apple.mail DisableInlineAttachmentViewing -bool yes
    Some people say this works, some say it doesn't.
    3. In Mail > Preferences > Composing, make sure "Message Format" is set to "Plain Text." Once again, some say this works, some say it doesn't.
    Hopefully, one of those will solve your problem. There may also be a setting in your editor's email program that would solve it, but I'm assuming that's a Windows app and I haven't worked with Windows since 1993, so I'm no help there.

  • Openning a form in a new tab, rather than a new window

    I have a BSP application that generates a smartform as a PDF, then renders the binary data to a new window using CL_HTTPSERVER=>SERVER_CACHE_UPLOAD. This is working fine for creating a new window. But, i want to create the smartform output in a new browser tab, rather than a new browser window.
    Can this be done?

    Disregard... I guess it is opening a separate tab after all in FF.

  • I attach a file in mail and the whole thing shows there ie. attach a PDF and the whole pdf content is displayed in the mail.  Anyone know how I just get the icon toi appear as the attachment rather than the whole file?  This only happens with pdf and jpg

    Hi Folks,
    When I attach a jpg or pdf to a mail it shows as the whole document "pasted" into the mail.  Anyone know how I get the file to just show as an icon and not as a mass of pasted in docs?
    Thanks,
    Pedro

    For your own viewing, you can of course control-click on the attachment and select "View as Icon".
    For others' viewing, it depends upon their email reader.  To ensure that attachments are not displayed expicitly you can put them all in a zip file (via control click and "Compress") then attaching them, or you can use third party stuff like Attachment Tamer.
    charlie

  • ADF input form, changing mode to input rather than display

    aim of what i am tring to do:
    create an input form using ADF and UIX which accepts input and moves to a different page.
    approach taken:
    I have a data control based on a business component created from a database table. I have dragged the columns onto a UIX page as an input form without navigation.
    the problem/question:
    how do i set the data controls mode to create upon displaying the page? I want the page just to accept input and submit. it will never be used for displaying data, which is its current default state.
    i have tried calling the create method of the data control from a few places, but i am not sure where the correct place to call this is.

    You can create a dataaction before the page is called and drag the Create method on to it.
    Or you can add the create method as a button to the page that will end up calling your insert page.
    http://www.oracle.com/technology/obe/obe9051jdev/ADFWorkshop/BuildingADFApplicationsWorkshop.htm

  • Submitting an individual region rather than everything on a page

    I'm sure I have seen an online example of a page where just the region is submitted so that is the only section of the page that gets re-drawn
    but after searching all the usual supsects off here
    http://www.apexblogs.info/pls/apex/f?p=113:8:0
    but I cannot seem to find it
    does anybody have any ideas ??
    any help greatly appreciated
    Cheers
    Chris

    Hi Chris,
    There are certainly a good number of Apex/Ajax examples out there. For an example, see: [http://htmldb.oracle.com/pls/otn/f?p=20297:14] (this is a typical example of cascading select lists).
    The construct of an Ajax call is pretty much the same regardless of what you are trying to do. There are a few things to bear in mind:
    1 - You need an Application Process that runs On Demand (create this through Shared Components). This process can run any PL/SQL code you need - including updating tables (in the example above, this just retrieves values and constructs select lists from them)
    2 - You need one or more Items (usually Application Items - again, created through Shared Components) to receive values to be used in your PL/SQL code. Each Item is given its value in the Ajax call using get.add(). Though the process can use any item value stored in session state.
    3 - You need to handle any data or value(s) returned by the process - either a success message, for example, or data for output onto the page. The format of the output is determined by the process - it could be XML, plain text or htp.p() output.
    4 - The Ajax code needs to be triggered by some user action - typically clicking a button or changing a select list value.
    Andy

  • Attached rather than embedded?

    In Mail (and Tiger), how can I receive messages with attachments, such as photos, not embedded in the text? Can attachments -- to be clicked on -- be indicated at the top or bottom of the message?
    Thanks!

    The Mail.app displays all photo/image type attachments with received messages inline or viewed in place within the body of the message by default which cannot be turned off. Inline or viewed in place attachments are not embedded.
    The same when attaching such files to a Mail.app message. Although image/photo and smaller PDF attachments (1-2 pages) appear inline or viewed in place within the body of the message by default before being sent, depending on the recipient' s email client and available preference settings such attachments may appear inline or viewed in place within the body of the message when the message is opened by the recipient or as attached files only which must be opened separately for which the sender has no control over.
    You can try a plugin for the Mail.app called Mail Attachments Iconizer which is Shareware ($6.00).

  • Php form not including a field in the email sent to me

    I have tried to add a phone field to an existing form on my site, I just duplicated the existing email field and changed to say phone instead. The form works fine except that the  email that comes through to me has all entered data from the form except for the phone field. Help would be great as I am a bit of a newbie.
    Here is the mail.php:
    <?php
        $name = $_REQUEST['name'] ;
        $email = $_REQUEST['email'] ;
        $phone = $_REQUEST['phone'] ;
        $comments = $_REQUEST['comments'] ;
        $message =
            Name: $name\n
            Email: $email\n
            Phone: $phone\n   
            Comments: $comments
        mail( "removedforprivacy", "Email from my website, sent by $name",
         $message, "From: $email"  );
    ?>
    Here is the form HTML:
    <form method="post">
                            <fieldset>
                                <ol>
                                    <li>
                                        <label for="name" id="name_label">Name</label>
                                        <input id="name" type="" value="Your Name" name="name" class="text-input" />
                                        <label class="error" for="name" id="name_error">This field is required.</label>
                                    </li>
                                    <li>
                                        <label for="email" id="email_label">Email</label>
                                        <input id="email" type="" value="Your Email" name="email" class="text-input" />
                                        <label class="error" for="email" id="email_error">This field is required.</label>
                                    </li>
        <li>
                                        <label for="phone" id="phone_label">Phone</label>
                                        <input id="phone" type="" value="Your Phone" name="phone" class="text-input" />
                                        <label class="error" for="name" id="phone_error">This field is required.</label>
                                    </li>                           
                                    <li>
                                        <label for="comments" id="comments_label">Boston Brewery Booking Requested Date</label>
                                        <textarea id="comments" type="" name="comments" class="text-input">Required Date</textarea>
                                        <label class="error" for="comments" id="comments_error">This field is required.</label>
                                    </li>
                                    <li>
                                        <button type="submit" name="submit" class="send" id="submit_btn" value="Send">Submit</button>
                                    </li>
                                </ol>
                            </fieldset>
                        </form>

    Your form and php works ok for me. I can't see a reason for it not to get the phone details.
    What happens if you move the phone variable to the top of the stack (not that it should make any difference)
    $phone = $_REQUEST['phone'] ;
    $name = $_REQUEST['name'] ;
    $email = $_REQUEST['email'] ;
    Phone: $phone\n
    Name: $name\n
    Email: $email\n

  • Is it possible to link iMessage for the mac, to a phone number rather than email address?

    Hi All
    I would like imessage for the MAC to be synced with my phone number, so that the person im sending two does not receive two seperate threads?

    Just go to contacts and add their info and put their phone number in and not their email.

  • Is there a way to send the email notification as a PDF attachment and the email receipt as an email

    Has anyone found a way to send the email notification as a PDF attachment rather than email? I would still like to send the receipt as an email though? Any thoughts or experiences out there?

    Thanks for prompt response. Does this mean that there are future plans to do this?
    The forms received are used as part of a registration process into aonther system and aren't that User friendly in an email form. They have to be processed as received, so not efficiet to go in through the back end.

  • Form widget sends as attachment

    I am using the basic forms widget in a Muse page
    It works fine, but it is sending responses as an attachment rather than in the body of the email
    Attachments are always dangerous
    Is there a way to change the default so that my responses are sent in the body of the email?
    Thanks
    jki

    Hi
    Muse does not have control over this , It actually depends on the email client you are using and the system itself.
    For example , if you have any email scanning application , system's temp memory is full etc.
    You can try to use another email in form to verify this and check the settings of client used.
    Additionally , please go through these links for more information :
    http://kb.mailchimp.com/article/my-emails-are-being-delivered-as-broken-html-code-or-an-at tachment/
    http://www.sevenforums.com/browsers-mail/230679-email-body-shown-attachment.html
    http://answers.microsoft.com/en-us/windowslive/forum/livemail-email/email-contents-become- attachment-in-windows-live/acbbf5b7-1f39-4238-8b63-d3cdfb3c778a
    Thanks,
    Sanjit

  • How can I convert an iphoto to a file rather than a picture?

    I have several friends who would rather get my email with a file attached rather than photos?  How can I do this with Iphoto?

    Try this:  in Mail's Composing preference pane set the format of the emails to plain text.  Then once the photos are in the email Control-click on them and select "Show as icon" in the contextual menu.
    That might let them see the photos as icons/attachments rather the view the photos.  A lot depends on how they have their email client setup. 
    The sure fire way is to zip/compress the photos and adding the zipped file to the email.
    The recipient will have to unzip the file at the other end to get the image files.
    OT

  • Is it possible to create a standard form that can be emailed to anyone and once filled out by the receiver, have a button that the receiver clicks and the form is encrypted and attached an email back to the sender and a preset admin password would open it

    Is it possible to create a standard form that can be emailed to anyone and once filled out by the receiver, have a button that the receiver clicks and the form is encrypted and attached to an email back to the sender and a preset admin password would open it?

    Hello Graphicsguy123,
    You would need to first create the form ( or Widget in EchoSign) first to generate a url which you can paste it in the email being sent to customers. You would need to make sure you have a Document Cloud Enterprise Premium account in order to create a Widget. If you don't have the account, you can use the trial version to test it. Here is the link:
    Global Trial Registration | eSign services from Adobe
    -Rijul

  • PHP Form Emailing Fields But No Data

    Hello,
    I am running into a little problem with my PHP form script.  I am able to email my form and receive a message, however the message has no data, except for where I have check boxes.  Can anyone help me solve this dilemma?  Some of the code has been remove intentionally.
    I will post my code:
    <?php
    /* Email Variables */
    $emailSubject = ' Registration Form';
    $webMaster = 'de';
    /* Data Variables */
    $registrationname = $_POST['registrationname'];
    $registrationphone = $_POST['registrationphone'];
    $registrationemail = $_POST['registrationemail'];
    $registrationdistrict = $_POST['registrationdistrict'];
    $registrationposition = $_POST['registrationposition'];
    $onecredit = $_POST['onecredit'];
    $twocredit = $_POST['twocredit'];
    $threecredit = $_POST['threecredit'];
    $body = <<<EOD
    <br><hr><br>
    Name of Register: $registrationname <br>
    Day Time Phone Number: $registrationphone <br>
    Email Address of Register: $registrationemail <br>
    Name of School District: $registrationdistrict <br>
    Position/Job Title: $registrationposition <br>
    Register for 1 Credit: Learning to Use the easyCBM Assessment System: $onecredit <br>
    Register for 2 Credits: In-Depth Knowledge of the easyCBM Assessment System: $twocredit <br>
    Register for 3 Credits: Enroll in Both of the Above Options: $threecredit <br>
    EOD;
    $headers = "From: $email\r\n";
    $headers .= "Content-type: text/html\r\n";
    $success = mail($webMaster, $emailSubject, $body,
    $headers);
    /* Results rendered as HTML */
    $theResults = <<<EOD
    <html>
    <head>
    <title>sent message</title>
    <meta http-equiv="refresh" content="6;URL=http://.html">
    <style type="text/css">
    <!--
    body {
    background-color: #D9D3A9;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 20px;
    font-style: normal;
    line-height: normal;
    font-weight: normal;
    color: #000000;
    text-decoration: none;
    padding-top: 200px;
    margin-left: 200px;
    width: 800px;
    -->
    </style>
    </head>
    <div align="center">Thank you! Your request has been sent.
    You will return to the page in a few moments.</div>
    </div>
    </body>
    </html>
    EOD;
    echo "$theResults";
    ?>

    1) I would bring the line <cfoutput query="CheckUser"> lower down in the code, for example, just before the first table tag.
    2)These are probably mistakes
    <<table border="0" align="center" cellpadding="0" cellspacing="0">
    <input type="hidden" name="LogDate" value="Now()">
    I think they should be
    <table border="0" align="center" cellpadding="0" cellspacing="0">
    <input type="hidden" name="LogDate" value="#Now()#">
    3) You could revise the action page to:
    <cfif isDefined("form.logDate")>
    <cfinsert datasource="manna_premier" formfields="LogDate,TerritoryManager,Status,DSRName,ServiceName" tablename="TMStatusLog">
    <cflocation url="mp_order_form.cfm">
    </cfif>
    The table TMStatusLog must of course have columns LogDate, TerritoryManager, Status, DSRName and ServiceName.

  • Submit form as an email rather than an attachment

    When someone submits a form with answers, I need the answers to be in the body of the text, rather than as an attachment. How do i get this to happen?
    Scott

    You can inject data into the string that gets sent to the email program, you don't have any control over formatting except for returns and that kind of thing.
    Here are a couple of ways of doing it:
    var strToAddress, strCCAddress, strSubject, strMessage
    strToAddress = txtToAddress.rawValue;
    strCCAddress = txtCCAddress.rawValue;
    strSubject = txtSubject.rawValue;
    strMessage = txtMessage.rawValue;
    event.target.submitForm({cURL:"mailto:"+ strToAddress + "?cc=" + strCCAddress + "&subject=" + strSubject + "&body=" + strMessage,cSubmitAs:"PDF",cCharset:"utf-8"});
    You can use variables in the following as well:
    var oDoc = event.target;
    oDoc.mailDoc({
    bUI: true,
    cTo: "[email protected]",
    cCC: "[email protected]",
    cSubject: "The Latest News",
    cMsg: "A.P., attached is my latest news story in PDF."

Maybe you are looking for

  • Error while creating fields in the Category Structure Urgent

    Hii, I am getting the Error while creating the Category structure fields Error Message : Entry YF_COU   does not exist in CABN - check your entry Message no. 00058 Diagnosis Input values must be defined in Table CABN. The value or values 'YF_COU ' ar

  • My Mac keeps crashing (Mid 2010, 13 inch MbPro, 10.10)

    My mac keeps crashing every now and then (ca. a couple of times week). I have upgraded the ram and put in an SSD. This problem has happened on mavericks and after i upgraded it to Yosemite. Safari is also crashing every now and then. Can someone help

  • How to find out the top 20 queries used in a week

    Hi Guru's, I would like to know how to gather the information regarding the Top 20 queries used in the system per week, by a multicube. Note: I am using BI 7.0 and also Statistics are turned on. The aim is to pre-calculate these queries at night to h

  • How do I make a font in a Macbook Pro

    I want to make a font from scratch. I have read that there are two different ways to make a font. One is to scan it in and use and editor and save as a font, which is a very vague answer. What software do you use? The other was mention via a windows

  • SAP B1 8.81 Customer Demo License Key Request Link

    Hello , Could you please specify the link and steps to request a temporary Customer Demo License Key in SAP B1 8.81 ? Thanks Dinesh