php-general Digest 8 Feb 2010 04:20:23 -0000 Issue 6579

Topics (messages 301861 through 301869):

Re: Warning?
        301861 by: tedd
        301863 by: Shawn McKenzie
        301867 by: Jochem Maas
        301868 by: tedd

Re: Issue with blocked socket stream
        301862 by: Nathan Rixham

Re: Hi list --- justa simple question
        301864 by: Al
        301865 by: ebhakt
        301866 by: shiplu

php selecting multiple stylesheets
        301869 by: David Mehler

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
At 7:02 PM +0000 2/6/10, Jochem Maas wrote:
Op 2/6/10 4:29 PM, tedd schreef:
 Hi:

 Has anyone encountered this warning?

 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

 I seem to remember this happening before, but I don't remember the
 solution. As I remember, it wasn't really reporting an error, but
 something else. I just don't remember how I dealt with it before.

 I don't know how to set session.bug_compat_warn to off.

doesn't this work?:

        <?php ini_set('session.bug_compat_warn', 0); ?>

otherwise you'll have to set it in php.ini (or a .htaccess file)

IIRC it means your using session_register() .. which is depreciated and
will be dropped in 5.3 ... AFAIK best practices is not to use this function
but instead assing to the $_SESSION superglobal.

Jochem:

Two things:

1. Your solution worked. Setting --

<?php ini_set('session.bug_compat_warn', 0); ?>

-- worked!!! Thank you.

2. I don't use session_register(). So has to be something else, but I don't know what that might be.

Anyone have any ideas?

Daniel?

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
tedd wrote:
> Hi:
> 
> Has anyone encountered this warning?
> 
> 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
> 
> I seem to remember this happening before, but I don't remember the
> solution. As I remember, it wasn't really reporting an error, but
> something else. I just don't remember how I dealt with it before.
> 
> I don't know how to set session.bug_compat_warn to off.
> 
> Any ideas?
> 
> Cheers,
> 
> tedd
> 
> PS: I'm using php 5.2.10 and register_global is OFF.

This will reproduce the error:

session_start();
$_SESSION['test'] = null;
$test = 1;

It has something to do with using a global var that is the same name as
a session var, but the session var has to be null it seems.


-- 
Thanks!
-Shawn
http://www.spidean.com

--- End Message ---
--- Begin Message ---
Op 2/7/10 3:40 PM, tedd schreef:
> At 7:02 PM +0000 2/6/10, Jochem Maas wrote:
>> Op 2/6/10 4:29 PM, tedd schreef:
>>>  Hi:
>>>
>>>  Has anyone encountered this warning?
>>>
>>>  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
>>>
>>>  I seem to remember this happening before, but I don't remember the
>>>  solution. As I remember, it wasn't really reporting an error, but
>>>  something else. I just don't remember how I dealt with it before.
>>>
>>>  I don't know how to set session.bug_compat_warn to off.
>>
>> doesn't this work?:
>>
>>     <?php ini_set('session.bug_compat_warn', 0); ?>
>>
>> otherwise you'll have to set it in php.ini (or a .htaccess file)
>>
>> IIRC it means your using session_register() .. which is depreciated and
>> will be dropped in 5.3 ... AFAIK best practices is not to use this
>> function
>> but instead assing to the $_SESSION superglobal.
> 
> Jochem:
> 
> Two things:
> 
> 1. Your solution worked. Setting --
> 
> <?php ini_set('session.bug_compat_warn', 0); ?>
> 
> -- worked!!! Thank you.

np :)

> 
> 2. I don't use session_register(). So has to be something else, but I
> don't know what that might be.
> 
> Anyone have any ideas?

pretty sure Shawn nailed it.

> 
> Daniel?
> 
> Cheers,
> 
> tedd
> 


--- End Message ---
--- Begin Message ---
At 10:15 AM -0600 2/7/10, Shawn McKenzie wrote:
tedd wrote:
 Hi:

 Has anyone encountered this warning?

 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

 I seem to remember this happening before, but I don't remember the
 solution. As I remember, it wasn't really reporting an error, but
 something else. I just don't remember how I dealt with it before.

 I don't know how to set session.bug_compat_warn to off.

 Any ideas?

 Cheers,

 tedd

 PS: I'm using php 5.2.10 and register_global is OFF.

This will reproduce the error:

session_start();
$_SESSION['test'] = null;
$test = 1;

It has something to do with using a global var that is the same name as
a session var, but the session var has to be null it seems.

--
Thanks!
-Shawn

