Invite Form - Easiest method?

Discussion in 'Web Design and Development' started by Harmush, Nov 20, 2010.

  1. Harmush macrumors 6502a

    Harmush

    Joined:
    Sep 21, 2008
    Location:
    Liverpool
    #1
    Hey guys, i am doing some work for a church, mainly graphics but they have asked if i can make a little form for their site while i'm doing the graphics. I thouhgt i would give it a go but i can't get it to work.

    Basically what i need, in HTML/Javascript (something that doesnt require loads of support files, i'd like it to work within one page), is one textbox and one button.
    when someone enters an email address into the box and presses the button it sends a generic HTML email to that person, which can be stored on the sever. I don't know what the easiest way to do this is. I have some experience with simple visual basic, would that be an option?

    thanks for the help.
     
  2. Cabbit macrumors 68020

    Cabbit

    Joined:
    Jan 30, 2006
    Location:
    Scotland
    #2
    Does the server have PHP, ASPX, Java, Python, or Ruby support?

    If it has any of the above then it will be very easy to do once we know what you have access to.

    PHP is probably the most common and if you don't know how to check just make a file called info.php and include the following.

    PHP:
    <?php
    phpinfo
    ();
    If you get a return when you browse to that file you have PHP installed.
     
  3. Harmush thread starter macrumors 6502a

    Harmush

    Joined:
    Sep 21, 2008
    Location:
    Liverpool
    #3
    server does support PHP, and ASPX
     
  4. Cabbit macrumors 68020

    Cabbit

    Joined:
    Jan 30, 2006
    Location:
    Scotland
    #4
    Then it is really simple.

    mailer.php
    PHP:
    <?php
    if (isset($_GET["sendmail"])):
        
    $address $_POST["address"];
        
    $message "This is a email";
        
    mail($address'Email Subject'$message);
    else:
    ?>
    <form action="mailer.php?sendmail" method="post" >
        <input type="text" name="address" />
        <button type="submit">Send Email</button>
    </form>
    <?php endif; ?>
    You mite want to include some validation and test it, this is partly of memory but should work.
     
  5. Harmush thread starter macrumors 6502a

    Harmush

    Joined:
    Sep 21, 2008
    Location:
    Liverpool
    #5
    That is very simple and just what i was looking for! thank you.

    how would i edit it to send an email with a html file. so the email is a html email basically. not plain text.

    thank you very much.
     
  6. Harmush thread starter macrumors 6502a

    Harmush

    Joined:
    Sep 21, 2008
    Location:
    Liverpool

Share This Page