Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jonnysods

macrumors G3
Original poster
Sep 20, 2006
8,797
7,458
There & Back Again
I need to place a widget/HTML snippet on an iWeb page that let's you type in your name and your friends email address to send them an invite/coupon, one thati can design.

I looked around, found some sites that you can create and insert forms etc.

Any ideas? Have you heard of anything like this?

Thanks!
 
That PHP script is cool. What I would really like to do though is be able to email someone a pdf or create a html coupon so that somebody could email it to a friend.

This would not allow me to do that. I guess I could point them to where the file is on the website?
 
PHP:
<?php
$to = $_GET['address'];
$subject = "Coupon";
$body = "Your coupon can be downloaded here: http://yoursite.com/downloadcupon.php";
if (mail($to, subject, $body)) {
    echo("<p>Message successfully sent!</p>");  
} else {
    echo("<p>Message delivery failed... Please enter an email address</p>");
}?>
HTML:
<form name="input" action="sendit.php" method="get"> <!-- replace sendit.php with the php script's filename -->
Email:
<input type="text" name="address" />
<input type="submit" value="Submit" />
</form>
 
I think you've got some syntax errors.


PHP:
<?php
$to = $_GET['address'];
$subject = "Coupon";
$body = "Your coupon can be downloaded <a href='http://yoursite.com/downloadcupon.php'>form here</a>";
if (mail($to, subject, $body)) {
    echo("<p>Message successfully sent!</p>");  
} else {
    echo("<p>Message delivery failed...</p>");
}?>
HTML:
<form name="input" action="sendit.php" method="get">
Email:
<input type="text" name="address" />
<input type="submit" value="Submit" />
</form>
 
I think you've got some syntax errors.

Yes, I forgot something. But it did work but it had a subject line showing 'subject'

Updated script:

PHP:
<?php
$to = $_GET['address'];
$subject = "Coupon";
$body = "Your coupon can be downloaded here: http://yoursite.com/downloadcupon.php";
if (mail($to, $subject, $body)) {
    echo("<p>Message successfully sent!</p>");  
} else {
    echo("<p>Message delivery failed... Please enter an email address</p>");
}?>
HTML:
<form name="input" action="sendit.php" method="get"> <!-- replace sendit.php with the php script's filename -->
Email:
<input type="text" name="address" />
<input type="submit" value="Submit" />
</form>

OP: who's your host? MobileMe does not support php if that is your host
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.