Re: [PHP] Error Message - Need help troubleshooting
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
Re: [PHP] Error Message - Need help troubleshooting
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: [PHP] Error Message - Need help troubleshooting
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: [PHP] Error Message - Need help troubleshooting
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,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 > 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
Re: [PHP] Error Message - Need help troubleshooting
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: [PHP] Error Message - Need help troubleshooting
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
Re: [PHP] Error Message - Need help troubleshooting
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. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Error Message - Need help troubleshooting
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=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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Error Message - Need help troubleshooting
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. 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=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 > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Error Message - Need help troubleshooting
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=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