That's it! I remember now. I knew it was something simple and really stupid.

As it turns out, the problem here is that this error is NOT consistent. Most of the time you don't need to worry about what you name your variables and session variables. But every once in a while if you are in the habit of naming variables the same name as session variable (as I do), then the practice sometimes generates an error.

So to solve the above problem, all you have to do is use a different variable name than the session name for that instance -- something like:

session_start();
$_SESSION['session_test'] = null;
$test = 1;

But like I said, the error is only generated every once in a while and NOT consistently. As such, you may have scores of variables that match scores of sessions with no errors. But then you add just one more and bingo you have an error that leaves you thinking "What the Hell just happened?"

What is further maddening is that after you fix that error, by changing then name of that conflict, you can go back to naming as you like until another error is generated. It happens only once in a while and not always.

Thanks for loaning me your memory.

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
Phani Raju wrote:
> I am trying to open a blocking stream using fsockopen. I want to write and 
> read XML input/output from a server. After opening the steam I will send a 
> XML request to server using the stream. Once this request is sent, I want to 
> keep listening on the port indefinitely.
> 
> I tried using blocking stream for this with a huge timeout. But had no 
> success as it was not waiting for such a long period.
> 
> Code:
> $parser = xml_parser_create("UTF-8");
> if($stream = @fsockopen($host, $port, $errorno, $errorstr, $timeout)) {
> stream_set_blocking($stream, 1);
> stream_set_timeout($stream, TIMEOUT);
> fwrite($stream, $xml."n");

fwrite($stream, $xml."n") should probably be fwrite($stream, $xml."\n") ?

--- End Message ---
--- Begin Message ---


On 2/7/2010 10:22 AM, ebhakt wrote:
I am developing a website here wherein i need to post a  lot of content.
I am trying to develop a script to post data automatically to the site
the site is designed in drupal
any idea/comment or suggestion on how should i begin with because i am new
to php language



I'd recommend posting your question on the Drupal forum and investigating http://drupal.org/handbooks
--- End Message ---
--- Begin Message ---
thanks for the suggestion but i need a out of the box solution , be it based
on dotnet or php on how to post content to a website or blog by reading an
 xml file or like  a feed rss for example
i need something to function like the feed aggregator module in drupal but
not for drupal , for any website

On Sun, Feb 7, 2010 at 8:35 AM, Al <n...@ridersite.org> wrote:

>
>
> On 2/7/2010 10:22 AM, ebhakt wrote:
>
>> I am developing a website here wherein i need to post a  lot of content.
>> I am trying to develop a script to post data automatically to the site
>> the site is designed in drupal
>> any idea/comment or suggestion on how should i begin with because i am new
>> to php language
>>
>>
>>
> I'd recommend posting your question on the Drupal forum and investigating
> http://drupal.org/handbooks
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Bhaskar Tiwari
GTSE Generalist
Directory Services
Microsoft

\____________________________________________________________
All we have to decide is what to do with the time that has been given to us

bhaskartiw...@officeliveusers.com

http://www.ebhakt.com/
http://fytclub.net/

http://bhaskartiwari.web.officelive.com/
http://ebhakt.spaces.live.com/

--- End Message ---
--- Begin Message ---
On Sun, Feb 7, 2010 at 10:55 PM, ebhakt <i...@ebhakt.com> wrote:
> thanks for the suggestion but i need a out of the box solution , be it based
> on dotnet or php on how to post content to a website or blog by reading an
>  xml file or like  a feed rss for example
> i need something to function like the feed aggregator module in drupal but
> not for drupal , for any website

There may be an out of box solution. You can google for it.
If you dont find any you have to write it in plain php.


-- 
Shiplu Mokaddim
My talks, http://talk.cmyweb.net
Follow me, http://twitter.com/shiplu
SUST Programmers, http://groups.google.com/group/p2psust
Innovation distinguishes bet ... ... (ask Steve Jobs the rest)

--- End Message ---
--- Begin Message ---
Hello,
I'm trying to set up a web site. This site has multiple stylesheets,
one default stylesheet that should be used if the other is not chosen.
The second is a high contrast stylesheet and can be selected by user's
who need it. I'm also thinking of adding two more for smaller and
larger font selections. My issue is I want the high contrast sheet to
be used on all subsequent pages and on subsequent visits to the site
by user's who have selected it. I thought of using php with this and
cookies. I'm using php5 and would appreciate any suggestions, googling
has shown some examples, but none are working.
Thanks.
Dave.

--- End Message ---

Reply via email to