error while moving from php to html
Posted: Tue Sep 27, 2005 5:31 am
i have just made a page which works with code
as it was displaying text in very pain thing i tried to format it as follows....
but it says there is error
Parse error: parse error in c:\program files\easyphp1-8\www\html\viewhtml.php on line 23
how it is done can any body copy code and show..
thanks for help
rami
Code: Select all
<?
session_start();
//require_once ('includes/config.inc');
require_once ('../mysql_connect1.php');
$page_title = 'view';
if (!isset($_SESSION['name'])) {
header ("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/login.php"); ob_end_clean();
exit();
} else
{
if (isset($_GET['uid']))
{
$query = "SELECT * FROM students WHERE user_id =". $_GET['uid']."";
$result= mysql_query($query);
if (mysql_num_rows($result) > 0)
{ // if there are any rows of data, fetch the data
$row = mysql_fetch_array ($result);
echo '<p>Name: ' . $row['name'] . '<br />';
echo '<p>Email: ' . $row['email'] . '<br />';
echo '<p>Address: ' . $row['address'] . '<br />';
}
else
{
echo '<p>No data returned!</p>';
} // mysql if end
}
else
{
echo '<p>Student not found.</p>';
}
}
/*else {
echo '<p>Missing uid!</p>';
}
*/
?>Code: Select all
if (isset($_GET['uid']))
{
$query = "SELECT * FROM students WHERE user_id =". $_GET['uid']."";
$result= mysql_query($query);
if (mysql_num_rows($result) > 0)
{
$row = mysql_fetch_array ($result);
<table border="1" width="100%">
<tr>
<td width="100%" colspan="2" bgcolor="#00659C"><font color="#FFFFFF"><b> Welcome
,</b></font></td>
</tr>
<tr>
<td width="72%" rowspan="4" valign="top">
<table border="1" width="100%" bgcolor="#EFEFEF" bordercolor="#FFFFFF">
<tr>
<td width="51%">echo '<p>Name: ' . $row['name'] . '<br />';</td>
<td width="49%" rowspan="3" bordercolor="#FFFFFF"> </td>
</tr>
<tr>
<td width="51%">echo '<p>Email: ' . $row['email'] . '<br />';</td>
</tr>
<tr>
<td width="51%">echo '<p>Address: ' . $row['address'] . '<br />';</td>
</tr>
</table>
</td>
<td width="28%" bgcolor="#00659C">
<p align="center"> <b><font color="#FFFFFF">Knowledge center</font></b></td>
</tr>
<tr>
<td width="28%"> </td>
</tr>
<tr>
<td width="28%" bgcolor="#00659C">
<p align="center"> <font color="#FFFFFF"><b>Status</b></font></td>
</tr>
<tr>
<td width="28%"> </td>
</tr>
</table>
}
else
{
echo '<p>NoParse error: parse error in c:\program files\easyphp1-8\www\html\viewhtml.php on line 23
how it is done can any body copy code and show..
thanks for help
rami