Re: [PHP] suggestions needed to use "session"

2005-09-06 Thread Robert Graham

Nahalingam Kanakavel wrote:


Hi all,

I am new to PHP.
I know some thing about SESSIONS in PHP, I am in need of your suggestions.
how to use sessions ?
what is an efficient way to handle session_id ? like that.
How efficiently we can use session concept in our web site development ?
how it is helpful.

thanks in advance.

 


Good day

Have a look at the following:
http://www.sitepoint.com/article/users-php-sessions-mysql

Regards
Robert

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



[PHP] Getting current page name without path

2005-09-06 Thread Bushra

Hi
I want to get the name of current page. I use $PHP_SELF or 
SCRIPT_FILENAME, but it also provides the path name . I just want to 
retrieve the file name with extension. How can I do that?


Regards 
Bushra


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



RE: [PHP] Getting current page name without path

2005-09-06 Thread George Pitcher
> I want to get the name of current page. I use $PHP_SELF or
> SCRIPT_FILENAME, but it also provides the path name . I just want to
> retrieve the file name with extension. How can I do that?
>

$_SERVER['SCRIPT_NAME'] and $_SERVER['ORIG_SCRIPT_NAME'] will give you the
current filename without the path.

I'm currently using PHP5.1RC so it might differ in your version but check
out phpinfo.php

These things are all displayed in phpinfo.php.

George

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



Re: [PHP] preg_match and $ sign in PHP5

2005-09-06 Thread Robin Vickery
On 9/6/05, Cabbar Duzayak <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I have a regular expression check as:
> 
> preg_match("/$xyz/", $data, $matches);
> 
> And, as you know $xyz means "string starts with xyz". 

No it doesn't - "string starts with xyz" would be "/^xyz/" which
coincidentally avoids your problem of xyz being interpreted as a
variable name.

More generally, if you don't want $xyz interpreted as a variable, then
use single quotes - or if you must use double quotes, then escape the
$ with a backslash.

 -robin

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



Re: [PHP] Getting current page name without path

2005-09-06 Thread Robin Vickery
On 9/6/05, Bushra <[EMAIL PROTECTED]> wrote:
> Hi
> I want to get the name of current page. I use $PHP_SELF or
> SCRIPT_FILENAME, but it also provides the path name . I just want to
> retrieve the file name with extension. How can I do that?

http://www.php.net/manual/en/function.basename.php

  -robin

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



[PHP] 302 Responses (Was: session cookies)

2005-09-06 Thread Chris Shiflett

Rasmus Lerdorf wrote:

Also, just add a single line to your own test script and make it look
like this:

header('Location: http://www.php.net/');
$fp = fopen('/tmp/log.txt', 'w');
for ($i = 0; $i < 30; $i++)
{
$str = "Count $i\n";
echo str_repeat($str, 1000);
fputs($fp, $str);
sleep(1);
flush();
}

Then time how long it takes for the redirect to happen. Is it still
taking 30 seconds?


Yes, it still takes 30 seconds, but each chunk is now 8000 or 9000 
bytes. This is with Firefox on Linux (my previous ad hoc tests were on 
Mac, because I was traveling). I'd be curious to know what behavior 
other people observe with any of these test scripts.


1. Rasmus's original test script:

header('Location: http://www.php.net/');
$fp = fopen('/tmp/log.txt', 'w');
for ($i = 0; $i < 100; $i++)
{
$str = "Count $i\n";
echo $str;
fputs($fp, $str);
}

When trying this one, my log.txt shows entries from 0 to 99, so it 
loops the full 100 times. I've checked ignore_user_abort(), and it's 
false. You can set it in the script to be sure. If the browser aborts 
and requests the new URL before the script finishes executing, the log 
should reflect this.


2. Chris's original test script:

header('Location: http://www.php.net/');
$fp = fopen('/tmp/log.txt', 'w');
for ($i = 0; $i < 30; $i++)
{
$str = "Count $i\n";
echo $str;
fputs($fp, $str);
sleep(1);
flush();
}

This script takes longer to execute but generates less output. I was 
thinking that perhaps browsers are only patient up to a point, but this 
is not the case with the browsers I've tried. I get redirected after 
about 30 seconds.


3. Chris's modified test script:

header('Location: http://www.php.net/');
$fp = fopen('/tmp/log.txt', 'w');
for ($i = 0; $i < 30; $i++)
{
$str = "Count $i\n";
echo str_repeat($str, 1000);
fputs($fp, $str);
sleep(1);
flush();
}

Rasmus modified the echo in my test script to output 1000 times as much 
content. I thought this might work based on section 10.3.3 of RFC 2616 
(I referenced this to try to determine why we are observing different 
behavior):


"Unless the request method was HEAD, the entity of the response SHOULD 
contain a short hypertext note with a hyperlink to the new URI(s)."


A few hundred thousand bytes doesn't seem like a "short hypertext note" 
to me, but apparently size doesn't matter. :-)


If anyone can get a browser to redirect (request the new URL) before 
receiving the entire 302 response, I'd love to know your test script, 
platform, and browser. I have not been able to reproduce this.


Chris

--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/

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



Re: [PHP] suggestions needed to use "session"

2005-09-06 Thread viraj
another good one, but for intermediates

http://www.zend.com/zend/tut/session.php

~viraj.


On 9/6/05, Robert Graham <[EMAIL PROTECTED]> wrote:
> Nahalingam Kanakavel wrote:
> 
> >Hi all,
> >
> >I am new to PHP.
> >I know some thing about SESSIONS in PHP, I am in need of your suggestions.
> >how to use sessions ?
> >what is an efficient way to handle session_id ? like that.
> >How efficiently we can use session concept in our web site development ?
> >how it is helpful.
> >
> >thanks in advance.
> >
> >
> >
> Good day
> 
> Have a look at the following:
> http://www.sitepoint.com/article/users-php-sessions-mysql
> 
> Regards
> Robert
> 
> --
> 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] suggestions needed to use "session"

2005-09-06 Thread Nahalingam Kanakavel
Hi all once again,

Thanks for all,

your suggestions made me to know about sessions and about the functions 
needed to handle sessions.

but I have some doubts plz clarify those things

what for the session Id is ?.
what is SID ? I saw this in some example codings but it is not working in my 
machine !

The coding which is using SID & failed in my system is as follows
 coding start --



Hello visitor, you have seen this page  times.



To continue, click
here.

 end -
