PDA

View Full Version : Display gone crazy with PHP MySQL and DW Templates......


kona72
06-06-2006, 10:03 PM
I have created a site that using PHP and MySQL and used the template feature in DW. Have a look at one of the many pages in question...

http://www.greenmedics.com/login_employee.php

As you can see i am having a huge display problem with the right hand side and the bottom. I have it coded so that it will stretch to 90% and have made a number of these types of sites in the past but this one ...... AARRRRGGHH!!
even when i look at it in DW it looks fine but as soon as I upload it the display completely gets screwy!!

Here is the code for the page above....

<?php
include("include/admin_inc.php");

if($_REQUEST[flag]==1)
{
$sql="SELECT * FROM tbl_candidate WHERE username='$_REQUEST[username]' AND password='$_REQUEST[pass]'";
$result=mysql_query($sql);
if(mysql_num_rows($result)>0)
{
$row=mysql_fetch_array($result);
$_SESSION[username]=$_REQUEST[username];
$_SESSION[userid]=$row[candidate_id];
$_SESSION[user_logged_in]="loggedin";
header("location:employee_account.php?msg=You have been successfully logged in.");
exit;
}
else
{
$msg="Wrong username/password.";
}
}
?>
<html>
<head>

<title>Green Medics.com</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="stylesheet.css" rel="stylesheet" type="text/css">

</head>

<body>
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/green_medic_02.jpg">
<tr align="left" valign="top">
<td width="346">images/green_medic_01.jpg</td>
<td width="100%"></td>
<td width="367">images/green_medic_04.jpg</td>
</tr>
</table></td>
</tr>
<tr>
<td align="left" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/green_medic_06.jpg">
<tr align="left" valign="top">
<td width="16">images/green_medic_05.jpg</td>
<td width="100%" align="left" valign="middle" class="main_bold">Home (main.htm) | Candidates (employee_register.php) | Employers (employer_register.php) | Jobs (jobs.php) | Help | Contact Us</td>
<td width="100%" align="left" valign="middle" class="main_bold"><div align="right">Login (login.php) | Register (register.php) </div></td>
<td width="16">images/green_medic_08.jpg</td>
</tr>
</table></td>
</tr>
<tr>
<td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr align="left" valign="top">
<td width="16" background="images/green_medic_09.jpg">images/green_medic_09.jpg</td>
<td width="100%" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="10">
<tr align="left" valign="top" class="main_text">
<td width="23%">page_navigation</td>
<td width="77%">
<script language="JavaScript">
function chk()
{
if(document.frm.username.value=="")
{
alert("Please enter your username.");
document.frm.username.focus();
return false;
}
if(document.frm.pass.value=="")
{
alert("Please enter your password.");
document.frm.pass.focus();
return false;
}
return true;
}
</script>
<form name="frm" action="<?php echo $_SERVER[PHP_SELF]; ?>" method="post" onsubmit="return chk()">
<input type="hidden" name="flag" value="1">
<table width="100%" cellspacing="0" cellpadding="10" border="0">
<?php
if(isset($msg))
{
?>
<tr>
<td height="37" colspan="2">
<div align="center"><font color="#FF3300"><?php echo $msg; ?></font></div>
</td>
</tr>
<?php
}
?>
<tr>
<td height="37" colspan="2">
<div align="center">Employee Login</div>
</td>
</tr>
<tr>
<td width="50%">Username</td>
<td width="50%">
<input type="text" name="username">
</td>
</tr>
<tr>
<td width="50%">Password</td>
<td width="50%">
<input type="password" name="pass">
</td>
</tr>
<tr>
<td colspan="2">
<div align="center">
<input type="submit" name="Submit" value="Submit">
</div>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table> </td>
<td width="16" background="images/green_medic_11.jpg">images/green_medic_11.jpg</td>
</tr>
</table></td>
</tr>
<tr>
<td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr align="left" valign="top">
<td width="16">images/green_medic_13.jpg</td>
<td width="100%" height="15" background="images/green_medic_14.jpg" bgcolor="#84B25A"></td>
<td width="16">images/green_medic_16.jpg</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<span class="footer_text">&copy;2006 Green Medics.com

</span>
</body>
</html>

kona72
06-08-2006, 11:49 PM
Well since i didn't get any responses, i guess i have to answer my own question.
When building a dynamic website using PHP amd MySQL(or any combo of lang/DB) the traditional website layout is not the most efficeint way to go.
I have decided that the iste will be re-built using includes for the header content and footer to accomadate the various scripts and dynamically generated searched and items.

domedia
06-09-2006, 01:41 PM
hiya kona.
I work with the development of dynamic applications every day. It does set some limitations to layout/design etc. But we find if the designer has a full understanding of which areas are dynamic, it's usually not a problem.