新手提个问:怎么把php的变量赋值到html里
我绝对是菜鸟,0起点,来帮帮我吧,自己用的。
<div align="left"><br /> <h1 align="center"> </h1><br /> <h1 align="center"><strong>这里放个变量$data</strong></h1><br /> <p align="center"> </p><br /></div><br /><?php<br />...这里连接数据库<br />$data=xxx<br />?>
<br /><?php<br />...这里连接数据库<br />$data=xxx<br />?><br /><div align="left"><br /> <h1 align="center"> </h1><br /> <h1 align="center"><strong><?php var_dump($data)?></strong></h1><br /> <p align="center"> </p><br /></div><br />
<br /><?php<br />...这里连接数据库<br />$result = mysql_query($sql);<br />?><br /><div align="left"><br /> <h1 align="center"> </h1><br /><?php<br /> while($data = mysql_fetch_assoc($res)){<br />?><br /> <h1 align="center"><strong>这里放个变量<?php echo $data['xxx']?></strong></h1><br /><?php<br />}<br />?><br /> <p align="center"> </p><br /></div><br /><br />