php self issues

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
plankguy
Forum Newbie
Posts: 18
Joined: Sat Jun 25, 2005 7:39 pm

php self issues

Post by plankguy »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


I'm trying to make a dynamically generated jump menu, that when an item is selected the form reloads the current page and then displays the info  from the data base based on the selection. Whenever I submit the form, I get an error that the page cannot be found because it's looking for "%3C?page=aamco", where "%3C" should be list.php....

Code: Select all

$currentPage = $_SERVER['PHP_SELF'];
mysql_data_seek ($result, 0);
echo '<form name="franchises" action="<?php echo $currentPage; ?>">';
echo '<select name="page" id="jumper">';
echo '<option selected>Select a Franchise</option>';
echo '<option></option>';
while ($row = mysql_fetch_assoc($result)) {
	$page = $row["index"];
	$name = $row["name"];
	echo '<option value="' . $page . '">' . $name . '</option>';
}
echo '</select>';
echo '&nbsp;<a href="javascript: submitform()">GO</a>';
echo '</form>';
Any ideas??


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

hint: take a look at your generated source page.
User avatar
aerodromoi
Forum Contributor
Posts: 230
Joined: Sun May 07, 2006 5:21 am

Re: php self issues

Post by aerodromoi »

plankguy wrote:

Code: Select all

echo '<form name="franchises" action="<?php echo $currentPage; ?>">';
You might want to consider that nesting echos can muddle the acoustic experience ;)
Post Reply