php-general Digest 7 Feb 2010 15:22:26 -0000 Issue 6578

2010-02-07 Thread php-general-digest-help

php-general Digest 7 Feb 2010 15:22:26 - Issue 6578

Topics (messages 301856 through 301860):

Problem with blocking streams in PHP
301856 by: Phani Raju

Issue with blocked socket stream
301857 by: Phani Raju

Re: simplexml - can it do what I need?
301858 by: TerryA
301859 by: Carlos Medina

Hi list --- justa simple question
301860 by: ebhakt

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


--
---BeginMessage---
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);

sleep(2);

while (!feof($stream)) {

$data = fread($stream, 1024);

xml_parse($parser, $data, feof($stream));

}

}



$xml has the xml to be sent. TIMEOUT is set to 3600*24 and $timeout is set to 
300. As it is a blocking stream, till the data is not arrived, feof should not 
happen. But in this case, the stream is not waiting and returning eof. What is 
the problem with this code?



I tried using even stream_select but faced same issue. ---End Message---
---BeginMessage---
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);

sleep(2);

while (!feof($stream)) {

$data = fread($stream, 1024);

xml_parse($parser, $data, feof($stream));

}

}



$xml has the xml to be sent. TIMEOUT is set to 3600*24 and $timeout is set to 
300. As it is a blocking stream, till the data is not arrived, feof should not 
happen. But in this case, the stream is not waiting and returning eof. What is 
the problem with this code?---End Message---
---BeginMessage---

Hi Shawn
Thanks for answering my query. I have looked at the suggestions:

$xml = simplexml_load_file('file.xml', 'SimpleXMLElement', LIBXML_NOCDATA);

I am/was able to load the file OK and to access the data by iteration.
However, I can't find a way to extract data by attributes. I need something
like $string=element idtype=11 lang=fr label=Description - Etage.
Obviously, that won't work but that's the result I need. How do I get the
data out of one of these elements by specifying its idtype and lang? I've
google for hours on this and for another hour on SimpleXMLElement.

Terry
-- 
View this message in context: 
http://old.nabble.com/simplexml---can-it-do-what-I-need--tp27481222p27486649.html
Sent from the PHP - General mailing list archive at Nabble.com.

---End Message---
---BeginMessage---

TerryA schrieb:

Hi Shawn
Thanks for answering my query. I have looked at the suggestions:

$xml = simplexml_load_file('file.xml', 'SimpleXMLElement', LIBXML_NOCDATA);

I am/was able to load the file OK and to access the data by iteration.
However, I can't find a way to extract data by attributes. I need something
like $string=element idtype=11 lang=fr label=Description - Etage.
Obviously, that won't work but that's the result I need. How do I get the
data out of one of these elements by specifying its idtype and lang? I've
google for hours on this and for another hour on SimpleXMLElement.

Terry

Hi Terry,
look at the PHP.NET documentation. There indicates the use of 
simpleXMLElement structures. If you want to extract elements from this 
object, please read there how this work. By the way, it would be 
interesting to see, how your XML is made. May be is usefull to use 
another class like DOM.


regards

carlos


http://de2.php.net/manual/fr/book.simplexml.php
http://de2.php.net/manual/fr/refs.xml.php
---End Message---
---BeginMessage---
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 

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

2010-02-07 Thread php-general-digest-help

php-general Digest 8 Feb 2010 04:20:23 - 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


--
---BeginMessage---

At 7:02 PM + 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---
---BeginMessage---
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---
---BeginMessage---
Op 2/7/10 3:40 PM, tedd schreef:
 At 7:02 PM + 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 

Re: [PHP] simplexml - can it do what I need?

2010-02-07 Thread TerryA

Hi Shawn
Thanks for answering my query. I have looked at the suggestions:

$xml = simplexml_load_file('file.xml', 'SimpleXMLElement', LIBXML_NOCDATA);

I am/was able to load the file OK and to access the data by iteration.
However, I can't find a way to extract data by attributes. I need something
like $string=element idtype=11 lang=fr label=Description - Etage.
Obviously, that won't work but that's the result I need. How do I get the
data out of one of these elements by specifying its idtype and lang? I've
google for hours on this and for another hour on SimpleXMLElement.

Terry
-- 
View this message in context: 
http://old.nabble.com/simplexml---can-it-do-what-I-need--tp27481222p27486649.html
Sent from the PHP - General mailing list archive at Nabble.com.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] simplexml - can it do what I need?

2010-02-07 Thread Carlos Medina

TerryA schrieb:

Hi Shawn
Thanks for answering my query. I have looked at the suggestions:

$xml = simplexml_load_file('file.xml', 'SimpleXMLElement', LIBXML_NOCDATA);

I am/was able to load the file OK and to access the data by iteration.
However, I can't find a way to extract data by attributes. I need something
like $string=element idtype=11 lang=fr label=Description - Etage.
Obviously, that won't work but that's the result I need. How do I get the
data out of one of these elements by specifying its idtype and lang? I've
google for hours on this and for another hour on SimpleXMLElement.

