Forum Moderators: coopster
<html>
<head>
<title>Member Look up</title>
</head>
<body bgcolor="006666">
<?php
if ($_POST['Facid']!= "") $Facid = $_POST['Facid'];
if ($Facid!= "") {
@ $db = mysql_pconnect('localhost', 'eni', 'password');
if (!$db) {
echo 'Error: Could not connect to database. Please try again later.';
exit;
} else {
$listing_query = "select * from ehpadmin.Facility where Facid = '".$Facid."'";
$listing_result = mysql_query($listing_query) or die("Error in return query<br>".mysql_error());
$row = mysql_fetch_array($listing_result);
$id = $row["MemID"];
if ($id == "1") {
facility3.html;
}
if ($id == "2") {
facility2.html;
}
$num_rows = mysql_num_rows($listing_result);
if ($num_rows == 0) {
echo '<font color="white"><b>Please try again</b></font></br></br>';
print "Practice ID invalid.</br></br>";
echo '<a href ="poup.html"><font color="white">Back</font></a>';
} else {
<form method="POST">
<p align="left"><b><font color="#FFFFFF">Enter Practice Id</font></b></p>
<p align="left">
<input type="text" name="Facid" size="20">
<input type="submit" value="Go">
</p>
</form>
}
}
</body>
</html>
?>
where it says $id is the new part of the code
any help would be great
if you trying to redirect to facility3.html you should write
something like
header("Location: [".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."...]
facility3.html alone is not a php command so of course it doesn't know what to do.
You need more help you should look at the header() function in the PHP manual or search for "redirect" in the manual
<? while ($i < $Num)
{
$Foo=mysql_result($Result,$i, 'Bar');
++i;
?>
<span id=FooBar><?= $Foo?></span>
<? if ($i < $Num) {
$Foo=mysql_result($Result,$i, 'Bar');
++i;
}
?>
<span id=FooBar><?= $Foo?></span>
<?
}
?>
Dunno if thats what your looking for but its a try :)