PHP code breaks
-
I’ve got some PHP code that was written for a site. bradentonpress.com
it is not working correctly. can anyone take a look at the code and tell me if anything is wrong?here is the code
<?php
//login script;
require(‘connect.php’);
$query=”SELECT id, firstname, lastname from login where email=’$login’ and password=’$password'”;
$result=@mysql_query ($query);$row=mysql_fetch_array($result);
$clientid=$row[‘id’];
$firstname=$row[‘firstname’];
$lastname = $row[‘lastname’];mysql_close();
//set the cookie
if (!empty($firstname)) {
setcookie (‘id’,$clientid);
setcookie (‘firstname’,$firstname);
setcookie (‘lastname’,$lastname);
//now redirect the pag, so the cookie becomes active
header(‘Location: login3.php’);} else {require(‘header.php’);
require(‘nologin.php’);
require(‘footers.php’);
end;
}
require(‘header.php’);
?><html>
<head><title>Bradenton Press Leaders in Quality Printing, Copying and Design in Bradenton</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
<link href=”styles.css” rel=”stylesheet” type=”text/css”>
</head><body>
<p class=”Links”></p>
<table width=”80%” border=”0″ cellspacing=”0″ cellpadding=”5″>
<tr>
<td width=”30%” valign=”top”><p align=”center” class=”Headline”>Welcome <?php print(“$firstname”) ?></p>
<p class=”bodytext”><?php print(“$message”) ?></p>
<p> </p></td>
<td width=”70%” valign=”top”><table width=”420″ border=”0″ cellspacing=”0″ cellpadding=”0″>
<tr>
<td width=”28″ valign=”top”><p class=”Headline”>You are now logged in.</p>
<p class=”bodytext”>To send a file, click
here.</p>
<p class=”bodytext”>To request a quote, click
here.</p>
<p class=”bodytext”>To view your proofs, click
here.</p><?php
//conditional if they have an online catalogif(!empty($online_ordering)) {print(“<p class=\”bodytext\”>To access your Online Ordering catalog, click
here.</p>”);}?>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
</tr>
</table>
<table width=”80%” border=”0″ cellpadding=”0″ cellspacing=”0″ bgcolor=”#000000″>
<tr>
<td> </td>
</tr>
</table>
</body><?PHP require(‘footers.php’) ?>
</body>
</html>
- The topic ‘PHP code breaks’ is closed to new replies.