That echo statement is not working and my count also not gets increment.

On 9/6/05, viraj <[EMAIL PROTECTED]> wrote:
> 
> another good one, but for intermediates
> 
> http://www.zend.com/zend/tut/session.php
> 
> ~viraj.
> 
> 
> On 9/6/05, Robert Graham <[EMAIL PROTECTED]> wrote:
> > Nahalingam Kanakavel wrote:
> >
> > >Hi all,
> > >
> > >I am new to PHP.
> > >I know some thing about SESSIONS in PHP, I am in need of your 
> suggestions.
> > >how to use sessions ?
> > >what is an efficient way to handle session_id ? like that.
> > >How efficiently we can use session concept in our web site development 
> ?
> > >how it is helpful.
> > >
> > >thanks in advance.
> > >
> > >
> > >
> > Good day
> >
> > Have a look at the following:
> > http://www.sitepoint.com/article/users-php-sessions-mysql
> >
> > Regards
> > Robert
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 



-- 
with regds,
Nahalingam.


[PHP] Re: 302 Responses (Was: session cookies)

2005-09-06 Thread Rasmus Lerdorf
Chris Shiflett wrote:
> 3. Chris's modified test script:
> 
> header('Location: http://www.php.net/');
> $fp = fopen('/tmp/log.txt', 'w');
> for ($i = 0; $i < 30; $i++)
> {
> $str = "Count $i\n";
> echo str_repeat($str, 1000);
> fputs($fp, $str);
> sleep(1);
> flush();
> }

This redirects right away for me.  Try it:

http://lerdorf.com/cs.php

Code at: http://lerdorf.com/cs.phps

No idea what you are doing on your end to get a different result.

-Rasmus

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



Re: [PHP] Re: 302 Responses (Was: session cookies)

2005-09-06 Thread Robin Vickery
On 9/6/05, Rasmus Lerdorf <[EMAIL PROTECTED]> wrote:
> Chris Shiflett wrote:
> > 3. Chris's modified test script:
> >
> > header('Location: http://www.php.net/');
> > $fp = fopen('/tmp/log.txt', 'w');
> > for ($i = 0; $i < 30; $i++)
> > {
> > $str = "Count $i\n";
> > echo str_repeat($str, 1000);
> > fputs($fp, $str);
> > sleep(1);
> > flush();
> > }
> 
> This redirects right away for me.  Try it:

And me, with Firefox, Links and wget:

[EMAIL PROTECTED]:~$ wget -S http://localhost/redir.php
--11:50:33--  http://localhost/redir.php
   => `redir.php'
Resolving localhost... 127.0.0.1
Connecting to localhost[127.0.0.1]:80... connected.
HTTP request sent, awaiting response...
 1 HTTP/1.1 302 Found
 2 Date: Tue, 06 Sep 2005 10:50:33 GMT
 3 Server: Apache/2.0.53 (Ubuntu) PHP/4.3.10-10ubuntu4.1
 4 X-Powered-By: PHP/4.3.10-10ubuntu4.1
 5 Location: http://www.php.net/
 6 Connection: close
 7 Content-Type: text/html; charset=UTF-8
Location: http://www.php.net/ [following]
--11:50:34--  http://www.php.net/
   => `index.html.1'
Resolving www.php.net... 64.246.30.37
Connecting to www.php.net[64.246.30.37]:80... connected.
HTTP request sent, awaiting response...
 1 HTTP/1.1 200 OK
 2 Date: Tue, 06 Sep 2005 10:35:07 GMT
 3 Server: Apache/1.3.26 (Unix) mod_gzip/1.3.26.1a PHP/4.3.3-dev
 4 X-Powered-By: PHP/4.3.3-dev
 5 Last-Modified: Tue, 06 Sep 2005 10:12:46 GMT
 6 Content-language: en
 7 Set-Cookie: COUNTRY=GBR%2C195.224.112.192; expires=Tue, 13-Sep-05
10:35:07 GMT; path=/; domain=.php.net
 8 Connection: close
 9 Content-Type: text/html;charset=ISO-8859-1

[<=>  
   ] 38,67530.18K/s

