<b>how to display image by echo() in existing html code?</b>
Posted: Thu Dec 03, 2009 4:52 pm
hi to all,
i am using php code in existing html file with extenssion ".php" , it is not showing the images and css working. here i m putting some code for example,
Please guide me, how to display images and use css in php ??
---------------------
file name is data.php
<html>
<head>
<link rel="stylesheet" type="text/css" href="global.css">
note: CSS not woring
</head>
<body bgcolor="#DF6804">
<table align="center" border="0" cellpadding="0" cellspacing="0" width="1000">
<tr align="center">
<td colspan="7">
<img src="Images/header-new.jpg" alt="os-co header" />
note: image not displaying
</td>
</tr>
<tr class="top-nev-row" align="center">
<td width="14%" height="30"><a href="index.html">Home</a></td>
<td width="14%" height="30"><a href="mission.html">Mission Statement</a></td>
<td width="14%" height="30"><a href="processing.htm">Processing</a></td>
<td width="14%" height="30"><a href="products.htm">Products</a></td>
<td width="14%" height="30"><a href="">Contact us</a></td>
<td width="14%" height="30"><a href="">Query</a></td>
<td width="14%" height="30"><a href="">Login</a></td>
</tr>
<tr>
<td colspan="7" class="cont-content" valign="top" height="400">
<table align="center" width="100%" border="1" cellspacing="3" >
<tr bgcolor="#cccccc">
<td align="center"><strong>Date</strong></td>
<td align="center"><strong>Name</strong></td>
<td align="center"><strong>Email</strong></td>
<td align="center"><strong>Company</strong></td>
<td align="center"><strong>Country</strong></td>
<td align="center"><strong>Telephone</strong></td>
<td align="center"><strong>Fax</strong></td>
<td align="center"><strong>Mobile</strong></td>
<td align="center"><strong>Contact via</strong></td>
<td align="center"><strong>Query Detail</strong></td>
</tr>
<tr>
<?php
$con = mysql_connect("localhost","username","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("my_db", $con);
$result = mysql_query("SELECT * FROM query");
$name= mysql_query("SELECT name FROM members");
$pass= mysql_query("SELECT pass FROM members");
if("'$_POST[name]'==$name" && "'$_POST[pass]'==$pass")
{
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['date'] . "</td>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['email'] . "</td>";
echo "<td>" . $row['company'] . "</td>";
echo "<td>" . $row['country'] . "</td>";
echo "<td>" . $row['tel'] . "</td>";
echo "<td>" . $row['fax'] . "</td>";
echo "<td>" . $row['mob'] . "</td>";
echo "<td>" . $row['box'] . "</td>";
echo "<td>" . $row['query']."</td>";
echo "</tr>";
}
}/*if close*/
else
echo "Wrong Username or Password";
mysql_close($con);
?>
</tr>
</table>
</td>
</tr>
<tr align="center">
<td colspan="7" class="footer" align="center" height="30">
<p>Copyright © 2009-2012 All Rights Reserved.</p>
</td>
</tr>
</table>
</body>
</html>
-------------------------------------
Thanks
i am using php code in existing html file with extenssion ".php" , it is not showing the images and css working. here i m putting some code for example,
Please guide me, how to display images and use css in php ??
---------------------
file name is data.php
<html>
<head>
<link rel="stylesheet" type="text/css" href="global.css">
note: CSS not woring
</head>
<body bgcolor="#DF6804">
<table align="center" border="0" cellpadding="0" cellspacing="0" width="1000">
<tr align="center">
<td colspan="7">
<img src="Images/header-new.jpg" alt="os-co header" />
note: image not displaying
</td>
</tr>
<tr class="top-nev-row" align="center">
<td width="14%" height="30"><a href="index.html">Home</a></td>
<td width="14%" height="30"><a href="mission.html">Mission Statement</a></td>
<td width="14%" height="30"><a href="processing.htm">Processing</a></td>
<td width="14%" height="30"><a href="products.htm">Products</a></td>
<td width="14%" height="30"><a href="">Contact us</a></td>
<td width="14%" height="30"><a href="">Query</a></td>
<td width="14%" height="30"><a href="">Login</a></td>
</tr>
<tr>
<td colspan="7" class="cont-content" valign="top" height="400">
<table align="center" width="100%" border="1" cellspacing="3" >
<tr bgcolor="#cccccc">
<td align="center"><strong>Date</strong></td>
<td align="center"><strong>Name</strong></td>
<td align="center"><strong>Email</strong></td>
<td align="center"><strong>Company</strong></td>
<td align="center"><strong>Country</strong></td>
<td align="center"><strong>Telephone</strong></td>
<td align="center"><strong>Fax</strong></td>
<td align="center"><strong>Mobile</strong></td>
<td align="center"><strong>Contact via</strong></td>
<td align="center"><strong>Query Detail</strong></td>
</tr>
<tr>
<?php
$con = mysql_connect("localhost","username","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("my_db", $con);
$result = mysql_query("SELECT * FROM query");
$name= mysql_query("SELECT name FROM members");
$pass= mysql_query("SELECT pass FROM members");
if("'$_POST[name]'==$name" && "'$_POST[pass]'==$pass")
{
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['date'] . "</td>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['email'] . "</td>";
echo "<td>" . $row['company'] . "</td>";
echo "<td>" . $row['country'] . "</td>";
echo "<td>" . $row['tel'] . "</td>";
echo "<td>" . $row['fax'] . "</td>";
echo "<td>" . $row['mob'] . "</td>";
echo "<td>" . $row['box'] . "</td>";
echo "<td>" . $row['query']."</td>";
echo "</tr>";
}
}/*if close*/
else
echo "Wrong Username or Password";
mysql_close($con);
?>
</tr>
</table>
</td>
</tr>
<tr align="center">
<td colspan="7" class="footer" align="center" height="30">
<p>Copyright © 2009-2012 All Rights Reserved.</p>
</td>
</tr>
</table>
</body>
</html>
-------------------------------------
Thanks