Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Sep 2003
    Posts
    59
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Prompting user to save contents of textarea?

    Is there anyway to have a visitor to your site save the contents of a textarea on their hard drive?
    ~SiNa94~
    http://seducius.port5.com/
    "Stab...die!"

  • #2
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes, but not using pure Javascript (at least I can't think of one that won't require the use of ActiveX..). Using a server-side language it's pretty easy, like PHP:

    Code:
     <html>
      <head>
       <title>Save the contents of this textArea</title>
      </head>
    
      <body>
       <form method="post" action="saveTextArea.php" target="_blank">
        <textarea name="my_textarea"></textarea>
        <input type="submit">
       </form>  
      </body>
     </html>
    PHP Code:
     <?php
      header
    ("Content-type: application/octet-stream");
      
    header("Content-Disposition: attachment; filename=my_textarea.txt");
      
    header("Pragma: no-cache");
      
    header("Expires: 0");

      echo 
    $_POST['my_textarea'];
     
    ?>
    I'm pretty sure that's how you do it anyway..
    Sadiq.

  • #3
    New Coder
    Join Date
    Sep 2003
    Posts
    59
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The problem is that I've had trouble finding free webhosts that allow PHP...it's something I'd like to learn but I don't want to pay just to use it. I don't need a lot of bandwidth or anything... just to be able to use PHP.

    If there's no way around using a server side language then I'd rather the contents of the textarea just be e-mailed to me. I was hoping I could just have them save it so they could e-mail it to me as a work around... but if not...
    ~SiNa94~
    http://seducius.port5.com/
    "Stab...die!"

  • #4
    New Coder
    Join Date
    Sep 2003
    Posts
    59
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok, I didn't have any problems this time. I found a free webhost no problem. PHP and everything according to them. So, lets get the whole thing set up rather than just the SSL part so I don't have to come back later asking for the Javascript part of it.

    I want to have a series of forms on a page (one for each type of computer part) that allows them add the parts they own one at a time to a text area and then e-mail it to me. So there'd be a form for motherboards, hard drives, etc., and it would all show up in a textarea at the bottom of the page as they add it. Then when they're finished they can e-mail the list to me.
    ~SiNa94~
    http://seducius.port5.com/
    "Stab...die!"

  • #5
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by sina94
    Ok, I didn't have any problems this time. I found a free webhost no problem. PHP and everything according to them. So, lets get the whole thing set up rather than just the SSL part so I don't have to come back later asking for the Javascript part of it.

    I want to have a series of forms on a page (one for each type of computer part) that allows them add the parts they own one at a time to a text area and then e-mail it to me. So there'd be a form for motherboards, hard drives, etc., and it would all show up in a textarea at the bottom of the page as they add it. Then when they're finished they can e-mail the list to me.
    Ok.. so what's your question?

    Also, do you want the user to send the email using their default mail client (using the mailto protocol), or do you want PHP to email it to you on the serverside? You may need to check with your webhost regarding SMTP (if there's one setup for PHP, in the php.ini file).

    Sadiq.

  • #6
    New Coder
    Join Date
    Sep 2003
    Posts
    59
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok, here's what a little bit of what I have...

    HARDWARE<HR>
    <DIV style="position: absolute; top: 350; left: 300; width: 250;">
    <FONT style="text-decoration: underline;">Motherboard</FONT>
    <FONT SIZE=2>
    <FORM>
    Manufacturer: &nbsp;<SELECT NAME="moboManufacturer">
    <OPTION> Don't Know</OPTION>
    <OPTION> Abit</OPTION>
    <OPTION> Albatron</OPTION>
    <OPTION> Asrock</OPTION>
    <OPTION> Asus</OPTION>
    <OPTION> Biostar</OPTION>
    <OPTION> Chaintech</OPTION>
    <OPTION> DFI</OPTION>
    <OPTION> ECS</OPTION>
    <OPTION> FIC</OPTION>
    <OPTION> Gigabyte</OPTION>
    <OPTION> Intel</OPTION>
    <OPTION> Mach Speed</OPTION>
    <OPTION> Micronics</OPTION>
    <OPTION> MSI/Microstar</OPTION>
    <OPTION> Shuttle</OPTION>
    <OPTION> Soyo</OPTION>
    <OPTION> Super Micro</OPTION>
    <OPTION> Syntax</OPTION>
    <OPTION> Tyan</OPTION>
    <OPTION> XFX</OPTION>
    <OPTION> Other</OPTION>
    </SELECT>

    <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If other specify: &nbsp;<INPUT TYPE="text" NAME="moboOtherManufacturer" SIZE=13></INPUT>
    <br>
    CPU Module: &nbsp;<SELECT NAME="moboSocketType">
    <OPTION> Don't Know</OPTION>
    <OPTION> Slot 1</OPTION>
    <OPTION> Slot 2</OPTION>
    <OPTION> Socket 7</OPTION>
    <OPTION> Socket 8</OPTION>
    <OPTION> Socket 370</OPTION>
    <OPTION> Socket 478</OPTION>
    <OPTION> Socket 754</OPTION>
    <OPTION> Socket A</OPTION>
    <OPTION> Other</OPTION>
    </SELECT>

    <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If other specify: &nbsp;<INPUT TYPE="text" NAME="moboOtherSocketType" SIZE=13></INPUT>
    <br>
    Quantity:
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AGP/PCI/ISA&nbsp;&nbsp;
    <INPUT SIZE=1 NAME="AGP" VALUE="00">/
    <INPUT SIZE=1 NAME="PCI" VALUE="00">/
    <INPUT SIZE=1 NAME="ISA" VALUE="00">
    <br>
    Controller: &nbsp;<SELECT NAME="moboController">
    <OPTION> Don't Know</OPTION>
    <OPTION> ATA</OPTION>
    <OPTION> DMA</OPTION>
    <OPTION> SCSI</OPTION>
    <OPTION> Other</OPTION>
    </SELECT>
    <br>
    Other Specs:<br>&nbsp;&nbsp;<TEXTAREA NAME="moboOtherSpecs">
    </TEXTAREA><br>
    <CENTER>
    <INPUT TYPE="BUTTON" VALUE="ADD">
    </CENTER>

    </FORM>
    </FONT>
    </DIV>

    I know I forgot the values in the option tags... I'll have to fill them in. But I want it to put all the specs into a textarea at the bottom of the page each time they click add. Then send the contents of the textarea to me when they're done. I don't think my host will allow SMTP through PHP... I know they won't through their regular e-mail accounts. Would there be an exception for PHP? And if not, could I use a third party server?
    ~SiNa94~
    http://seducius.port5.com/
    "Stab...die!"

  • #7
    New Coder
    Join Date
    Sep 2003
    Posts
    59
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hello,

    If you do not have a domain hosted with us, you cannot have maiboxes hosted with us, therefore you cannot use e-mails to do this.
    Have a nice day.

    Best Regards,
    dibel
    :: add comment :: Saturday, 14 August 2004, 22:11:33 by sina94
    Is there any other way I could submit a form without registering a domain name?
    :: add comment :: Saturday, 14 August 2004, 22:10:13 by dibel
    Hello,

    In order to be able to use SMTP on this sever, you need to register a domain name, host it with us and then create mailboxes for it. Then you can use those mailboxes to submit forms through PHP.
    If you have any questions, don't hesitate to contact us.
    Have a nice day.

    Best Regards,
    dibel
    Asshole...
    ~SiNa94~
    http://seducius.port5.com/
    "Stab...die!"

  • #8
    Regular Coder
    Join Date
    Apr 2004
    Location
    Philadelphia
    Posts
    241
    Thanks
    2
    Thanked 5 Times in 5 Posts
    well if you wanna use PHP i suggest getting at ithium.net domain...only $10 a year also if your project is non-profit...krycek will probably host you for free....



  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •