Jump to content

Syntax Problems


benji_182

Recommended Posts

Whilst I'm reasonably good at PHP  I get stumped from time to time on the correct syntax when dealing with HTML and PHP.  I'm working on this bit of code to create a basic content management system and fallen at one of the first hurdles.  When trying to echo out the information from the DB into a loop I can't quite get the syntax right.  Tried numerous methods but won't seem to work.  Your help would be most appreciated!

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?
include ("conninfo.php");

$query="SELECT * FROM cpaa";
$result=mysql_query($query)or die("Query Broken");
?>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
  <h1>Edit Standards</h1>
  
  <form action="confirmedit.php" name="edit">
  
  <input type="<?

while($r=mysql_fetch_array($result))
{
echo "<input type="text" name="test1" value="/$r["cpasubname"]/"/>";
}
?>

  
  </form>
</body>
</html>

 

Sorry for such a basic problem.

 

benji

 

Link to comment
https://forums.phpfreaks.com/topic/166791-syntax-problems/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.