Terry

Hi Terry,
look at the PHP.NET documentation. There indicates the use of 
simpleXMLElement structures. If you want to extract elements from this 
object, please read there how this work. By the way, it would be 
interesting to see, how your XML is made. May be is usefull to use 
another class like DOM.


regards

carlos


http://de2.php.net/manual/fr/book.simplexml.php
http://de2.php.net/manual/fr/refs.xml.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Hi list --- justa simple question

2010-02-07 Thread ebhakt
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


-- 
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/


Re: [PHP] Warning?

2010-02-07 Thread tedd

At 7:02 PM + 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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Issue with blocked socket stream

2010-02-07 Thread Nathan Rixham
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) ?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Warning?

2010-02-07 Thread Shawn McKenzie
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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Hi list --- justa simple question

2010-02-07 Thread Al



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



Re: [PHP] Re: Hi list --- justa simple question

2010-02-07 Thread ebhakt
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/


Re: [PHP] Re: Hi list --- justa simple question

2010-02-07 Thread shiplu
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)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Warning?

2010-02-07 Thread Jochem Maas
Op 2/7/10 3:40 PM, tedd schreef:
 At 7:02 PM + 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
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Warning?

2010-02-07 Thread tedd

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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] php selecting multiple stylesheets

2010-02-07 Thread David Mehler
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.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] pecl install geoip doesnt work. Warning: opendir(/var/tmp/pear-build-root/install-geoip-1.0.7//var/www/pear): failed to open dir: No such file or directory in PEAR/Builder.php on line 188

2010-02-07 Thread David Taveras
Hello,

Before writing to the general list I tried to search for a pecl users
list but apparently it is closed only to developers.

Iam running pecl install geoip, it confirms as per below that it was
installed correctly but a find / -name geoip.so yields nothing, the
paths mentioned at the end also do not exist. I assume this is because
of the warning in the subject like of this message. Does anybody know
what to do?

Ive tried to uninstall pear and installed it again without luck. Iam
using PEAR-1.9.0 , php5.2.8, and GeoIP-1.4.6.

Thanks

David T.


# /root/bin/pecl install geoip
downloading geoip-1.0.7.tgz ...
Starting to download geoip-1.0.7.tgz (9,416 bytes)
.done: 9,416 bytes
3 source files, building
running: phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No:  20060613
Zend Extension Api No:   220060519
configure.in:145: warning: AC_CACHE_VAL(lt_prog_compiler_static_works,
...): suspicious cache-id, must contain _cv_ to be cached
/usr/local/share/autoconf-2.62/autoconf/general.m4:1987: AC_CACHE_VAL
is expanded from...
/usr/local/share/autoconf-2.62/autoconf/general.m4:2000:
AC_CACHE_CHECK is expanded from...
aclocal.m4:3565: AC_LIBTOOL_LINKER_OPTION is expanded from...
aclocal.m4:5577: _LT_AC_LANG_C_CONFIG is expanded from...
aclocal.m4:5472: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
aclocal.m4:3089: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:2947: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:2927: AC_PROG_LIBTOOL is expanded from...
configure.in:145: the top level
configure.in:145: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works,
...): suspicious cache-id, must contain _cv_ to be cached
aclocal.m4:3528: AC_LIBTOOL_COMPILER_OPTION is expanded from...
aclocal.m4:8099: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
configure.in:145: warning:
AC_CACHE_VAL(lt_prog_compiler_pic_works_CXX, ...): suspicious
cache-id, must contain _cv_ to be cached
aclocal.m4:6529: _LT_AC_LANG_CXX_CONFIG is expanded from...
aclocal.m4:5585: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
aclocal.m4:4717: _LT_AC_TAGCONFIG is expanded from...
configure.in:145: warning: AC_CACHE_VAL(lt_prog_compiler_static_works,
...): suspicious cache-id, must contain _cv_ to be cached
/usr/local/share/autoconf-2.62/autoconf/general.m4:1987: AC_CACHE_VAL
is expanded from...
/usr/local/share/autoconf-2.62/autoconf/general.m4:2000:
AC_CACHE_CHECK is expanded from...
aclocal.m4:3565: AC_LIBTOOL_LINKER_OPTION is expanded from...
aclocal.m4:5577: _LT_AC_LANG_C_CONFIG is expanded from...
aclocal.m4:5472: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
aclocal.m4:3089: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:2947: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:2927: AC_PROG_LIBTOOL is expanded from...
configure.in:145: the top level
configure.in:145: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works,
...): suspicious cache-id, must contain _cv_ to be cached
aclocal.m4:3528: AC_LIBTOOL_COMPILER_OPTION is expanded from...
aclocal.m4:8099: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
configure.in:145: warning:
AC_CACHE_VAL(lt_prog_compiler_pic_works_CXX, ...): suspicious
cache-id, must contain _cv_ to be cached
aclocal.m4:6529: _LT_AC_LANG_CXX_CONFIG is expanded from...
aclocal.m4:5585: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
aclocal.m4:4717: _LT_AC_TAGCONFIG is expanded from...
building in /var/tmp/pear-build-root/geoip-1.0.7
running: /root/temp/geoip/configure
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for icc... no
checking whether gcc and cc understand -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... yes
checking build system type... i386-unknown-openbsd4.5
checking host system type... i386-unknown-openbsd4.5
checking target system type... i386-unknown-openbsd4.5
checking for PHP prefix... /var/www/pear
checking for PHP includes... -I/usr/local/share/php5/include
-I/usr/local/share/php5/include/main
-I/usr/local/share/php5/include/TSRM
-I/usr/local/share/php5/include/Zend
-I/usr/local/share/php5/include/ext
-I/usr/local/share/php5/include/ext/date/lib
checking for PHP extension directory... /var/www/lib/php/modules
checking for PHP installed headers prefix... /usr/local/share/php5/include
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to

