...

View Full Version : embedding php in html



sybil6
06-26-2010, 03:33 AM
hello
i am trying to embed a echo in a html page but i want to keep the html color syntax when doing it , right now i got this but it doesnt work:

<?php
$req=mysql_query("SELECT emails FROM in_emails WHERE emails_ee='1' AND emails_id='".$_COOKIE["rr"]."'");
if(mysql_num_rows($req) > 0 ){
echo ?>
<div class="tabs">
<ul class="tabNavigation">
<li><a href="#">menu</a></li>
<li><a href="#">menu</a></li>
<li><a href="#">menu</a></li>
</ul>

<div id="mon_compte">
<table>
<tr>
<td>
<label for="email1">
<b>E-mail</b> <SUP class="oblig">*</SUP><br>
<input type="text" name="email" id="email1" class="text" value="$email">
</label>
</td>
</tr>
<tr>
<td>
<label for="password1">
<b>Password</b> <SUP class="oblig">*</SUP><br>
<input type="text" name="password" id="password1" class="text" value="$password">
</label>
</td>
</tr>
</table>

</div>
<div id="mes_commandes">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

</div>
<div id="my_inrees">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim vezzzzzzzzzzzzzzzmco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</div>

</div><?php ; } ?>

mlseim
06-26-2010, 03:40 AM
EDIT:
Doh! I guess my idea didn't work either ...



<?php
$req=mysql_query("SELECT emails FROM in_emails WHERE emails_ee='1' AND emails_id='".$_COOKIE["rr"]."'");
if(mysql_num_rows($req) > 0 ){
?>
<div class="tabs">
<ul class="tabNavigation">
<li><a href="#">menu</a></li>
<li><a href="#">menu</a></li>
<li><a href="#">menu</a></li>
</ul>

<div id="mon_compte">
<table>
<tr>
<td>
<label for="email1">
<b>E-mail</b> <SUP class="oblig">*</SUP><br>
<input type="text" name="email" id="email1" class="text" value="$email">
</label>
</td>
</tr>
<tr>
<td>
<label for="password1">
<b>Password</b> <SUP class="oblig">*</SUP><br>
<input type="text" name="password" id="password1" class="text" value="$password">
</label>
</td>
</tr>
</table>

</div>
<div id="mes_commandes">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

</div>
<div id="my_inrees">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim vezzzzzzzzzzzzzzzmco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</div>

</div>
<?php } ?>

sybil6
06-26-2010, 11:12 AM
yes it works thanks.

<?php

$req=mysql_query("SELECT email FROM aa WHERE emailsaa='1' AND id='".$_COOKIE["aa"]."'");
if(mysql_num_rows($req) > 0 ){
?>
<div class="tabs">

</div>
<?php
}
?>

alstonwillman
06-30-2010, 12:08 PM
You just place your PHP start and end tags where you want to embed it, that's it.

To display a single value, you can use the condensed form, as in: <?=$pizza?> will output the contents of $pizza at the position it's placed.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum