Error Message - Need help troubleshooting
Error Message - Need help troubleshooting
am 02.03.2010 05:46:28 von Rick Dwyer
Hello List.
I have some JS code that open a new window with a contact form in it.
When the link is clicked to open the new window, I will get the
following error SOMETIMES:
"Warning: Unknown: Your script possibly relies on a session side-
effect which existed until PHP 4.2.3. Please be advised that the
session extension does not consider global variables as a source of
data, unless register_globals is enabled. You can disable this
functionality and this warning by setting session.bug_compat_42 or
session.bug_compat_warn to off, respectively. in Unknown on line 0"
My JS code with a bit of PHP in it looks like this:
function loadOSS()
var oss_itemid = "";
var loadOSS = window.open("my_url/my_file.php?iid=" + oss_itemid, "",
"scrollbars
=
no
,menubar
=
no
,height=600,width=600,resizable=yes,toolbar=no,location=no,s tatus=no");
}
As I said above, the error message does not always appear.
Is the error due to the fact I am JS & PHP together?
Any help in understanding what I am doing wrong is appreciated.
--Rick
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Error Message - Need help troubleshooting
am 02.03.2010 06:31:29 von Rene Veerman
i doubt you passed us the entire .js.php script..
does the script itself ever fail, asides from showing this msg?
On Tue, Mar 2, 2010 at 5:46 AM, Rick Dwyer wrote:
> Hello List.
>
> I have some JS code that open a new window with a contact form in it. =A0=
When
> the link is clicked to open the new window, I will get the following erro=
r
> SOMETIMES:
>
> "Warning: Unknown: Your script possibly relies on a session side-effect
> which existed until PHP 4.2.3. Please be advised that the session extensi=
on
> does not consider global variables as a source of data, unless
> register_globals is enabled. You can disable this functionality and this
> warning by setting session.bug_compat_42 or session.bug_compat_warn to of=
f,
> respectively. in Unknown on line 0"
>
> My JS code with a bit of PHP in it looks like this:
>
> function loadOSS()
> var oss_itemid =3D "";
> var loadOSS =3D window.open("my_url/my_file.php?iid=3D" + oss_itemid, "",
> "scrollbars=3Dno,menubar=3Dno,height=3D600,width=3D600,resiz able=3Dyes,to=
olbar=3Dno,location=3Dno,status=3Dno");
> }
>
> As I said above, the error message does not always appear.
>
> Is the error due to the fact I am JS & PHP together?
>
> Any help in understanding what I am doing wrong is appreciated.
>
> =A0--Rick
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Error Message - Need help troubleshooting
am 02.03.2010 14:38:26 von Rick Dwyer
On Mar 2, 2010, at 12:31 AM, Rene Veerman wrote:
> i doubt you passed us the entire .js.php script..
The rest of the JS is as follows:
.....a href='javascript:loadOSS()'>
width='161' height='57' align='right' />Open Window...
As far as other PHP goes, the whole page is PHP so I wouldn't know
where to even start. My guess was that the problem was originating
from the previous code I sent over, but I don't know enough PHP to be
sure.
>
> does the script itself ever fail, asides from showing this msg?
No it works fine. The most annoying thing in making it difficult to
to troubleshoot is this message does not always appear.
--Rick
>
>
> On Tue, Mar 2, 2010 at 5:46 AM, Rick Dwyer
> wrote:
>> Hello List.
>>
>> I have some JS code that open a new window with a contact form in
>> it. When
>> the link is clicked to open the new window, I will get the
>> following error
>> SOMETIMES:
>>
>> "Warning: Unknown: Your script possibly relies on a session side-
>> effect
>> which existed until PHP 4.2.3. Please be advised that the session
>> extension
>> does not consider global variables as a source of data, unless
>> register_globals is enabled. You can disable this functionality and
>> this
>> warning by setting session.bug_compat_42 or session.bug_compat_warn
>> to off,
>> respectively. in Unknown on line 0"
>>
>> My JS code with a bit of PHP in it looks like this:
>>
>> function loadOSS()
>> var oss_itemid = "";
>> var loadOSS = window.open("my_url/my_file.php?iid=" + oss_itemid, "",
>> "scrollbars
>> =
>> no
>> ,menubar
>> =
>> no
>> ,height
>> =600,width=600,resizable=yes,toolbar=no,location=no,status=n o");
>> }
>>
>> As I said above, the error message does not always appear.
>>
>> Is the error due to the fact I am JS & PHP together?
>>
>> Any help in understanding what I am doing wrong is appreciated.
>>
>> --Rick
>>
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Error Message - Need help troubleshooting
am 02.03.2010 14:48:43 von Ashley Sheridan
--=-+bVgicCXyFJ0+Etxe83S
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
On Tue, 2010-03-02 at 14:49 +0100, Rene Veerman wrote:
> k, add to your script,
> to prevent the error from showing.
>
> On Tue, Mar 2, 2010 at 2:38 PM, Rick Dwyer wrote:
> > On Mar 2, 2010, at 12:31 AM, Rene Veerman wrote:
> >> does the script itself ever fail, asides from showing this msg?
> >
> > No it works fine. The most annoying thing in making it difficult to to
> > troubleshoot is this message does not always appear.
>
If there is a genuine problem, that won't actually fix it though.
How is $item_id created? You've not shown that in your PHP script
examples.
Thanks,
Ash
http://www.ashleysheridan.co.uk
--=-+bVgicCXyFJ0+Etxe83S--
Re: Error Message - Need help troubleshooting
am 02.03.2010 14:49:43 von Rene Veerman
k, add to your script,
to prevent the error from showing.
On Tue, Mar 2, 2010 at 2:38 PM, Rick Dwyer wrote:
> On Mar 2, 2010, at 12:31 AM, Rene Veerman wrote:
>> does the script itself ever fail, asides from showing this msg?
>
> No it works fine. =A0The most annoying thing in making it difficult to to
> troubleshoot is this message does not always appear.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Error Message - Need help troubleshooting
am 02.03.2010 15:35:02 von Rick Dwyer
On Mar 2, 2010, at 8:48 AM, Ashley Sheridan wrote:
>
> How is $item_id created? You've not shown that in your PHP script
> examples.
// parse item id from the url
$refer=$_SERVER['HTTP_REFERER'];
$thispage=$_SERVER['PHP_SELF'];
$item_id=substr($thispage, -9);
$item_id=substr($item_id, 0, 5);
$_SESSION['item_id'] = "$item_id";
The above is where item_id is created and added to a session.
The important thing is that this error never showed up before until I
added the Javascript link below:
var oss_itemid = "";
var loadOSS = window.open("http://www.myurl/myfile.php?iid=" +
oss_itemid, "",
"scrollbars
=
no
,menubar
=
no
,height=600,width=600,resizable=yes,toolbar=no,location=no,s tatus=no");
When I was testing initially, I had removed the variable above in the
link with a hard coded value and I never received this error. Only
when I made it dynamic did this error appear.
Thanks for any help.
--Rick
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Error Message - Need help troubleshooting
am 02.03.2010 15:39:34 von Ashley Sheridan
--=-7tsJATUqy9BHtl+hRIeC
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
On Tue, 2010-03-02 at 09:35 -0500, Rick Dwyer wrote:
> On Mar 2, 2010, at 8:48 AM, Ashley Sheridan wrote:
> >
> > How is $item_id created? You've not shown that in your PHP script
> > examples.
>
> // parse item id from the url
> $refer=$_SERVER['HTTP_REFERER'];
> $thispage=$_SERVER['PHP_SELF'];
> $item_id=substr($thispage, -9);
> $item_id=substr($item_id, 0, 5);
>
> $_SESSION['item_id'] = "$item_id";
>
> The above is where item_id is created and added to a session.
>
> The important thing is that this error never showed up before until I
> added the Javascript link below:
>
> var oss_itemid = "";
> var loadOSS = window.open("http://www.myurl/myfile.php?iid=" +
> oss_itemid, "",
> "scrollbars
> =
> no
> ,menubar
> =
> no
> ,height=600,width=600,resizable=yes,toolbar=no,location=no,s tatus=no");
>
>
> When I was testing initially, I had removed the variable above in the
> link with a hard coded value and I never received this error. Only
> when I made it dynamic did this error appear.
>
> Thanks for any help.
>
> --Rick
>
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.
Try changing the line to
var oss_itemid = "";
and see if that gives you the error.
Thanks,
Ash
http://www.ashleysheridan.co.uk
--=-7tsJATUqy9BHtl+hRIeC--
Re: Error Message - Need help troubleshooting
am 02.03.2010 15:45:56 von Joseph Thayne
I do not know if the question has been answered, but how are you opening
the session? Are you using session_start() or are you using
session_register()?
Rick Dwyer wrote:
> On Mar 2, 2010, at 8:48 AM, Ashley Sheridan wrote:
>>
>> How is $item_id created? You've not shown that in your PHP script
>> examples.
>
> // parse item id from the url
> $refer=$_SERVER['HTTP_REFERER'];
> $thispage=$_SERVER['PHP_SELF'];
> $item_id=substr($thispage, -9);
> $item_id=substr($item_id, 0, 5);
>
> $_SESSION['item_id'] = "$item_id";
>
> The above is where item_id is created and added to a session.
>
> The important thing is that this error never showed up before until I
> added the Javascript link below:
>
> var oss_itemid = "";
> var loadOSS = window.open("http://www.myurl/myfile.php?iid=" +
> oss_itemid, "",
> "scrollbars=no,menubar=no,height=600,width=600,resizable=yes ,toolbar=no,location=no,status=no");
>
>
>
> When I was testing initially, I had removed the variable above in the
> link with a hard coded value and I never received this error. Only
> when I made it dynamic did this error appear.
>
> Thanks for any help.
>
> --Rick
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Error Message - Need help troubleshooting
am 02.03.2010 15:49:53 von Rick Dwyer
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
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Error Message - Need help troubleshooting
am 02.03.2010 15:52:17 von Rick Dwyer
On Mar 2, 2010, at 9:45 AM, Joseph Thayne wrote:
> I do not know if the question has been answered, but how are you
> opening the session? Are you using session_start() or are you using
> session_register()?
Hi Joseph.
It is created via:
session_start();
--Rick
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php