Forum Moderators: mack
while($row=mysql_fetch_array($result))
{
$whichpot=$row['whichpot'];
$view=$row['view'];
$poster=<<<CUTE
<div class="figure">
<div class="photo">
<a href="chosen.php?thepot=$whichpot" title="so you think you want to get pot #$whichpot">
<image src="$view" width="200"></a>
</div></div>
CUTE;
echo $poster;
} This is supposed to set up a new page based on which pot the user clicks on. I copy pasted it from another site I made up, where this code does work, but here it won't.
What painfully obvious thing am I missing.
If you want the whole thing, I can post them.
this is gnupot.php
[code}
<title>who wants some pot?</title>
</head>
<body>
<h1> What's available for distribution</h1>
<h2> If you want one of the pots shown here, click on its picture and fill in the form</h2>
<div id="gallery">
<?php
$table=potpicture;
$conn=mysql_connect(SQL_HOST, SQL_USER, SQL_PASS) or die ('sorry bub, but that resource is forbidden to you.'. mysql_error());
mysql_select_db(SQL_DBNAME,$conn);
$equerry="SELECT * FROM `potpicture`";
$result=mysql_query("$equerry") or die('<h2>no such luck '.mysql_error().'</h2>');
if ($result)
{
while($row=mysql_fetch_array($result))
{
$whichpot=$row['whichpot'];
$view=$row['view'];
$poster=<<<CUTE
<div class="figure">
<div class="photo">
<a href="chosen.php?thepot=$whichpot" title="so you think you want to get pot #$whichpot">
<image src="$view" width="200"></a>
</div></div>
CUTE;
echo $poster;
}
}
else
{
echo "<h1>your table is empty</h1>";
}
?>
</div>
</body>
</html>
[/code]
and this is chose.php
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link href="back.css" rel="stylesheet" type="text/css" />
<?php
echo "<title>";
$fig=$_GET['thepot'];
echo "You want pot #$fig";
echo "<title>";
$conn=mysql_connect(SQL_HOST, SQL_USER, SQL_PASS) or die ('sorry bub, but that resource is forbidden to you.'. mysql_error());
mysql_select_db(SQL_DBNAME,$conn);
?>
</head>
<body>
<?php
$query="select * from potpicture where picture='".$_GET['thepot']."'";
$result=mysql_query($query) or die(mysql_error());
while ($row=mysql_fetch_array($result))
{
$thepot=$row['view'];
echo "<img src="$thepot">";
}
?>
</body>
</html>
some things have been redacted, of course.
and yes, both files are in the same directory.
Thanks