I grab id, perso, perso_url from a database. But I need to convert the perso_url information in a hyperlink on the web page.
I use html template to adjust the HTML page.
Here is the profil.php page and after I am showing a portion of the html pages. Is there a way to convert my perso_url data into an URL, so it become clickable ๐
<?php
include "template.inc";
$db = mysql_connect('HOST','USER','PASS');
mysql_select_db('DATABASE',$db);
$sql = 'SELECT id,perso,perso_url FROM flq_tbl';
$req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());
//3
$tpl = new template("gabarits");
$tpl->set_file("gliste","profil1.html");
//4
$tpl->set_block('gliste','liste_clients','liste_bloc');
//5
while($data = mysql_fetch_array($req)) {
//6
$tpl->set_var("id", $data['id']);
$tpl->set_var("perso", $data['perso']);
$tpl->set_var("perso_url", $data['perso_url']);
//7
$tpl->parse('liste_bloc','liste_clients',true);
}
//8
mysql_close();
//9
$tpl->pparse("affichage","gliste");
?>
Codes form the HTML page ( template )
<tr>
<td width="51"><font face="Verdana" size="2" color="#00FFFF" >Numero</font></td>
<td width="153"><font face="Verdana" size="2" color="#00FFFF" ><b>Perso</b></font></td>
<td width="354"><font face="Verdana" size="2" color="#00FFFF" >page perso</font></td>
</tr>
<!-- BEGIN liste_clients -->
<tr>
<td width="51"><font face="Verdana" size="2" >{id}</font></td>
<td width="153"><font face="Verdana" size="2" ><b>{perso}</b></font></td>
<td width="354"><font face="Verdana" size="2" >{perso_url}</font></td>
</tr>
<!-- END liste_clients -->
Thank you