parameter passing - unwanted space

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
slash_gnr3k
Forum Commoner
Posts: 43
Joined: Tue Nov 28, 2006 6:41 pm

parameter passing - unwanted space

Post by slash_gnr3k »

i am passing variables from a 'display' page to an 'edit' page as follows:

Code: Select all

	<?php
		echo '<p><a href ="../edit_pages/editrecipe.php?
		dishid=' . $dishid . '&
		name=' . $name . '&
		method='. $method . '&
		preptime=' . $preptime . '&
		cooktime=' . $cooktime . '
		">Edit</a>';

	?>
however on the edit page, for some reason the method parameter is given an extra space, this is proved by

Code: Select all

method=%20insert%20here
the extra %20 at the beggining. i really cant see why this is happening. can anyone see?
thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

$method is set "incorrectly"
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

We might be able to see, if we could see where $method is being set. Since we cannot see where it is getting its value from, we really cannot make any assessments of how the space is getting there.
slash_gnr3k
Forum Commoner
Posts: 43
Joined: Tue Nov 28, 2006 6:41 pm

Post by slash_gnr3k »

sorted it thanks. it was passed to this page from another page which it was passed to(!) so the problem was two pages back in the chain. if that makes sense!
Post Reply