Re: [PHP] php selecting multiple stylesheets

2010-02-07 Thread Paul M Foster
On Sun, Feb 07, 2010 at 11:20:18PM -0500, David Mehler wrote:

 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.

There are two main PHP-centric solutions to this. First is cookies (as
you described) and the second is using the $_SESSION global array.

Doing this is relatively straightforward, so if it's not working for
you, I see two possibilities: 1) You're not actually doing it right. 2)
The users isn't pressing the Reload button after selecting the
stylesheet. (My experience has been that simply redisplaying a page will
not clear the cached CSS styles for that page. You must hit the Reload
button. In fact, in some cases, like offices with caching webservers or
proxies, an admin will have to be called in to clear the cache on the
proxy/server as well.)

You should be able to do something like this (I'm using SESSION
variables because cookies are more complicated):

?php
// Top of page
session_start();

if ($_SESSION['stylesheet'] == 'enlarged_print')
$css = 'enlarged_print.css';
else
...

?
html
...
link href=?php echo $css; ? rel=stylesheet type=text/css/
...
/html

Paul

-- 
Paul M. Foster

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] pecl install geoip doesnt work. Warning: opendir(/var/tmp/pear-build-root/install-geoip-1.0.7//var/www/pear): failed to open dir: No such file or directory in PEAR/Builder.php on line 188

2010-02-07 Thread Jochem Maas
Op 2/8/10 4:35 AM, David Taveras schreef:
 /root/bin/pecl install geoip

without giving it much thought ... try this:

 sudo /root/bin/pecl install geoip

this is assuming you we're not running the command as root in the first place.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php selecting multiple stylesheets

2010-02-07 Thread TG
You could use PHP and cookies (session variables are only useful until the 
browser is closed, so it's not as persistant as it sounds like you may 
want).

You could also have a system where users log in and they can save their 
preferences on their user account settings.

What you may also look into is using Javascript (which can also set and 
retrieve cookies) and with a good Javascript library like jQuery, it 
should be relatively easy to dynamically switch style sheets.

Here's an example of a jQuery based stylesheet switcher:
http://www.kelvinluck.com/assets/jquery/styleswitch/toggle.html

Click the styles1, styles2 and styles3 links.


Also, there are JS scripts for adjusting font size, so you may not need a 
completely different stylesheet.  But it would mean having well designed 
HTML that will scale nicely with the font change.   Or you could just 
have a different stylesheet, as you mentioned, so you know it will look 
exactly how you want.  You can see an example of a font size JS here:
http://www.joomla-beez.com/

Keep clicking the links in the upper right and you can continue to increase 
or decrease the size quite a bit, not just one step.


I know this is a PHP list but I think a client side script may work better 
in this case.

-TG

- Original Message -
From: David Mehler dave.meh...@gmail.com
To: php-general@lists.php.net
Date: Sun, 7 Feb 2010 23:20:18 -0500
Subject: [PHP] php selecting multiple stylesheets

 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.
 
 -- 
 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] simplexml - can it do what I need?

2010-02-07 Thread TerryA

Hi Carlos

I looked at the documentation for hours but don't see any solution. I'm
uploading a sample file here. The full file contains around 100 properties
but the uploaded file has just one. I need to extract data from this file to
write to a MySQL database. I have no problem in doing this until it comes to
the elements-element tags. I only need 3 of these elements. I can
extract the data by iteration but that does not help me to get the three
specific element tags that I need because there are some tags that appear
for some properties and not for others so the order is different. Here is
the file:
http://old.nabble.com/file/p27496211/annnonces.xml annnonces.xml 
Thanks
Terry



-- 
View this message in context: 
http://old.nabble.com/simplexml---can-it-do-what-I-need--tp27481222p27496211.html
Sent from the PHP - General mailing list archive at Nabble.com.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php