...

View Full Version : script doesn't merge with HTML



comicw
11-10-2002, 04:54 PM
Hi,

I want to install a tell a friend script on my site (as part of an html page)
I've renamed the page to .php , but the php script still overrules the layout (everything is shown correctly except the right-side javascript menu bar). Here's the PHP script, in the post below, I've posted the html code for the page!

Please help me out!!!



The PHP script:

<?php



// number of friend fields to put on the page
$tellnumber = "5";

// subject of email
$subject = "Beleggingsvisie: uitnodiging";

// Message sent in the email
$message = "Op www.beleggingsvisie.be vindt u een aparte kijk op beleggen, die bewezen heeft 6 jaar op rij succesvol te kunnen zijn. Neem dus beslist eens een kijkje";

// url to redirect user to once they click submit
$thankyouurl = "http://www.beleggingsvisie.be";





/////


if($submitform) {

$num=0;
while($num < $tellnumber) {
$num++;
$temail = "femail"."$num";
$tname = "fname"."$num";

if($$tname OR $$temail) {
if(!$$tname) {
$error .= "Missing Friends Name, Friend $num<BR>";
}
if(!$$temail) {
$error .= "Missing Friends Email, Friend $num<BR>";
}

}
if($$temail) {
if(!ereg("@",$$temail)) { $error .= "Invalid Email Address, Friend $num<BR>"; }
if(!ereg("\.",$$temail)) { $error .= "Invalid Email Address, Friend $num<BR>"; }
}
}
if(!$tname) {
$error .= "Missing your name<BR>";
}
if(!ereg("@",$email)) { $error .= "Invalid Email Address<BR>"; }
if(!ereg("\.",$email)) { $error .= "Invalid Email Address<BR>"; }

if($error) {
?>
<P><CENTER><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
<TD WIDTH="50%" BGCOLOR="#0033CC">
<TABLE WIDTH="400" BORDER="0" CELLSPACING="1" CELLPADDING="2">
<TR>
<TD WIDTH="26%" BGCOLOR="#0033CC">
<B><FONT COLOR="#ffffff" SIZE="-1" FACE="Tahoma">Error</FONT></B></TD>
</TR>
<TR>
<TD WIDTH="26%" BGCOLOR="#ffffff">
<FONT COLOR="#000000" SIZE="-1" FACE="Tahoma"><?php echo $error; ?></FONT></TD>
</TR>
</TABLE></TD>
</TR>
</TABLE></CENTER>
</BODY></HTML>
<?php
exit();
}


$num=0;
while($num < $tellnumber) {
$num++;
$temail = "femail"."$num";
$tname = "fname"."$num";
$then = $$tname;
if($$temail AND $$tname) {
mail($$temail,"$subject","
$then,

$message

Met vriendelijke groeten,
$name



","From: $name <$email>");

$youremail = "visie@beleggingsvisie.be";
$yoursubject = "Tell a friend werd gebruikt door: $name";
$yourmessage = "Tell a friend werd gebruikt door: $name
Friends email: $temail
Zenders email: $email
Zenders name: $name
Verzonden boodschap: $message";
$reply = "Van: $youremail";
mail($youremail,$yoursubject,$yourmessage,$reply);


}

}


exit();

} else {

$num=0;
while($num < $tellnumber) {
$num++;
$theboxes .= " <TR>
<TD WIDTH=\"49%\" BGCOLOR=\"#0033CC\">
<P><CENTER><B><FONT COLOR=\"#FFFFFF\" SIZE=\"-1\" FACE=\"Verdana\">$num</FONT></B></CENTER></TD>
<TD WIDTH=\"26%\" BGCOLOR=\"#0033CC\">
<P><CENTER><INPUT NAME=\"fname$num\" TYPE=\"text\" SIZE=\"25\"></CENTER></TD>
<TD WIDTH=\"25%\" BGCOLOR=\"#0033CC\">
<INPUT NAME=\"femail$num\" TYPE=\"text\" SIZE=\"25\">
</TD>
</TR>";
}


?>
<P><CENTER><FONT FACE="Verdana" color="#0033CC" size="2"><B>Tell a friend</B></FONT></CENTER></P>
<FORM ACTION="tellfriend.php" METHOD="POST"><P><CENTER><TABLE BORDER="0" CELLSPACING="0"
CELLPADDING="0">
<TR>
<TD width= "60%" BGCOLOR="#0033CC">
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="2">
<TR>
<TD WIDTH="25%" BGCOLOR="#0033CC">
<P><CENTER><B><FONT COLOR="#FFFFFF" SIZE="-1" FACE="Tahoma">Uw naam</FONT></B></CENTER></TD>
<TD WIDTH="25%">
<P><CENTER><B><FONT COLOR="#FFFFFF" SIZE="-1" FACE="Tahoma">Uw e-mail</FONT></B></CENTER></TD>
</TR>
<TR>
<TD WIDTH="25%" BGCOLOR="#0033CC">
<P><CENTER><INPUT NAME="name" TYPE="text" SIZE="25"></CENTER></TD>
<TD WIDTH="25%" BGCOLOR="#0033CC">
<INPUT NAME="email" TYPE="text" SIZE="25">
</TD>
</TR>
</TABLE></TD>
</TR>
</TABLE></CENTER></P><P><CENTER><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
<TD width="60%" BGCOLOR="#0033CC">
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="2">
<TR>
<TD WIDTH="50%" BGCOLOR="#0033CC"></TD>
<TD WIDTH="25%" BGCOLOR="#0033CC">
<P><CENTER><B><FONT COLOR="#FFFFFF" SIZE="-1" FACE="Tahoma">Uw vriend</FONT></B></CENTER></TD>
<TD WIDTH="25%">
<P><CENTER><B><FONT COLOR="#FFFFFF" SIZE="-1" FACE="Tahoma">Zijn e-mail</FONT></B></CENTER></TD>
</TR><?php echo $theboxes; ?></TABLE></TD>
</TR>
</TABLE></CENTER></P>
<P><CENTER><INPUT NAME="submitform" TYPE="submit" VALUE="Verzenden"></CENTER></FORM>
</BODY></HTML>
<?php
exit();

}

?>

comicw
11-10-2002, 04:55 PM
The HTML code for the page on which the php script should appear.

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Tell a Friend</title>

<style type="text/css">
<!--
.menu {font-family:Verdana; font-weight: bold; text-align:right}

.menu a{text-decoration:none; color: white; font-size: 8pt}
-->
A.text:link {font-family: "Tahoma"; color: #003399; font-size: 10pt}
A.text:visited {font-family: "Tahoma"; color: #003399; font-size: 10pt}
A.text:hover {font-family: "Tahoma"; color: #0099CC; font-size: 10pt}
A.text:active {font-family: "Tahoma"; color: #003399; font-size: 10pt}

A.blad:link {font-family: "Tahoma"; color: #003399; font-size: 10pt; text-decoration: none}
A.blad:visited {font-family: "Tahoma"; color: #003399; font-size: 10pt; text-decoration: none}
A.blad:hover {font-family: "Tahoma"; color: #0099CC; font-size: 10pt; text-decoration: none}
A.blad:active {font-family: "Tahoma"; color: #003399; font-size: 10pt; text-decoration: none}

A.pf:link {font-family: "Tahoma"; color: #000000; font-size: 10pt}
A.pf:visited {font-family: "Tahoma"; color: #000000; font-size: 10pt}
A.pf:hover {font-family: "Tahoma"; color: #0099FF; font-size: 10pt}
A.pf:active {font-family: "Tahoma"; color: #000000; font-size: 10pt}

P.txt {font-family: "Tahoma"; font-size: 10pt; text-align: justify}

Body {scrollbar-3dlight-color : #D2E6FA; scrollbar-arrow-color : #D2E6FA; scrollbar-base-color : #D2E6FA;
scrollbar-darkshadow-color : #D2E6FA; scrollbar-face-color : #0033CC; scrollbar-highlight-color : #0033CC;
scrollbar-shadow-color : #D2E6FA; scrollbar-track-color : #D2E6FA}


</style>
<script language="javascript">
<!--

function movein(which,html){
which.style.background="#C0C0C0"
if (document.getElementById)
document.getElementById("boxdescription").innerHTML=html
else
boxdescription.innerHTML=html
}

function moveout(which){
which.style.background='#0033CC'
if (document.getElementById)
document.getElementById("boxdescription").innerHTML=' '
else
boxdescription.innerHTML=' '
}

//-->
</script>

</head>



<body bgcolor="#EBEBEB">

<table bgcolor="#FFFFFF" width="100%" cellspacing="0" cellpadding="0" border="1" bordercolor="#000000">
<tr>
<td>

<table width="100%" bgcolor="#FFFFFF" cellspacing="5" cellpadding="0">
<tr>
<td>
<table align="center" cellspacing="0" cellpadding="0">
<tr>
<td>
<img border="0" src="images/BVLbig.gif" align="center" width="533" height="66">
</td>
</tr>
</table>
</td>
</tr>
</table>

<table bgcolor="#FFFFFF" width="100%" cellspacing="0" cellpadding="0" height="100">
<tr>
<td>
</td>
</tr>
</table>

<table bgcolor="#FFFFFF" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="2%">
</td>
<td width="77%" valign="top" bgcolor="#D2E6FA">
<table width="98%" align="center" valign="top" bgcolor="#D2E6FA">
<tr>
<td>
<font face="Tahoma" size="2">Breng uw vrienden, kennissen of collega's op de
hoogte van ons bestaan.</font><br><br><br clear="all">

<br>
<br>
<br>
<table align="center">
<tr>
<td>
<?php include("tellfriend1.php"); ?>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td width="2%"></td>
<td valign=top width="19%" bgcolor="#0033CC">
<table align="right" bgcolor="#0033CC">
<tr>
<td>
<table bgcolor="#0033CC" cellpadding="3" cellspacing="0" width="180">
<tr>
<td class="menu" bordercolor="#0099CC" id="choice1" ; cursor:hand" onmouseover="movein(this,'Beginpagina')" onmouseout="moveout(this)">
<a href="index.htm">Home</a></td></tr>
<td class="menu" bordercolor=""0099CC" id="choice2" ; cursor:hand" onmouseover="movein(this,'Wordt nu lid!')" onmouseout="moveout(this)">
<a href="leden.htm">Leden</a></td></tr>
<tr>
<td class="menu" bordercolor="#0099CC" id="choice3" ; cursor:hand" onmouseover="movein(this,'Onze gids')" onmouseout="moveout(this)">
<a href="elliott_wave.htm">Elliott Wave</a></td></tr>
<tr>
<td class="menu" bordercolor="#0099CC" id="choice4" ; cursor:hand" onmouseover="movein(this,'Een gesprekspartner')" onmouseout="moveout(this)">
<a href="persoonlijke_begeleiding.htm">Persoonlijke Begeleiding</a></td></tr>
<tr>
<td class="menu" bordercolor="#0099CC" id="choice5" ; cursor:hand" onmouseover="movein(this,'Vertel het verder')" onmouseout="moveout(this)">
<a href="tell_a_friend.htm">Tell a Friend</a></td></tr>
<tr>
<td class="menu" bordercolor="#0099CC" id="choice6"; cursor:hand" onmouseover="movein(this,'Plannen')" onmouseout="moveout(this)">
<a href="hedge_fund.htm">Hedge Fund</a></td></tr>
<tr>
<td class="menu" bordercolor="#0099CC" id="choice5" ; cursor:hand" onmouseover="movein(this,'Resultaten!')" onmouseout="moveout(this)">
<a href="portefeuille.htm">Portefeuille</a></td></tr>
<tr>
<td class="menu" bordercolor="#0099CC" id="choice6" ; cursor:hand" onmouseover="movein(this,'Het bewijs')" onmouseout="moveout(this)">
<a href="voorbeelden.htm">Voorbeelden</a></td></tr>
<tr>
<td class="menu" bordercolor="#0099CC" id="choice7" ; cursor:hand" onmouseover="movein(this,'Abonnementen en adres')" onmouseout="moveout(this)">
<a href="contact.htm">Contact</a></td></tr>
<tr>
<td bordercolor="#0033CC" bgcolor="white" height="18" align="center"><b><font id="boxdescription" face="Verdana" color="#000000" size="1"></font></b></td></tr>
</table>

<table align="center" bgcolor="#0033CC">
<tr>
<td>
</td>
</tr>
</table>
</td>
</tr>
</table>

</td>
</tr>
</table>

<table bgcolor="#FFFFFF" width="100%" cellspacing="0" cellpadding="0" height="20">
<tr>
<td>
</td>
</tr>
</table>

</td>
</tr>
</table>

</body>

</html>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum