Re: [PHP] Error Message - Need help troubleshooting

[email protected] (Rick Dwyer)
Newsgroups php.general
Message-ID <[email protected]>
On Mar 2, 2010, at 9:35 AM, Ashley Sheridan wrote:

> I'm assuming then that both the Javascript an the PHP code you have  
> above are both on the same page. The only way I can see your problem  
> occurring would be if your javascript part was on a different page  
> and you were attempting to output the $item_id. If PHP could not  
> find a variable with that name, it may be reverting to using the  
> item_id value found in $_SESSION, which would give you the error  
> you're seeing.


Yes this is the case.

However, what you said brings up a point if interest.  The page that  
the link is bringing up contains the following:

	if ($_GET["iid"]=='') {
	$item_id = ($_SESSION["item_id"]);
	}
	else
	{
	$item_id = $_GET["iid"];
	}

This code determines if the user is getting there from the initial  
link and if so, sets the variable item_id to the value passed in the  
URL.
Again however, this was not returning errors when the link was  
hardcoded with a value in place of item_id.

--Rick
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.