Hey gamebits :)
The code for my view page is
<html>
<head>
<?php
function mysql_die($error = "unknown")
{
echo "<H1>Error:". $error."</H1>";
exit;
}
$db = mysql_connect("localhost",
mysql_select_db("bookit_uk
$requete = "SELECT * FROM tblProgramControl WHERE id=".$id;
$result = mysql_query ($requete,$db)or mysql_die("No record");
$Used =mysql_fetch_object($resul
mysql_free_result($result)
?>
</head>
<body>
<H2 align=center>Database Test Page</H2><br><br>
<?php echo $Used->id ?>
<BR>
<?php echo $Used->password ?>
<BR>
<?php echo $Used->errString ?>
</body>
</html>
So , I combined that with the other code for the from and get
<html>
<head>
<?php
function mysql_die($error = "unknown")
{
echo "<H1>Error:". $error."</H1>";
exit;
}
$db = mysql_connect("localhost",
mysql_select_db("bookit_uk
$requete = "SELECT * FROM tblProgramControl WHERE id=".$id;
$result = mysql_query ($requete,$db)or mysql_die("No record");
$Used =mysql_fetch_object($resul
mysql_free_result($result)
?>
</head>
<body>
<h1>Book It Program Control Interface</h1>
<br>
<?
$db = mysql_connect("localhost",
mysql_select_db("bookingap
?>
<?php
if(isset($post)){
//get values from the form
$isValid = $_POST['isValid'];
$errString = $_POST['errString'];
$allowPassword = $_POST['allowPassword'];
$password = $_POST['password'];
$lockedOutText = $_POST['lockedOutText'];
$qry = mysql_query("insert into `tblProgramControl` (`isValid`, `errString`, `allowPassword`, `password`, `lockedOutText`) values ('$isValid', '$errString', '$allowPassword', '$password', '$lockedOutText')");
$result = mysql_query ($qry,$db);
}
else
{
echo "<form method=\"post\" action=\"programControl.ph
Program is active?
<input type=checkbox name=isValid value=$Used['isValid']><br
Message to display to program user:
<input type=text name=errString value=$Used['errString']><
Allow password to unlock program?
<input type=checkbox name=allowPassword value=$Used['allowPassword
Password:
<input type=text name=password value=$Used['password']><b
Text to display when locked out:
<input type=text name=lockedOutText value=$Used['lockedOutText
<input type=submit name=post value=\"Submit\">
</form>";
}
?>
<a href="http://members.lycos
</body>
</html>
which has a parse error
Main Topics
Browse All Topics





by: gamebitsPosted on 2007-01-21 at 17:03:25ID: 18361830
You put the result from the db insite the form as value
<input type=text name=firstname value=$row['firstname']>