WEB Help me with a simple form!

Discussion in 'OT Technology' started by dmora, Dec 20, 2007.

  1. dmora

    dmora Guest

    :run:

    I'm having trouble figuring out how to make a form just send the results to an email recipient, with out it opening a mail client to send the mail.

    And if thats the only option, how do i format the form results to include returns, instead of jsut going all the way across, off the end of the page.
     
  2. retorq

    retorq What up bitch??

    Joined:
    Dec 14, 2006
    Messages:
    6,061
    Likes Received:
    0
    Location:
    Mohave Desert
    Why do you want to send it thru email?? That's old school stuff now a days.
     
  3. dmora

    dmora Guest

    because the system is that fucking antiquated and i dont want to learn how to make a DB.
     
  4. hurleyint1386

    hurleyint1386 Someone has sand in their vagina

    Joined:
    Jan 6, 2005
    Messages:
    3,687
    Likes Received:
    0
    Location:
    Rochester, NY
    I'm pretty sure that you would need to have a programming language (i.e. PHP/ASP) with an smtp server to send mail with out having them open it with their default mail client. So if you don't really have the knowledge to do that, it might be difficult
     
  5. noon

    noon get high and teach me how to listen

    Joined:
    May 4, 2002
    Messages:
    3,384
    Likes Received:
    0
    Location:
    Lawrence, KS
    yep, you do. if you have PHP I'll set it up for you, pm me
     
  6. dmora

    dmora Guest

    :wtc:

    This system they use is just BASIC html. PHP blows it up. CSS is even a little shakey. This thing was implemented when Mosaic was the browster of choice. :eek4:
     
  7. ez4me2c3d

    ez4me2c3d Cold Member

    Joined:
    Sep 19, 2003
    Messages:
    1,836
    Likes Received:
    0
    Location:
    Minneapolis, MN
    well to answer your question about carriage returns

    mailto:[email protected]?subject=Check%20This%20Out&body=Line%201%0DLine%202

    So the key thing there is the %0D which is hex for the return key (ASCII Character Code 13)
     
  8. philvia

    philvia SUCKIN ON MY TITTIES LIKE YOU WANTIN ME CALLIN ME

    Joined:
    May 3, 2007
    Messages:
    11,619
    Likes Received:
    0
    Location:
    NYC
    mail($email,$formshit);
     
  9. Slid.

    Slid. I'm a guy.

    Joined:
    Oct 25, 2001
    Messages:
    1,928
    Likes Received:
    0
    Location:
    NH
    you could host a php script on another server and submit the data there :hs:

    <form action="http://www.someotherserver.com/submitForm.php">
     
  10. ez4me2c3d

    ez4me2c3d Cold Member

    Joined:
    Sep 19, 2003
    Messages:
    1,836
    Likes Received:
    0
    Location:
    Minneapolis, MN
    This is the best option. Then have the php script redirect back to a success.html or failure.html on the referring server.
     
  11. dmora

    dmora Guest

    Would i have to set
    Code:
    body=line%201, 2, 3, 4, etc
    for every line of the form? or am i confused?

    Tell me moar? :o
     
  12. Slid.

    Slid. I'm a guy.

    Joined:
    Oct 25, 2001
    Messages:
    1,928
    Likes Received:
    0
    Location:
    NH
    If you have access to another web server (that has PHP) then you can make a remote "call" to it and dump the form data and have it send the email. If you don't have another server you could use a $4.95/mo hostgator server (http://www.hostgator.com/shared.shtml).

    Current Server:
    -customer fills out form, submits it
    -the form contacts the other server and ...
    Other Server:
    -takes the form data, drops it into an email and sends it off
    -redirects the customer to the original server (thanks.htm)

    This is the cleanest way to do it if you have absolutely no access to PHP (or Perl) on your current server. It'd be seamless to the user. Popping up a mail client is gaudy.

    --

    For example. Say that the company I work for has a shitty server like yours and doesn't want to upgrade. I'd make a page at http://www.shittyCompany.com/contactForm.htm with the form and then have it submit to my personal server (linksling.com) at http://www.linksling.com/shittyCompanyMailer.php. It'd work just as if I had PHP on my shitty server.

    --

    If you have another server available to you or decide to do the hostgator (or whatever) thing then anyone who knows php could help you.

    shittyCompanyMailer.php:
    Code:
    <?
    
      $formData = print_r($_REQUEST, true);
      mail([email protected]','i has a mail',$formData);
    
    ?>
    
     
    Last edited: Dec 27, 2007
  13. dmora

    dmora Guest

    :bowdown: I got it working!
    Sort of. I need an intermediate page that says, Success, and tells them to close the window or something.
     
  14. Slid.

    Slid. I'm a guy.

    Joined:
    Oct 25, 2001
    Messages:
    1,928
    Likes Received:
    0
    Location:
    NH
    Add

    Code:
    header('Location: http://www.originalDomain.com/thanksPage.htm');
    
    after the mail line in the script.

    Code:
    <?
    
      $formData = print_r($_REQUEST, true);
      mail([email protected]','i has a mail',$formData);
    
      header('Location: http://www.originalDomain.com/thanksPage.htm');
    
    ?>
    
    that'll redirect them to whatever page you give it after it sends the email.
     
  15. dmora

    dmora Guest

    I get this error

    Code:
    Warning: Cannot modify header information - headers already sent by (output started at /home/dmoracom/public_html/submitForm.php:7) in /home/dmoracom/public_html/submitForm.php on line 12
     
  16. crazybenf

    crazybenf Active Member

    Joined:
    Nov 14, 2001
    Messages:
    15,575
    Likes Received:
    2
    make sure theres no html above the first <? also make sure there isn't a space or blank line.
     
  17. dmora

    dmora Guest

    so remove the space between the 2 lines?

    Code:
    <?
    
      $formData = print_r($_REQUEST, true);
      mail([email protected]','i has a mail',$formData);
      header('Location: http://www.originalDomain.com/thanksPage.htm');
    
    ?>
     
  18. crazybenf

    crazybenf Active Member

    Joined:
    Nov 14, 2001
    Messages:
    15,575
    Likes Received:
    2
    no, i was referring to above the first <?


    make sure there are no line or html content above the <?
     
  19. Slid.

    Slid. I'm a guy.

    Joined:
    Oct 25, 2001
    Messages:
    1,928
    Likes Received:
    0
    Location:
    NH
    Try:

    Code:
    <?
    
      $formData = print_r($_REQUEST, true);
      mail([email protected]','i has a mail',$formData);
    
    ?>
    <meta http-equiv="refresh" content="0;url=http://www.originalDomain.com/thanksPage.htm">
    
    There will be a slight delay on the redirect compared to the "header" line but you won't get that error.
     
  20. dmora

    dmora Guest

    that fixed it. :bowdown: there was HTML shit above it.
     
  21. crazybenf

    crazybenf Active Member

    Joined:
    Nov 14, 2001
    Messages:
    15,575
    Likes Received:
    2
    Can't send headers twice. ;)
     

Share This Page