that variable stores all the html/php content I got stored in my Mysql table.
Anyway thanks i solved it and it works fine π
If U wanna know how I did acomplis that, let me know it was something really silly I couldn't figure out. The problem was on the syntax I was using inside de MySql table. If u ever need to pass and get variables with eval throug MySql NEVER use the "<?", "?>" tags inside the html, jus do this
------MySql Table-------
<html>
<body>
...html code here....
' . $variable . ' //php variables
....html code ....
</body>
</html>
----------php script ----
function setMessage($some_variable)
//get u'r variables using http_post
{
$sMsg = "";
connect(CONST_S_Dπ;
$query="select *
from forms
where (Formu=$formId)";
//if u have many diffrent forms, u'll need to asign an id for each
$form=executeQuery($query);
//the next two lines get the results from Mysql where I have
//predefined the subject of the mail and the text or body which
//is an html body
$this->subject.=$form[0]["MailSubj"];
$menSinFormato=$form[0]["MailText"];
//This means msg without format
eval("\$this->body = \"$menSinFormato\";");
//and the eval goes like this, we all know this format
}
then u just gotta use the common mail function including the proper headers to send html
function sendMessage(){
//headers
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers.="From: me <localhost>\r\n";
$headers.=$this->mailCC;
mail($this->mailTo,$this->subject,$this->body,$headers);
}
The html code stored in my data base is something like this:
<html>
<body>
<table width="686" border="0" cellpadding="0" cellspacing="0" bordercolor="#000000">
<tr>
<td height="1" align="Right" nowrap class="Menu1"><div align="left"></div></td>
<td bgcolor="#DDE2BB" height="1"></td>
</tr>
<tr>
<td height="4" align="Right" nowrap class="Menu1"><div align="left"></div></td>
<td bgcolor="#FAFAF4" height="4"></td>
</tr>
<tr>
<td width="161" height="13" nowrap bgcolor="#DDE2BB"><div align="left"></div></td>
<td width="514" bgcolor="#DDE2BB" height="13"> <p class="Texto5bold">USR ID</td>
</tr>
<tr>
<td width="161" height="26" nowrap> <p align="left" class="Texto5"><u>Last
Name </u></td>
<td width="514" height="26">
' . $last. ' //THIS IS HOW I GET THE VARIABLES
</tr>
<tr>
<td width="161" height="18" align="Right" nowrap class="Texto5"> <div align="left"><u>Name</u></div></td>
<td width="514" height="18">' . $name . ' </td>
</tr>
<tr>
<td height="13" colspan="2" nowrap><div align="left"></div></td>
</tr>
</table>
</body>
</html>
I still didn't experiment with if, then , while and so on..
It's surely different and it will be on another pΓ²st π