Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > javascript(?) help

javascript(?) help
Thread Tools
Professional Poster
Join Date: May 1999
Location: New York City
Status: Offline
Reply With Quote
Sep 11, 2007, 12:10 PM
 
hello

i need to add a simple "sign up for our newsletter" /email thing to a client's website

see this example http://java-scripts.net/ left collumn bottom

i've search a lot of javascript sites and i don't know what this is called

anyways if you know of a simple way to do this, it would be great

thanks
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Sep 11, 2007, 12:27 PM
 
Javascript wouldn't be right for this — it works mainly on the client side. PHP would be the right choice. If you search on Google, you'll find several tutorials and sample code for mail-sending scripts. A basic template would be something like this:

(on the HTML page)
[codex]
<form action="sendmail.php" method="post">
<input type="text" name="address" value="Enter your e-mail"></input>
<input type="submit"></input>
</form>
[/codex]

(in sendmail.php)
[codex]<?php
$address = stripslashes($_REQUEST['address']);
mail('youremail@example.com',"Mailing list signup","$address would like to sign up for the mailing list");
echo "Thank you for signing up!";
?>[/codex]

You'll want a little more than that (e.g., an actual page that redirects them back to your site instead of just "Thank you for signing up!"), but that's the basic form of it.
(Last edited by Chuckit; Sep 11, 2007 at 12:39 PM. )
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Professional Poster
Join Date: May 1999
Location: New York City
Status: Offline
Reply With Quote
Sep 11, 2007, 01:41 PM
 
thanks chuckit!
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:32 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2