Jump to content

php in html


jagguy

Recommended Posts

How do I embed php in html as this deosn't work, but it does work in a php script with no html in the same directory.

[code]

</head>
<body bgcolor="#ffffff"><?php $dbhost ="" 'localhost';

$conn = mysql_connect($dbhost,'root','') ;


$dbname = 'petstore';
mysql_select_db($dbname);


$query="select * from species";
$rt=mysql_query($query);

while($nt=mysql_fetch_array($rt))
{
echo "$nt[id] $nt[species] <br>";   
}


?>



</body>
</html>
[/code]
Link to comment
Share on other sites

you can use CSS, javascript or any other client side technology on them after they've been retrieved via PHP. keep in mind that the browser [i]only sees[/i] what PHP feeds it, so when you generate your markup, just output classes and IDs as you want them to be for your CSS layout.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.