11:50:37 (30.13 KB/s) - `index.html.1' saved [38,675]

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



[PHP] owner of files created by fopen() become wrong?

2005-09-06 Thread Wong HoWang
Hi all,

I am so sorry that I have a lot of questions... This time I got a special 
issue... I have set up a VirtualHost for the domain that have problem. Since 
I am using Apache/1.3.33 , I have set the User & Group inside & outside the 
 ...   tags. As you know, the user & group 
set outside VirtualHost will be the user & group that the main server run 
with. And the one inside will be used for that domain only. The question 
comes, when I trying to run a script that use fopen('.xxx','w'); to 
create a file(or even create a dir), the file owner & group is 'apache', 
that is the user & group I run apache with, but NOT the one inside the 
!!! I have tried to restart my server and make sure the 
httpd.conf loaded corrrectly, but the question is still there, can anyone 
tell me how to solve this problem? Plesae help!

Thx! 

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



[PHP] php/mysql web question

2005-09-06 Thread bruce
hi...

if an app has a webpage that has to interface/display data from a mysql db,
does the app have to essentially do a new db_connection for each time that a
user accesses the page during the session.

as far as i can tell, it does.

in other words, the page would need to look something like:

  

the only reason i ask is that it would be nice/good if there was some way of
opening a connetion once for a given session (save bandwidth) as well as
somehow saving data from the db/tbl (short of using session vars)

thanks

-bruce
[EMAIL PROTECTED]

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



Re: [PHP] php/mysql web question

2005-09-06 Thread Mikey

bruce wrote:


hi...

if an app has a webpage that has to interface/display data from a mysql db,
does the app have to essentially do a new db_connection for each time that a
user accesses the page during the session.

as far as i can tell, it does.

in other words, the page would need to look something like:

 

the only reason i ask is that it would be nice/good if there was some way of
opening a connetion once for a given session (save bandwidth) as well as
somehow saving data from the db/tbl (short of using session vars)

thanks

-bruce
[EMAIL PROTECTED]

 


What you should use is a persistent connection - mysql_pconnect() - IIRC

HTH,

Mikey

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



Re: [PHP] php/mysql web question

2005-09-06 Thread Mikey

Mikey wrote:


bruce wrote:


hi...

if an app has a webpage that has to interface/display data from a 
mysql db,
does the app have to essentially do a new db_connection for each time 
that a

user accesses the page during the session.

as far as i can tell, it does.

in other words, the page would need to look something like:

 

the only reason i ask is that it would be nice/good if there was some 
way of

opening a connetion once for a given session (save bandwidth) as well as
somehow saving data from the db/tbl (short of using session vars)

thanks

-bruce
[EMAIL PROTECTED]

 


What you should use is a persistent connection - mysql_pconnect() - IIRC

HTH,

Mikey

Ooops, forgot the second part of your question - if you want to save the 
data from a query then you will have to use session vars, although only 
do this with data that you know will not change during the lifetime of a 
user session.


Mikey

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



Re: [PHP] owner of files created by fopen() become wrong?

2005-09-06 Thread Robin Vickery
On 9/6/05, Wong HoWang <[EMAIL PROTECTED]> wrote:
> I have set up a VirtualHost for the domain that have problem. Since
> I am using Apache/1.3.33 , I have set the User & Group inside & outside the
>  ...   tags. As you know, the user & group
> set outside VirtualHost will be the user & group that the main server run
> with. And the one inside will be used for that domain only.

Only for CGI requests. 

If you've configured PHP as an Apache module, it should still run as
the user that you specified in the main User directive.

http://httpd.apache.org/docs/1.3/mod/core.html#user

(read the "special note")

  -robin

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



[PHP] Problem with Apache+Fedora Core 4 + PHP Installation

2005-09-06 Thread Feris Thia C.
Hi All,

I'm using Fedora Core 4 (kernell 2.6.11-1.1369_FC4) and having problem when 
installing Apache + PHP... the configuration that I'm using :

1. Apache 2.0.54
./configure --prefix=/usr/local/apache2 --enable-so
make
make install
2. PHP 4.3.1
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql
make
make install

In Apache configuration file (httpd.conf) I adding these :

LoadModule php4_module modules/libphp4.so ===> line 232
AddType application/x-httpd-php .php

from compiling and installing process ... all run well... but when I'm 
starting apache

/usr/local/apache2/bin/apachectl start

I got this error :

Syntax error on line 232 of /usr/local/apache2/conf/httpd.conf

Cannot load /usr/local/apache2/modules/libphp4.so into server: 
/usr/local/apache2/modules/libphp4.so: cannot restore segement prot after 
reloc : Permission denied

I already consult documentation for LoadModule syntax and it looks ok.

Has the error something to do with SE Linux ??

Please give me some advices to resolve this :)

Best Regards,

Feris


[PHP] Apache Linux question

2005-09-06 Thread Feris Thia C.
Hi All,

If I already install my Apache on linux system, then is it possible to check 
what configuration settings I provided when compiling the source ?? 

Regards,

Feris


Re: [PHP] Apache Linux question

2005-09-06 Thread John Nichel

Feris Thia C. wrote:

Hi All,

If I already install my Apache on linux system, then is it possible to check 
what configuration settings I provided when compiling the source ?? 


/path/to/httpd -V

If that's not the info you're looking for, check the Apache docs.

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] Apache Linux question

2005-09-06 Thread Georgi Ivanov
It is no clear which option you are looking for.
If it's PHP compile options use :

This will give you information you need.

On Tuesday 06 September 2005 16:39, Feris Thia C. wrote:
> Hi All,
>
> If I already install my Apache on linux system, then is it possible to
> check what configuration settings I provided when compiling the source ??
>
> Regards,
>
> Feris

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



[PHP] Re: 302 Responses (Was: session cookies)

2005-09-06 Thread Chris Shiflett

Rasmus Lerdorf wrote:

This redirects right away for me. Try it:

http://lerdorf.com/cs.php

Code at: http://lerdorf.com/cs.phps


Thanks, that works. :-)

For reference, here's mine (temporary URL, of course):

http://shiflett.org/cs.php
http://shiflett.org/cs.phps

It's the same code, but it behaves differently. I don't have time to 
compare the responses, but I will later. My first instinct is that my 
server is buffering the response, but that was the first thing I checked 
when I was testing this locally.


Chris

--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/

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



[PHP] Confused about how to best execute php scripts in /cgi-bin/

2005-09-06 Thread KEVIN ZEMBOWER
I'm trying to allow php scripts to execute from the /cgi-bin/ directory, which 
is currently set up as a ScriptAlias in my Apache2 configuration. I've found 
lots of references to this, but there seems to be a couple of different ways to 
accomplish this, and I can't tell which one is recommended or safest. There 
seems to be lots of security risks associated with some of the solutions 
proposed.

I'm using Debian woody. This was working under Apache 1, but somehow upgrading 
to Apache 2 broke it, and I haven't been able to fix it.

I've found solutions involving changing the ScriptAlias directory to just an 
Alias, with ExecuteCGI turned on in the Apache2 configuration. I've also found 
adding an alias to the php4 executable in the cgi-bin directory and adding an 
Action and AddHandler to the configuration, but I wasn't able to get this 
working. I get the sense that changing the SafeMode section of 
/etc/php4/apache2/php.ini is the recommended, safest way, but I haven't been 
able to find any cookbook-style directions on what to change to allow the 
execution of the php scripts from /cgi-bin/.

Can anyone help me get this set up? Searching the archives of this list 
produced some information that seemed contradictory and I couldn't understand 
which methods were recommended.

Thank you for your help and advice.

-Kevin Zembower

-
E. Kevin Zembower
Internet Systems Group manager
Johns Hopkins University
Bloomberg School of Public Health
Center for Communications Programs
111 Market Place, Suite 310
Baltimore, MD  21202
410-659-6139

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



[PHP] Object Scope

2005-09-06 Thread Chuck Brockman
What is the best practice for calling objects that are to be used
throughout a users site visit.  For example, I have a members class
with two classes that extend this class.  Is it best to instantiate
the object in the $_Session scope or make individual calls to the
class/object.

For example:

class members {
var $iMemberID;
var $iProfileID;
var $dbServer;
var $dbUser;
var $dbPassword;
var $dbDSN;
var $_dbServer;
var $_dbUser;
var $_dbPassword;
var $_dbDSN;

function members($dbServer, $dbUser, $dbPassword, $dbDSN){
$this->_dbServer = $dbServer;
$this->_dbUser = $dbUser;
$this->_dbPassword = $dbPassword;
$this->_dbDSN = $dbDSN;
}
}

I have created a _global.php file that instantiates the object such as:

if(!isset($_SESSION["objMember"])){
 $_SESSION["objMember"] = new members($aSiteSettings["sDBServer"],
$aSiteSettings["sDBLogin"], $aSiteSettings["sDBPassword"],
$aSiteSettings["sDSN"]);
}

Or am I way off base altogether (wouldn't be too suprises)?

Thanks!

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



[PHP] Sessions , expiry times and different time zones

2005-09-06 Thread Dan Rossi
hi there I have run into problems with sessions , cookies and expiryt 
times with different time zones. Ie our server is in the States however 
I am browsing from Koala land downunder. I have been trying to get the 
session to expire in a day, however for ppl in the states this is ok, 
but for me its already expired so i have been experiencing issues. How 
do i solve this ?


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



Re: [PHP] Object Scope

2005-09-06 Thread Jason Davidson
I prefer to make the object on each page load, passing only the member id 
thru the session. 

Jason

On 9/6/05, Chuck Brockman <[EMAIL PROTECTED]> wrote:
> 
> What is the best practice for calling objects that are to be used
> throughout a users site visit. For example, I have a members class
> with two classes that extend this class. Is it best to instantiate
> the object in the $_Session scope or make individual calls to the
> class/object.
> 
> For example:
> 
> class members {
> var $iMemberID;
> var $iProfileID;
> var $dbServer;
> var $dbUser;
> var $dbPassword;
> var $dbDSN;
> var $_dbServer;
> var $_dbUser;
> var $_dbPassword;
> var $_dbDSN;
> 
> function members($dbServer, $dbUser, $dbPassword, $dbDSN){
> $this->_dbServer = $dbServer;
> $this->_dbUser = $dbUser;
> $this->_dbPassword = $dbPassword;
> $this->_dbDSN = $dbDSN;
> }
> }
> 
> I have created a _global.php file that instantiates the object such as:
> 
> if(!isset($_SESSION["objMember"])){
> $_SESSION["objMember"] = new members($aSiteSettings["sDBServer"],
> $aSiteSettings["sDBLogin"], $aSiteSettings["sDBPassword"],
> $aSiteSettings["sDSN"]);
> }
> 
> Or am I way off base altogether (wouldn't be too suprises)?
> 
> Thanks!
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>


Re: [PHP] Apache Linux question

2005-09-06 Thread Jason Davidson
If you compiled it, you can goto the src directory, and log under config.log
Jason

On 9/6/05, Georgi Ivanov <[EMAIL PROTECTED]> wrote:
> 
> It is no clear which option you are looking for.
> If it's PHP compile options use :
>  echo phpinfo();
> ?>
> This will give you information you need.
> 
> On Tuesday 06 September 2005 16:39, Feris Thia C. wrote:
> > Hi All,
> >
> > If I already install my Apache on linux system, then is it possible to
> > check what configuration settings I provided when compiling the source 
> ??
> >
> > Regards,
> >
> > Feris
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>


Re: [PHP] Sessions , expiry times and different time zones

2005-09-06 Thread Jordan Miller

Hi  Dan,

Couldn't you store an expiration time directly in the $_SESSION  
variable, rather than relying on cookie expiration (if I  understand  
your question correctly)?  Each time a page is loaded, update the  
expiration time in this variable to +24hr from the current time (all  
times relative to the server's time). Then, it shouldn't matter from  
which time zone the user is browsing.


Jordan



On Sep 6, 2005, at 10:37 AM, Dan Rossi wrote:


hi there I have run into problems with sessions , cookies and  
expiryt times with different time zones. Ie our server is in the  
States however I am browsing from Koala land downunder. I have been  
trying to get the session to expire in a day, however for ppl in  
the states this is ok, but for me its already expired so i have  
been experiencing issues. How do i solve this ?


--
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] php equivalent for cut

2005-09-06 Thread Michelle Konzack
Hello, 

I am searching for the right equivalent for "cut -d : -f5"
but it must work with php4.

Since the website  has no
seperated manuals for php4 and php5, it is not easy to
find the right stuff.

Greetings and good evening
Michelle

-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSM LinuxMichi
0033/3/8845235667100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


[PHP] Sessions, URL, --enable-trans-id

2005-09-06 Thread Dan Baker
I am using sessions, but every relative URL gets a "?PHPSESSID=..." appended 
to it.  I'm assuming this is happening because of some setting that has been 
set in PHP. I work on an ISP server, so I don't have much control over the 
PHP configuration.

Is there any way I can turn this "feature" off, even though I don't have 
access to the configuration files?

Thanks
DanB

PS I'm using cookies to propagate the SID (which works), but the argument is 
still appended to every URL.

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



Re: [PHP] php equivalent for cut

2005-09-06 Thread tg-php
The closest you get to 'cut' in PHP is probably the 'explode' command.  It 
splits a string by a delimiter like 'cut' does, only it dumps the results into 
an array:

$etcpasswd = "username:passwd:123:345::/home/username:/bin/sh";

$pwdarr = explode(":", $etcpasswd);

echo $pwdarr[4];

That should give you the 5th 'column' of the $etcpasswd string.

OR.. you could do this:

list($username, $passwd, $userid, $groupid, $something, $homedir, $defshell) = 
explode(":", $etcpasswd);

That'll take the array returned from explode() and put it into the variables 
used in $list.  It's been ages since I've messed with *nix /etc/passwd files, 
so forgive any inaccuracies in the field names I've used above.  You get the 
idea though.

Good luck Michelle!

-TG

= = = Original message = = =

Hello, 

I am searching for the right equivalent for "cut -d : -f5"
but it must work with php4.

Since the website  has no
seperated manuals for php4 and php5, it is not easy to
find the right stuff.

Greetings and good evening
Michelle


___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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



Re: [PHP] Re: 302 Responses (Was: session cookies)

2005-09-06 Thread Robin Vickery
On 9/6/05, Chris Shiflett <[EMAIL PROTECTED]> wrote:
> Rasmus Lerdorf wrote:
> > This redirects right away for me. Try it:
> >
> > http://lerdorf.com/cs.php
> >
> > Code at: http://lerdorf.com/cs.phps
> 
> Thanks, that works. :-)
> 
> For reference, here's mine (temporary URL, of course):
> 
> http://shiflett.org/cs.php
> http://shiflett.org/cs.phps
> 
> It's the same code, but it behaves differently. I don't have time to
> compare the responses, but I will later. My first instinct is that my
> server is buffering the response, but that was the first thing I checked
> when I was testing this locally.
> 

You've got mod_gzip installed. 

If you send a GET request without  "Accept-Encoding: gzip,deflate
" then you'll get an immediate redirect from your server as well.

-robin

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



[PHP] Re: FTP Chmod problem

2005-09-06 Thread Al

Matt Palermo wrote:
Hello everyone.  I have a script where I am using FTP functions to chmod 
files/folders.  I'm running into a problem with the ftp_chmod() function 
when trying to change the permissions of a directory.  Here is the code I'm 
using:


ftp_chmod($connId, 0777, $folder);

The function almost works, but when I check the permission of the folder 
after it's run, the folder has 410 for permissions instead of 777.  So, it 
is changing the permissions, but not to the correct value.  Now when I use 
the following code, it seems to work fine:


$chmodCmd = "CHMOD 0777 ".$file;
ftp_site($connId, $chmodCmd);

This properly changes the folder permissions to 777.  Does anyone know why 
the ftp_chmod() function doesn't work correctly?  As a side note, the 
ftp_chmod() function works correctly on a file, but not a directory.  Any 
help is appreciated.


Thanks,

Matt Palermo
http://sweetphp.com 



Which php version are you using?  PHP 4x does not have ftp_chmod(); It does 
have ftp_site()

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



[PHP] Create a new $_COOKIE["PHPSESSID"] in PHP4.3.1

2005-09-06 Thread zzapper
Hi,
Php 4,3,2 has a regenerate session id function session_regenerate_id

un4tunately I 'm stuck with 4.3.1

The following doesn't seem to work

// Unset session data
$_SESSION=array();
// Clear cookie
unset($_COOKIE[session_name()]);
// Destroy session data
session_destroy();


Unless I close and reopen IE I always get the same session Id

Can ye help?

-- 
zzapper
Success for Techies and Vim,Zsh tips
http://SuccessTheory.com/

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



[PHP] regular expression for integer range

2005-09-06 Thread babu
Hi all,
 
 
I want to write regular expression for checking the string format entered by 
user.
 
the allowed formats are
 
examples:
10
10,
10,12-10
12-10
 
that is the valid strings are:
1. only integer
2. an integer, range of integers example 3
 
and no other characters must be allowed.
 
thanks
babu.
 


-
How much free photo storage do you get? Store your holiday snaps for FREE with 
Yahoo! Photos. Get Yahoo! Photos

[PHP] Re: php equivalent for cut

2005-09-06 Thread Matthew Weier O'Phinney
* Michelle Konzack <[EMAIL PROTECTED]>:
> I am searching for the right equivalent for "cut -d : -f5"
> but it must work with php4.

$fields = explode(':', $string, 5);

> Since the website  has no
> seperated manuals for php4 and php5, it is not easy to
> find the right stuff.

explode() works the same in both PHP4 and PHP5. Additionally, the manual
is very good at detailing in what versions of PHP a function is valid.

-- 
Matthew Weier O'Phinney
Zend Certified Engineer
http://weierophinney.net/matthew/

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



Re: [PHP] regular expression for integer range

2005-09-06 Thread Philip Hallstrom




On Tue, 6 Sep 2005, babu wrote:


Hi all,


I want to write regular expression for checking the string format entered by 
user.

the allowed formats are

examples:
10
10,
10,12-10
12-10

that is the valid strings are:
1. only integer
2. an integer, range of integers example 3

and no other characters must be allowed.


ereg("^[-0-9,]+$"...

would do it, but it would also allow "10,-" as a valid expression as 
well.. so if you want to check for valid ranges you'll want to beef that 
up a bit...


-philip

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



Re: [PHP] regular expression for integer range

2005-09-06 Thread John Nichel

babu wrote:

Hi all,
 
 
I want to write regular expression for checking the string format entered by user.
 
the allowed formats are
 
examples:

10
10,
10,12-10
12-10
 
that is the valid strings are:

1. only integer
2. an integer, range of integers example 3
 
and no other characters must be allowed.


Crude, but it will work

preg_match ( "/^[-0-9,]+$/", $value )

It will also match just dashes and/or just comma's with no numbers.

http://us2.php.net/manual/en/reference.pcre.pattern.syntax.php

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] Re: php equivalent for cut

2005-09-06 Thread Philip Hallstrom

I am searching for the right equivalent for "cut -d : -f5"
but it must work with php4.


$fields = explode(':', $string, 5);


Hmmm.. that's going to create a 5 element array assigned to $fields.  So, 
using /etc/passwd as an example...


philip:*:1000:1000:Philip Hallstrom:/local/home/philip:/bin/tcsh

$fields is going to look like this:

0 = philip
1 = *
2 = 1000
3 = 1000
4 = Philip Hallstrom:/local/home/philip:/bin/tcsh

I think what he really wants is:

$fields = explode(':', $string);
$fullname = $fields[4]; // Philip Hallstrom


-philip

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



Re: [PHP] php/mysql web question

2005-09-06 Thread Murray @ PlanetThoughtful

> hi...
> 
> if an app has a webpage that has to interface/display data from a mysql
> db,
> does the app have to essentially do a new db_connection for each time that
> a
> user accesses the page during the session.
> 
> as far as i can tell, it does.
> 
> in other words, the page would need to look something like:
> 
>start the page
> do the db_connect
> do the db_query
> process the information from the db/tbl
> close the db_connection
>   ?>
> 
> the only reason i ask is that it would be nice/good if there was some way
> of
> opening a connetion once for a given session (save bandwidth) as well as
> somehow saving data from the db/tbl (short of using session vars)

Hi Bruce,

Basically what you're asking about is persistent connections from PHP to
MySQL, which are performed using mysql_pconnect().

In the pseudo-code outline you have above, you don't need to perform the
'close the db_connection' step. Each time a page loads that has a
mysql_pconnect statement, it will check to see if an existing (or persisted)
connection is available, and will use it instead of creating a new
connection, if one does. If no persisted connection is found to be
available, mysql_pconnect goes ahead and creates the connection, and
persists it for future connection attempts.

Each page should still probably perform the mysql_pconnect function, since
unless you have a very statically defined interaction of pages, you may not
be able to guarantee that a connection already exists when a particular page
is loaded.

Don't forget that while closing the db connection isn't necessary on a
page-by-page basis when using persistent connections, you should still
habitually free recordsets either at the bottom of the page, or at a point
in your code where you know they are no longer needed.

Hope this helps a little.

Much warmth,

Murray
---
"Lost in thought..."
http://www.planetthoughtful.org

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



[PHP] php mailing list/email app

2005-09-06 Thread bruce
hey,

can anyone tell me if there's a good/serious email/newsletter list manager
app for php similar to 'python/mailman'

thanks

bruce
[EMAIL PROTECTED]


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



[PHP] Re: Re: php equivalent for cut

2005-09-06 Thread Michelle Konzack
Hi Phil,

Am 2005-09-06 11:22:11, schrieb Philip Hallstrom:

> Hmmm.. that's going to create a 5 element array assigned to $fields.  So, 
> using /etc/passwd as an example...

:-)

> $fields = explode(':', $string);
> $fullname = $fields[4]; // Philip Hallstrom

Thanks.

Greetings
Michelle

-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSM LinuxMichi
0033/3/8845235667100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


[PHP] Sending different languages to GD

2005-09-06 Thread Graham Anderson

How can I get Polish , iso-8859-2, text,  to output properly ?
PHP is reading the accent characters as blocks

I tried this, but it did not work...

// Set up text for a 'Polish' button
$text = "rozwiązania";
$text = mb_convert_encoding($text, "iso-8859-2","Auto");

//  Composit the text over a button image and output it
imagettftext($im, $fontSize, 0, 11, 16, $white, $font, $text);

Ultimately, I want to pass a $language variable to the script to get it 
to output to any number of supported languages

is there a simple function that does this ?

many thanks in advance :)
g

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



Re: [PHP] php mailing list/email app

2005-09-06 Thread Rory Browne
try hotscripts.com

On 9/6/05, bruce <[EMAIL PROTECTED]> wrote:
> hey,
> 
> can anyone tell me if there's a good/serious email/newsletter list manager
> app for php similar to 'python/mailman'
> 
> thanks
> 
> bruce
> [EMAIL PROTECTED]
> 
> 
> --
> 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] Re: php equivalent for cut

2005-09-06 Thread Michelle Konzack
Hi,

Am 2005-09-06 12:18:18, schrieb [EMAIL PROTECTED]:

> $etcpasswd = "username:passwd:123:345::/home/username:/bin/sh";
> $pwdarr = explode(":", $etcpasswd);
> echo $pwdarr[4];

OK, this works now.

But can I read a whome /etc/passwd into an 3d array ?
This would avoid multiple reads...

I know, that I can have a file as array with file() but
whats the best solution to put it into 3D style ?

I need only to extract the $USER, $GEKO and $HOMEDIR for
UID >= 1000.

Greetings
Michelle

-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSM LinuxMichi
0033/3/8845235667100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


[PHP] really basic question

2005-09-06 Thread Adi Zebic

Hi folks,

It is permited to do something like this in the functions "body"


cellpadding="0">



Thanks a lot,

ADI

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



Re: [PHP] Re: php equivalent for cut

2005-09-06 Thread Philip Hallstrom

Am 2005-09-06 12:18:18, schrieb [EMAIL PROTECTED]:


$etcpasswd = "username:passwd:123:345::/home/username:/bin/sh";
$pwdarr = explode(":", $etcpasswd);
echo $pwdarr[4];


OK, this works now.

But can I read a whome /etc/passwd into an 3d array ?
This would avoid multiple reads...

I know, that I can have a file as array with file() but
whats the best solution to put it into 3D style ?

I need only to extract the $USER, $GEKO and $HOMEDIR for
UID >= 1000.


Why not use posix_getpwuid()?

http://us2.php.net/manual/en/function.posix-getpwuid.php

-philip

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



Re: [PHP] Session expires randomly

2005-09-06 Thread Mauricio Pellegrini
You were right! That was exactly the problem
after reading your message, I 've verified the value for gc_maxlifetime
and found that it was set to 1440 secs in other words 24 minutes.

Thank you for that.

But, now I need to come up with something to avoid this behaviour.

The problem is that there's a second php application ruuning on the same
server and I don't want to change the default for gc_maxlilfetime,

So I was thinking on implementing some sort of automatic session refresh
after a short period, let's say every 20 minutes of inactivity.

And of course I should provide the users with a manual way to make
session end, sort of a logout from the application.( no problem with
that)

My question is:

 Is there a way to set sort of a timer as to invoke an hipothetical
"refresh_session.php" without reloading the current page on the client?

Thanks
 Mauricio.



On Fri, 2005-09-02 at 14:20, [EMAIL PROTECTED] wrote:
> > On Fri, 2 Sep 2005, Mauricio Pellegrini wrote:
> > 
> > > Hi, I have this problem , When I start a Session everything seems to 
> be
> > > ok but sometimes with no reason the session vanishes.
> > >
> > > All settings are default , I mean session_cache_expire is 180 min.
> > > I understand that this setting should make sessions last for at least 
> 3
> > > hours but in my case it seems not to be true since the real duration
> > > varies from 20 minutes to an hour
> 
> I think the parameter you need to look at in php.ini is 
> session.gc_maxlifetime. It sets the session lifetime, not 
> session_cache_expire. The default lifetime is probably 1440 seconds, 
> roughly 20 minutes, so the behavior you are seeing is completely normal - 
> it's all working as it should.
> 
> Kirk

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



[PHP] Re: Re: php equivalent for cut

2005-09-06 Thread Michelle Konzack
Hi Phil,

Am 2005-09-06 15:14:59, schrieb Philip Hallstrom:

> Why not use posix_getpwuid()?

Good question...  :-)

> http://us2.php.net/manual/en/function.posix-getpwuid.php

This was a great IDEA...

> -philip

Thanks and good night
Michelle

-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSM LinuxMichi
0033/3/8845235667100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


Re: [PHP] Session expires randomly

2005-09-06 Thread Philip Hallstrom



On Tue, 6 Sep 2005, Mauricio Pellegrini wrote:


You were right! That was exactly the problem
after reading your message, I 've verified the value for gc_maxlifetime
and found that it was set to 1440 secs in other words 24 minutes.

Thank you for that.

But, now I need to come up with something to avoid this behaviour.

The problem is that there's a second php application ruuning on the same
server and I don't want to change the default for gc_maxlilfetime,



Why not just change it on your pages?  The manual says it can get changed 
anywhere... so just make a call to ini_set() on your pages and other 
scripts will remain unaffected.


?






So I was thinking on implementing some sort of automatic session refresh
after a short period, let's say every 20 minutes of inactivity.

And of course I should provide the users with a manual way to make
session end, sort of a logout from the application.( no problem with
that)

My question is:

 Is there a way to set sort of a timer as to invoke an hipothetical
"refresh_session.php" without reloading the current page on the client?

Thanks
Mauricio.



On Fri, 2005-09-02 at 14:20, [EMAIL PROTECTED] wrote:

On Fri, 2 Sep 2005, Mauricio Pellegrini wrote:


Hi, I have this problem , When I start a Session everything seems to

be

ok but sometimes with no reason the session vanishes.

All settings are default , I mean session_cache_expire is 180 min.
I understand that this setting should make sessions last for at least

3

hours but in my case it seems not to be true since the real duration
varies from 20 minutes to an hour


I think the parameter you need to look at in php.ini is
session.gc_maxlifetime. It sets the session lifetime, not
session_cache_expire. The default lifetime is probably 1440 seconds,
roughly 20 minutes, so the behavior you are seeing is completely normal -
it's all working as it should.

Kirk


--
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] Sending different languages to GD

2005-09-06 Thread Graham Anderson

How can I get Polish , iso-8859-2, text,  to output properly ?
PHP is reading the accent characters as blocks

I tried this, but it did not work...

// Set up text for a 'Polish' button
$text = "rozwiązania";
$text = mb_convert_encoding($text, "iso-8859-2","Auto");

//  Composit the text over a button image and output it
imagettftext($im, $fontSize, 0, 11, 16, $white, $font, $text);

Ultimately, I want to pass a $language variable to the script to get it 
to output to any number of supported languages

is there a simple function that does this ?

many thanks in advance :)
g

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



Re: [PHP] Sending different languages to GD [apologize for resend]

2005-09-06 Thread Graham Anderson

sorry about that

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



Re: [PHP] Sending different languages to GD

2005-09-06 Thread Chris
Note: I haven't actually ever tried to put non-latin character s in an 
image, but I think this is the proper thing to do.


First of all, I believe imagettftext() accepts string in the UTF-8 
encoding. SO, the first thing to try would be to convert to UTF-8l


mb_convert_encoding($text, 'UTF-8','iso-8859-2');

And, if that doesn't work. Ensure the font you're specifying can handle 
the characters you're giving it. (Arial Unicode would probably be a safe 
test font)


hope this helped.

Chris

Graham Anderson wrote:


How can I get Polish , iso-8859-2, text,  to output properly ?
PHP is reading the accent characters as blocks

I tried this, but it did not work...

// Set up text for a 'Polish' button
$text = "rozwiązania";
$text = mb_convert_encoding($text, "iso-8859-2","Auto");

//  Composit the text over a button image and output it
imagettftext($im, $fontSize, 0, 11, 16, $white, $font, $text);

Ultimately, I want to pass a $language variable to the script to get 
it to output to any number of supported languages

is there a simple function that does this ?

many thanks in advance :)
g



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



Re: [PHP] really basic question

2005-09-06 Thread Miles Thompson

Adi,

Every time I was about to ask a question along the lines of "Can you do 
...?" or "Is it possible to ...", and really embarrass myself, this thought 
popped up: "Self, why don't you just try it, and see if it works."


After you try it, and it breaks, that's the time to ask. After all, to the 
PHP Engine a script is essentially a bunch of functions, or maybe one 
longish function.


Cheers - Miles


At 06:50 PM 9/6/2005, Adi Zebic wrote:

Hi folks,

It is permited to do something like this in the functions "body"





Thanks a lot,

ADI

--
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] Sending different languages to GD

2005-09-06 Thread Graham Anderson

Now, I think it is a text editor problem..

My text editor, BBedit, is set to utf8 encoding .
When I set encoding to utf-8, php outputs a blank screen...

If I set BBedit to Unix with Mac-Roman encoding, the php script 
executes  but screws up the Polish language


Regardless, the php script looks fine within BBedit regardless of the 
text encode value...



If I use a  Simple/Free Text editor:
If I copy the BBedit text into a simple/free  text editor, and then 
copy/paste this text to the original php script on the server...

everything renders properlyno problems at all

anyone know what this could be ?

g

On Sep 6, 2005, at 4:46 PM, Chris wrote:

Note: I haven't actually ever tried to put non-latin character s in an 
image, but I think this is the proper thing to do.


First of all, I believe imagettftext() accepts string in the UTF-8 
encoding. SO, the first thing to try would be to convert to UTF-8l


mb_convert_encoding($text, 'UTF-8','iso-8859-2');

And, if that doesn't work. Ensure the font you're specifying can 
handle the characters you're giving it. (Arial Unicode would probably 
be a safe test font)


hope this helped.

Chris

Graham Anderson wrote:


How can I get Polish , iso-8859-2, text,  to output properly ?
PHP is reading the accent characters as blocks

I tried this, but it did not work...

// Set up text for a 'Polish' button
$text = "rozwiązania";
$text = mb_convert_encoding($text, "iso-8859-2","Auto");

//  Composit the text over a button image and output it
imagettftext($im, $fontSize, 0, 11, 16, $white, $font, $text);

Ultimately, I want to pass a $language variable to the script to get 
it to output to any number of supported languages

is there a simple function that does this ?

many thanks in advance :)
g



--
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] Installing 4.3.0 and Apache 2.0.54 DSO

2005-09-06 Thread Rob Tanner

Hi,

I'm trying to build PHP 4.3.0 as a DSO for Apache 2.0.54, and I get the 
following error running configure:


checking for Apache 2.0 module support via DSO through APXS... 


Sorry, I cannot run apxs.  Possible reasons follow:

1. Perl is not installed
2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs
3. Apache was not built using --enable-so (the apxs usage page is displayed)

The output of /usr/local/apache2/bin/apxs follows:
Usage: apxs -g [-S =] -n 
  apxs -q [-S =]  ...
  apxs -c [-S =] [-o ] [-D [=]]
  [-I ] [-L ] [-l ] [-Wc,]
  [-Wl,] [-p]  ...
  apxs -i [-S =] [-a] [-A] [-n ]  ...
  apxs -e [-S =] [-a] [-A] [-n ]  ...
configure: error: Aborting


The configure option is --with-apxs2=/usr/local/apache2/bin/apxs.  The 
file does exist and the path to perl is correct and apache was 
explicitly build with --enable-so (and when I invoke apache with the -l 
option to list the built-in modules, mod.so.c shows up).


So, having satisfied myself that reasons 1 thru 3 don't apply, any idea 
what else might be causing this problem?


Thanks,
Rob

--

Rob Tanner
UNIX Services Manager
Linfield College, McMinnville OR

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



[PHP] Uploading a file

2005-09-06 Thread Josh

Hi
	I have recently been working on a site which allows the user to upload 
a file to the site. Originally calling the $_FILES['file']['tmp_name'] 
worked fine, however the web host has now disabled all global variables 
and if I'm not mistaken $_FILES is global. Does anyone know of a work 
around for this?


Cheers.
Josh

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



Re: [PHP] Sessions , expiry times and different time zones

2005-09-06 Thread Dan Rossi

client cookie expires hence no more session ...

On 07/09/2005, at 1:57 AM, Jordan Miller wrote:


Hi  Dan,

Couldn't you store an expiration time directly in the $_SESSION 
variable, rather than relying on cookie expiration (if I  understand 
your question correctly)?  Each time a page is loaded, update the 
expiration time in this variable to +24hr from the current time (all 
times relative to the server's time). Then, it shouldn't matter from 
which time zone the user is browsing.


Jordan



On Sep 6, 2005, at 10:37 AM, Dan Rossi wrote:


hi there I have run into problems with sessions , cookies and expiryt 
times with different time zones. Ie our server is in the States 
however I am browsing from Koala land downunder. I have been trying 
to get the session to expire in a day, however for ppl in the states 
this is ok, but for me its already expired so i have been 
experiencing issues. How do i solve this ?


--
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] Re: AND OR NOT

2005-09-06 Thread John Taylor-Johnston

Jasper Bryant-Greene wrote:


John Taylor-Johnston wrote:

I'm under pressure to permit AND, OR & NOT. My research group insists 
that MySQL 4 syntax is "not good enough".
An idea of what one might enter is here (on the bottom):  
http://compcanlit.usherbrooke.ca/advanced.html
I was hoping to get away with replacing " AND " with "+", " NOT " 
with "-" and " OR " with " ".

I use this as SQL:
SELECT *,MATCH 
(YR,AU,ST,SD,SC,BT,BD,BC,AT,AD,AC,JR,KW,AUS,TUS,GEO,AN,SA,RB)

AGAINST ('$mydata->searchenquiry' IN BOOLEAN MODE)
AS relevancy FROM ccl_main
WHERE MATCH 
(YR,AU,ST,SD,SC,BT,BD,BC,AT,AD,AC,JR,KW,AUS,TUS,GEO,AN,SA,RB)

AGAINST ('$mydata->searchenquiry' IN BOOLEAN MODE)
ORDER BY relevancy DESC;-->


Please don't top-post [1]. Nice cryptic column names, by the way :)
Your research group obviously haven't researched very carefully, as 
"+term" is exactly equal to " AND term", "-term" to " NOT term" and 
simply "term" to " OR term". So there's no point in complicating the 
syntax.
Not only that, but MySQL's boolean mode fulltext search offers many 
more great possibilities like truncation ("app*" will match "apple", 
"application"...) and in-query relevance altering. Take a look at the 
BOOLEAN MODE section of the MySQL manual [2]; maybe print it and give 
it to your research group :)

[1] http://en.wikipedia.org/wiki/Top-posting
[2] http://dev.mysql.com/doc/mysql/en/fulltext-boolean.html


Jasper,

God only knows I have tried. They're old school, what more can I say. If 
you knew how hard it was to sell them on using PHP-MySQL, when the 
project was floundering on a MS-Access & ASP server ! They insist on 
AND, OR & NOT - I have tried. Heck, I have an advanced page with it all 
spelled out. But it is a good project to hone my owns skills on.


So ... a simple str_replace will work. str_replace is case sensitive, if 
I read the manual correctly?


I can get away with: " AND " with "+", " NOT " with "-" and " OR " with 
" " ?


Top-posting? Oh, sorry. I guess I'm old school and stubborn myself. Ok, 
I'll try working on the bottom of the page.


John

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



[PHP] Re: 302 Responses (Was: session cookies)

2005-09-06 Thread Rasmus Lerdorf
Chris Shiflett wrote:
> Rasmus Lerdorf wrote:
> 
>> This redirects right away for me. Try it:
>>
>> http://lerdorf.com/cs.php
>>
>> Code at: http://lerdorf.com/cs.phps
> 
> 
> Thanks, that works. :-)
> 
> For reference, here's mine (temporary URL, of course):
> 
> http://shiflett.org/cs.php
> http://shiflett.org/cs.phps
> 
> It's the same code, but it behaves differently. I don't have time to
> compare the responses, but I will later. My first instinct is that my
> server is buffering the response, but that was the first thing I checked
> when I was testing this locally.

Are you using mod_gzip perhaps?

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



Re: [PHP] Re: PHP/MySQL offline

2005-09-06 Thread Joe Wollard
... an automated script that creates a static site that will  
allow me to do

that?
If all you're really looking for is a static version of your site  
then you could simply use wget. This will crawl all of the links on  
your site and generate the static version you wanted.


On Sep 5, 2005, at 11:11 PM, viraj wrote:


On 9/4/05, John Taylor-Johnston
<[EMAIL PROTECTED]> wrote:


This is maybe what you want:
http://www.indigostar.com/
http://www.indigostar.com/microweb.htm



another good method is a "Live Linux CD". you can find a light weight
live linux distro and remaster it to include your live web site. so
your client can put boot his/her pc with this cd and start browsing
the site.

this way you can use whatever the LAMP combination!

http://www.google.com/search?hl=en&q=howto+remaster&spell=1
http://taprobane.org/

~viraj.



Runs an apache server, php & all, from a CD. (windows app.)
John

Mario netMines wrote:



Hi all

I have a project where I'm using PHP/Mysql. The client wants to run
that project to a cd.
Does anyone know of a trick either by using javascript, XML or an
automated script that creates a static site that will allow me to do
that?

Many Thanks

M



--
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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Parsing MS-WORD docs

2005-09-06 Thread Shafiq Rehman
Hello,

I want to parse the .doc files with PHP. Anybody have some idea regarding 
this problem.

Your help regarding this matter is really appreciated

Regards
-- 

PHP is too logical for my brain (http://www.phpgurru.com)