hoachen
08-04-2005, 11:09 AM
I am trying to write a php code that will send the data to my email account. The checkbox is write in basic html. When I selected checkbox(es) and press submit botton it will show the checkbox that I selected or "YES" and those selection will be a hyperlink that will link to other page when they click it. How to I do that? Currently I just can list it as regular text not a hyperlink. Code are list below. Right now, when I press submit it just show the successfully submited and no listing of what I have checked on the checkbox.
HTML
<input type="checkbox" name="AAA" value="AAA">AAA
<input type="checkbox" name="BBB" value="BBB"> BBB<br>
<input type="checkbox" name="CCC" value="CCC">CCC
<input type="checkbox" name="DDD" value="DDD">DDD
PHP (This part is o.k I get it on my email)
$AAA=($_POST[AAA])?"AAA: Yes":"AAA: No";
$BBB=($_POST[BBB])?"BBB: Yes":"BBB: No";
$CCC=($_POST[CCC])?"CCC: Yes":"CCC: No";
$DDD=($_POST[CCC])?"DDD: Yes":"DDD: No";
$Message.="\nArticle(s) Selected: \n\t$AAA\n\t$BBB\n\t$CCC\n\";
After press the submit botton it will display the checkboxes that are checked with hyperlink and when click on the hyperlink it will bring you to the specify site
((This part is not working)
if($AAA=="Yes")
{
echo "<a href=http://www.google.com/search?hl=en&q=flower>AAA</a>";
}
elseif($BBB=="YES")
{
echo "<a href="http://www.FTD.COM>BBB</a>";
}
elseif($CCC=="YES")
{
echo "<a href=http://www.whiteflowerfarm.com/ >CCC</a>";
}
elseif($DDD=="YES")
{
echo "<a href=www.flower.com/ >DDD</a>";
}
else
{}
OUTPUT after submitted should look like this
If i selected AAA, CCC. Those I am not select will not display
AAA<br>
CCC
HTML
<input type="checkbox" name="AAA" value="AAA">AAA
<input type="checkbox" name="BBB" value="BBB"> BBB<br>
<input type="checkbox" name="CCC" value="CCC">CCC
<input type="checkbox" name="DDD" value="DDD">DDD
PHP (This part is o.k I get it on my email)
$AAA=($_POST[AAA])?"AAA: Yes":"AAA: No";
$BBB=($_POST[BBB])?"BBB: Yes":"BBB: No";
$CCC=($_POST[CCC])?"CCC: Yes":"CCC: No";
$DDD=($_POST[CCC])?"DDD: Yes":"DDD: No";
$Message.="\nArticle(s) Selected: \n\t$AAA\n\t$BBB\n\t$CCC\n\";
After press the submit botton it will display the checkboxes that are checked with hyperlink and when click on the hyperlink it will bring you to the specify site
((This part is not working)
if($AAA=="Yes")
{
echo "<a href=http://www.google.com/search?hl=en&q=flower>AAA</a>";
}
elseif($BBB=="YES")
{
echo "<a href="http://www.FTD.COM>BBB</a>";
}
elseif($CCC=="YES")
{
echo "<a href=http://www.whiteflowerfarm.com/ >CCC</a>";
}
elseif($DDD=="YES")
{
echo "<a href=www.flower.com/ >DDD</a>";
}
else
{}
OUTPUT after submitted should look like this
If i selected AAA, CCC. Those I am not select will not display
AAA<br>
CCC
