homepage Welcome to WebmasterWorld Guest from 54.211.95.201
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / WebmasterWorld / New To Web Development
Forum Library, Charter, Moderators: brotherhood of lan & mack

New To Web Development Forum

    
something really obvious I am missing
using get to move infromation, but it won't work for me.
Baruch Menachem




msg:3629780
 4:56 am on Apr 18, 2008 (gmt 0)


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.

 

thecoalman




msg:3630267
 2:00 am on Apr 19, 2008 (gmt 0)

I have to ask, Is that all you copy and pasted?

Baruch Menachem




msg:3630288
 3:11 am on Apr 19, 2008 (gmt 0)

Well, this is the part I want. There must be something else going on too, that i have forgotten. And the original thing I had was a very different data structure. But it worked great.

[edited by: tedster at 9:46 pm (utc) on April 22, 2008]
[edit reason] no urls, thanks [/edit]

vincevincevince




msg:3630294
 4:00 am on Apr 19, 2008 (gmt 0)

You're missing quite a bit - starting with the database connection and query.

Does chosen.php actually exist?

Baruch Menachem




msg:3630306
 4:42 am on Apr 19, 2008 (gmt 0)

the chosen.php does exist.The issues is, I can't get the file to talk to it.

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

vincevincevince




msg:3630348
 7:47 am on Apr 19, 2008 (gmt 0)

chose.php or chosen.php?

Baruch Menachem




msg:3630438
 12:43 pm on Apr 19, 2008 (gmt 0)

chosen.

I am sure the problem is some kind of typing error of the same kind you noticed here. I just don't see it.

Thanks for the help

Baruch Menachem




msg:3631509
 1:49 pm on Apr 21, 2008 (gmt 0)

Found it!

it was a directory issue.

Thanks for your help

Also, does anyone here use Coda? Positive, negative, what do you think?

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / New To Web Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved