Reply to "send to a friend" script

Your name:

Reply:


Posted by shybe on 11/28/07 20:57

Ok,

Im trying to create a "send this article to a friend" script for my
blog,

Right now its sending all the articles,

but I want it to only send the article in which the form is attached
to.

here is my code:

<?php
$to_email = $_POST['maily'];
$art = $GLOBALS['thisarticle']['thisid'];
$submitted = $_POST['submitted'][$art];
$suby = $_POST['submitted'];
$from_email = $_POST['from'];
$subject = 'yeah';
$headers = "From:{$from_email}" ;
$message = 'You have been sent a story from The Trumpet
Group'."\n".' http://www.trumpetgroup.com/index.php?id='.$GLOBALS['thisarticle']['thisid'].'.com';


echo $submitted;

if($submitted)
{
mail($to_email, $subject, $message, $headers );
echo "This story has been sent";
}

?>

here is my form:

<form method="post" action="<?php $_SERVER['PHP SELF'];?>">
From: <input class="putty" type="text" name="from">
To: <input class="putty" type="text" name="maily">
<input class="send" type="submit" name="submitted<txp:article_id />">
</form>

Any help would be appreciated

thanks in advanced,
shybe

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация