Ask a Question related to Macromedia Dynamic HTML, Design and Development.
-
Tron #1
This is driving me batty....
....I'm posting this here, because it's probably more appropriate than
over in the Dreamweaver forum, although I suspect most everyone here is
also over there. This forum just seems quieter, somehow.
I am still, two days into it, trying to figure out how to call data
using a drop-down menu.
Here's the code, as generated by Dreamweaver:
<form action="searchresult.php?category_id=<?php echo
$row_RS2['category_id']; ?>" method="post" name="form1">
<select name="select">
<?php
do {
?>
<option value="<?php echo $row_RS2['category_id']?>"<?php if
(!(strcmp($row_RS2['category_id'], $row_RS2['category_id']))) {echo
"SELECTED";} ?>><?php echo $row_RS2['category_id']?></option>
<?php
} while ($row_RS2 = mysql_fetch_assoc($RS2));
$rows = mysql_num_rows($RS2);
if($rows > 0) {
mysql_data_seek($RS2, 0);
$row_RS2 = mysql_fetch_assoc($RS2);
}
?>
</select>
<input name="search" type="submit" id="search"
onClick="MM_jumpMenuGo('menu1','parent',0)" value="Go">
</form>
<p> </p>
</body>
</html>
<?php
mysql_free_result($RS2);
?>
Okay. When I do this, the URL Parameter that gets sent is always 1.
searchresult.php?category_id=1
Gary suggested that I do this:
<form name="form1" method="post" action="searchresult.php">
<input type="hidden" name="category_id"
value="<?php echo $row_RS2['category_id'];?>">
But when I do that, there are no URL Parameters at all.
So I tried changing the method from post to get.
Success, it now changes the Category ID to what I select.
Failure, it calls this:
searchresult.php?select=4&search=Go
Which, of course, php doesn't interpret as a URL parameter, so it fails,
and calls the default of, you guessed it...one.
I can get it to work if I do this:
<td><a href="searchresult.php?category_id=<?php echo
$row_rs1['category_id']; ?>"><?php echo $row_rs1['category_name'];
?></a></td>
<td><?php echo $row_rs1['biz_name']; ?></td>
</tr>
<?php } while ($row_rs1 = mysql_fetch_assoc($rs1)); ?>
Which creates a list of all my categories. But the fact that I can't get
the form to work is really, really annoying me.
Does anyone have a solution? Maybe a sample that I can look at that works?
Tron Guest
-
3D Driving Game
Hi all, I just have a quick question today, hopefully it is quite an easy one to solve... Ok, i am making a 3D driving game which consists of... -
two things driving me mad .
Ok , I´m a heavy PS abuser , so this is probably not an issue for most of the people :-) 1 . beauty full new tool: highlight /shadow adjustment ,... -
Please help - this has been driving me nuts!
Hi I am attempting to port a CDROM project to the web. The progress bar loads fine - and just before the movie kicks off - I get a dialog box... -
Template driving me mad
Have I got the wrong idea about templates ? I design a page .. save it as a template with an editable area. Open the template ...input some... -
CSS is driving me MAD!!!
I am a newbie...obviously! I have noticed site, of course, that have there background that goes from browser wall to wall with no white space... -
Tron #2
Re: This is driving me batty....
Ha ha.
I found the problem.
It wasn't on my search page at all.
It was on my search results page.
I did not know that when using "Get", I had to filter by Category_id,
but then set the URL parameter to whatever my form was named on the
previous page.
Three days into the whole process, and I finally found something
somewhere that said that....
I'm going to go post a similar note to Gary out on the main page, cuz
I'm not sure he reads this one.
Tron Guest



Reply With Quote

