How can I include this code as it is and then upload it to my database and in the database there should be variables and not strings?
CODE:
$username1 = $_SESSION['myusername'];
$sql = mysql_query("SELECT * FROM `members` WHERE `username`='$username1'");
while($row=mysql_fetch_array($sql)) {
$replytext = '<table cellpadding="0" cellspacing="0" border="0"><tr><td rowspan="10" class="teamimage" style="background-image: url(images/usericons/'.$row['img'].');"><div style="background-image:url(images/teamicons_shadow.png); width: 75px; height: 75px;"></div></td></tr><tr valign="top"><td rowspan="10" style="width:10px;"></td><td style="width:300px;"><table cellpadding="0" cellspacing="0" border="0" style="margin:0px; padding:0px;"><tr><td class="teamname"><b><a href="teams.php?user='.$row['id'].'">'.$row['username'].'</a></b></td></tr><tr><td>Summoner Name: '.$row['summonername'].'</td></tr><tr><td style="border-bottom: 1px solid #888; padding-bottom: 5px;">Clan: '.$row['clan'].'</td></tr><tr><td style="color: #888; padding-top: 3px;">Country: '.$row['country'].'</td></tr><tr><td style="color: #888; padding-top: 3px;">Joined In: '.$row['created'].'</td></tr></table></td><td style="width:10px;"></td><td rowspan="10" style="border: 1px solid #aaa; padding: 3px; width:600px;">'.$replytext.'</td></tr></table>';
}
CODE IN DATABASE
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td rowspan="10" class="teamimage"
style="background-image: url(images/teamicons/default_user.png);">
<div
style="background-image:url(images/teamicons_shadow.png);
width: 75px; height: 75px;">
</div>
</td>
</tr>
<tr valign="top">
<td rowspan="10" style="width:10px;">
</td>
<td style="width:300px;">
Please note that the code I explained before is the one inside of $replytext!
If I understand you right , you want that the code in the database will be:
Another solution is to have a unique char that won’t make php think it’s a variable.
For instance change the:
to
and when you pull this code from the database use a simple str_replace to replace the ###
symbol with $.
Of course you need to have a unique char , if you are using a simple char like “a” , it will change all the “a” chars in your code to $ … not a very good idea.