Re: [PHP] Return mysql_fetch_array($result) from a function

2003-11-05 Thread David Otton
On Wed, 5 Nov 2003 14:53:15 +0800, you wrote:

>I am trying to get the results of a function, which queries MySQL, back into
>an array for me to order. I only want to print out certain fields (I call
>the same query, but use different fields in different places).

>Can someone perhaps show me how to do it (or point me in the right
>direction), since I need to do this:

It depends on exactly how your data is formatted, which you don't tell us.
I'm going to assume your query returns two values, id and name, and you want
them returned as a dictionary.

Probably the simplest way is to build an array as you iterate over the
query, then return it. Something like:

function ReturnSQLResults() {



$result = array ();

$rs = $mysql_query($sql);

if ($rs == FALSE)
{
return (NULL);
}

while (($row = mysql_fetch_array ($rs)) != FALSE)
{
$result[$row['id']] = $row['name'];
}

if (sizeof ($result) == 0)
{
return (FALSE);
}

return ($result);
}

You now have a function that returns NULL on error, FALSE if no records were
found, else an array of (id => name)

If you're returning more than two values, you'll probably want your array
structure to be:

(id => array(firstname, lastname))

in which case try

$result [$row['id']] = array ($row['firstname', $row['lastname']);

if you just want a straight array-of-arrays, something like

((id, firstname, lastname), (id, firstname, lastname))

then

$result[] = array($row['id', $row['firstname', $row['lastname')

will do it.

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



Re: [PHP] help with EVAL direct

2003-11-05 Thread j . sobotka
"Cpt John W. Holmes" wrote:

> From: <[EMAIL PROTECTED]>
>
> > OS RedHat 9 and RedHat 7.2
> > Apache 1.3.27 and Apache 2
> >
> > I have problem with direct eval, in version PHP4.2.2 is all OK
> > in version PHP 4.3.3 -> direct eval bad
> >
> > here cut code
> >
> > $s = '$ret = ibase_execute($this->query, $arg_list[0], $arg_list[1],
> > $arg_list[2], $arg_list[3], $arg_list[4], $arg_list[5], $arg_list[6]);';
> >
> > eval($s);
> >
> > end cut code
> >
> > in PHP 4.3.3 -> log message
> > [Tue Nov  4 08:37:07 2003] [error] PHP Warning:  ibase_execute():
> > attempted update during read-only transaction  in
> > /www/test.php(204) : eval()'d code on line 1
> >
> > not write to DB
>
> Wild guess here, but it looks like you're trying to do an UPDATE query where
> you're only allowed to do a SELECT query (read-only). The error is not
> because of eval(), it's because of an incorrect usage of ibase_execute().
>
> ---John Holmes...

Thanks you,

I'm not understant, in version PHP 4.2.2 ext. modul interbase is OK. Function
ibase_execute, write with parameter work OK.
I'm change in ext. modul interbase function ibase_execute, now is working OK.

Jiri Sobotka

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



[PHP] Building PHP source for Linux / Unix.

2003-11-05 Thread Ananth Kesari
Hi,

I am a beginner to building PHP source code for Linux / Unix. I am
looking for a document that takes me through a step-by-step guidelines
of doing this. Can someone point to a link for this?

Thanks,
Ananth.

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



Re: [PHP] [Stats] PHP Net List: October 2003

2003-11-05 Thread Burhan Khalid
John Nichel wrote:


Hey, I beat John Holmes  That's me baby, quanity, not quality.  ;)
Yeah apparently it is :P

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Handling checkboxes that aren't checked!!!

2003-11-05 Thread Ford, Mike [LSS]
On 04 November 2003 20:43, Pablo Gosse contributed these pearls of wisdom:

> On Tuesday, November 04, 2003 12:45 PM Kevin wrote:
> 
> [snipped]
>> How can I test for it without getting an error if it is not
> checked??
> [/snipped]
> 
> Hey Kevin.  Use isset($var) to test if a var has been set.
> 
> So you would need:
> 
> If (isset($_POST['checkboxname']) && $_POST['checkboxname'] ==
>   'on')

Personally, I prefer to use the @ error-suppression operator for this:

if (@$_POST['checkboxname'] == 'on')
{ echo 'Selected';

> }
> else
> {
>   echo 'Not selected';
> }

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211

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



Re: [PHP] Building PHP source for Linux / Unix.

2003-11-05 Thread Chris Hayes
At 10:00 5-11-03, you wrote:
Hi,

I am a beginner to building PHP source code for Linux / Unix. I am
looking for a document that takes me through a step-by-step guidelines
of doing this. Can someone point to a link for this?
did you find http://nl.php.net/manual/en/installation.php ?

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


[PHP] create a php timetable problem.

2003-11-05 Thread irinchiang


Hi all:
A question to ask all PHP programmers out there...
Right now I am doing a timetable system whereby in each cell, it will display 
a class code eg.3PE1234. But right now I want it to be in the way that I want 
the user to be able to add the class code to the table cell through a user 
interface. I was thinking I could put a "-"(dash) in all my cell which will be 
clickable. When user click on this "dash" they will be directed to a user 
interface with a drop down menu of class codes. (Class codes are retrieved 
from database). I will then select the class code I would like to put into 
this cell. Once submit, I will be linked back to the timetable , this time the 
cell should display the class code I have added to the cell earlier on. Any 
idea how can I go about doing this??...But anyway, I  find this solution is 
not ass user friendly as user will have to add class codes to the cell by a 
clicking "cell-by-cell".

 As each cell represents which day and what time the class will be 
held. I was thinking of an alternate solution whereby I can create an user 
interface such that when I have a drop down menu displaying the time eg.
1. 12.00-14.00
2. 14.00-16.00
3. 16.00-18.00
etc.

and another drop down displaying the day (in my case, it is display as the 
column) eg.

1. Monday
2.Tuesday
3. Wednesday
4. Thursday
5. Friday

etc
and then lastly the drop down menu to display my class where I can select the 
class I want to add to the cell on that particular DAY and TIME

For example, I would like to add the class "3PM1010" to the cell when the time 
is "12.00-14.00" and the day is on "Monday", and thus I will select the 
prospective value from each of the drop down menu from the above drop down 
menu.

I hope I have made myself clear enough and really hope to receive some help 
real soon. If there should be any doubts, feel free to drop me an email.

All help are greatly appreciated.

Warmest regards, 
Irin.

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



Re: [PHP] [Stats] PHP Net List: October 2003

2003-11-05 Thread John W. Holmes
John Nichel wrote:

Hey, I beat John Holmes  
You mean you're bigger than 14 inc... err, nevermind, you're talking 
about something else...

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


Re: [PHP] [Stats] PHP Net List: October 2003

2003-11-05 Thread Roger Spears
That is funny stuff..I often wonder why no one ever cracks jokes or 
makes a connection...

John W. Holmes wrote:

John Nichel wrote:

Hey, I beat John Holmes  


You mean you're bigger than 14 inc... err, nevermind, you're talking 
about something else...



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


[PHP] Re: Instant timeout

2003-11-05 Thread Bogdan Stancescu
Do you have this problem (your PHP page times out) or do is this the 
desired result? For the latter, you've been answered, for the former it 
might be a core error in your code which PHP can't handle -- in this 
case the results are unpredictable, I typically get a "document contains 
no data" error, but I guess you could also get a time out, depending on 
the web server and its version. If this is the case, make a copy of the 
script and start chopping out pieces from it until you don't get the 
error anymore. The last chunk you deleted contains the problem. :)

Bogdan

Mike Yrabedra wrote:
What would cause a php page to instantly prompt a timeout error when
loading?


++
Mike Yrabedra (President)
323 Incorporated 
Home of MacDock.com, MacAgent.com and MacShirt.com
++
W: http://www.323inc.com/
P: 770.382.1195
F: 734.448.5164
E: [EMAIL PROTECTED]
I: ichatmacdock
++
"Whatever you do, work at it with all your heart,
as working for the Lord, not for men."
~Colossians 3:23 <{{{><
++
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] [Stats] PHP Net List: October 2003

2003-11-05 Thread Marco Tabini
Probably because nobody wants to risk offending John--or (more likely) 
because no one will admit knowing who the "other" John Holmes is ;-)

Cheers,

Marco

--

php|architect - The Magazine for PHP Professionals
Try us free at http://www.phparch.com!
Complete searchable PHP mailing list archives at 
http://www.phparch.com/mailinglists

Roger Spears wrote:
That is funny stuff..I often wonder why no one ever cracks jokes or 
makes a connection...

John W. Holmes wrote:

John Nichel wrote:

Hey, I beat John Holmes  


You mean you're bigger than 14 inc... err, nevermind, you're talking 
about something else...



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


Re: [PHP] [Stats] PHP Net List: October 2003

2003-11-05 Thread Marek Kilimajer
I bet you did not have time because of your "other" activities. ;)

John W. Holmes wrote:
John Nichel wrote:

Hey, I beat John Holmes  


You mean you're bigger than 14 inc... err, nevermind, you're talking 
about something else...

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


[PHP] Changing the php.ini file

2003-11-05 Thread Mike At Spy

I changed a value for max uploads in my php.ini file (linux box); I
restarted apache, then the whole server, to get the new value to come up
and, generally, take affect.

Neither of those things did it.  Does anyone know what I need to do to get
the ini file re-read by the OS, or system, so that the new value goes into
effect?

Thanks,

-Mike

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



RE: [PHP] [Stats] PHP Net List: October 2003

2003-11-05 Thread Jay Blanchard
[snip]
I bet you did not have time because of your "other" activities. ;)
 
>> Hey, I beat John Holmes  
> 
> You mean you're bigger than 14 inc... err, nevermind, you're talking 
> about something else...
[/snip]

Aren't you dead? And have a movie? *ack* Wait, I know (wink, wink) you
have several "movies". I meant a biographical *dang*...they were all
sort of biographical, not to mention biologicalyou know what I mean.

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



RE: [PHP] Changing the php.ini file

2003-11-05 Thread Jay Blanchard
[snip]
I changed a value for max uploads in my php.ini file (linux box); I
restarted apache, then the whole server, to get the new value to come up
and, generally, take affect.

Neither of those things did it.  Does anyone know what I need to do to
get
the ini file re-read by the OS, or system, so that the new value goes
into
effect?
[/snip]

In your upload dialog form do you have something similar to this



if so, it may need changing. If not, it may need adding.

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



[PHP] Sessions within new windows

2003-11-05 Thread Donald Tyler
Hi,

 

Not sure if this is a PHP or Browser issue but here is my problem:

 

I have a site that has a members section. In the news area, when a user
clicks the link for an article, it pops open a new window a requests the
article via a PHP script.

 

What's happening is that when the new window pops up, the script isn't
getting the session info properly. I changed it so that the page opens
up in the main window instead of a new one and it works fine.

 

I presume this is because the browser is not sending the session ID to
the script when opening the new window. Does anyone know of a way for me
to fix this without embedding the session ID in the URL?

 

I thought the only criteria that the browser used when deciding if to
send a Session ID or not was if the page is located at the same domain
name.

 

P.S. Its Internet Explorer 6 I am using.

 

Thanks.



[PHP] Re: Changing the php.ini file

2003-11-05 Thread Bogdan Stancescu
Oh, yes, this is a big one, you must reset the whole state power grid. :)

Simply restarting Apache should do it. Check if your problem doesn't 
come from somewhere else - how are you checking if the changes took 
effect? Also, are you sure you're editing the proper php.ini and not 
some older install's or a backup or something? Check by setting some 
self-evident setting in php.ini and restarting Apache. Also, if you're 
sending the data to a database, make sure it's not the database who's 
barfing due to its own config settings or limitations.

HTH

Bogdan

Mike At Spy wrote:

I changed a value for max uploads in my php.ini file (linux box); I
restarted apache, then the whole server, to get the new value to come up
and, generally, take affect.
Neither of those things did it.  Does anyone know what I need to do to get
the ini file re-read by the OS, or system, so that the new value goes into
effect?
Thanks,

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


RE: [PHP] Changing the php.ini file

2003-11-05 Thread Mike At Spy

I do have that in my form, it is set to 15 megs.  I set the server (php.ini)
to allow 15 megs.  Still can't get anything past 2 megs to upload. :\

Thanks for help,

-Mike


> -Original Message-
> From: Jay Blanchard [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, November 05, 2003 9:15 AM
> To: Mike At Spy; [EMAIL PROTECTED]
> Subject: RE: [PHP] Changing the php.ini file
>
>
> [snip]
> I changed a value for max uploads in my php.ini file (linux box); I
> restarted apache, then the whole server, to get the new value to come up
> and, generally, take affect.
>
> Neither of those things did it.  Does anyone know what I need to do to
> get
> the ini file re-read by the OS, or system, so that the new value goes
> into
> effect?
> [/snip]
>
> In your upload dialog form do you have something similar to this
>
> 
>
> if so, it may need changing. If not, it may need adding.
>
>

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



RE: [PHP] Re: Changing the php.ini file

2003-11-05 Thread Mike At Spy

I'll go double check to make sure I am hitting the right php.ini, but I
think that is the only one the server reported with a 'whereis'.

I am taking the data and writing it to a file, so the db isn't an issue.

I'll mess with some of other settings and see what happens.

:)

Thanks,

-Mike



>
> Oh, yes, this is a big one, you must reset the whole state power grid. :)
>
> Simply restarting Apache should do it. Check if your problem doesn't
> come from somewhere else - how are you checking if the changes took
> effect? Also, are you sure you're editing the proper php.ini and not
> some older install's or a backup or something? Check by setting some
> self-evident setting in php.ini and restarting Apache. Also, if you're
> sending the data to a database, make sure it's not the database who's
> barfing due to its own config settings or limitations.
>
> HTH
>
> Bogdan
>
> Mike At Spy wrote:
>
> > I changed a value for max uploads in my php.ini file (linux box); I
> > restarted apache, then the whole server, to get the new value to come up
> > and, generally, take affect.
> >
> > Neither of those things did it.  Does anyone know what I need
> to do to get
> > the ini file re-read by the OS, or system, so that the new
> value goes into
> > effect?
> >
> > Thanks,
> >
> > -Mike
>
> --
> 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] Changing the php.ini file

2003-11-05 Thread Marek Kilimajer
post_max_size is another setting that has effect on uploads. It should 
be higher than upload_max_filesize.

Mike At Spy wrote:

I changed a value for max uploads in my php.ini file (linux box); I
restarted apache, then the whole server, to get the new value to come up
and, generally, take affect.
Neither of those things did it.  Does anyone know what I need to do to get
the ini file re-read by the OS, or system, so that the new value goes into
effect?
Thanks,

-Mike

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


RE: [PHP] Sessions within new windows

2003-11-05 Thread Donald Tyler
Just a quick update:

It seems to only be a problem with Internet Explorer on the PC. Both IE
& Safari on MacOSX work as expected.

-Original Message-
From: Donald Tyler [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 05, 2003 8:17 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Sessions within new windows

Hi,

 

Not sure if this is a PHP or Browser issue but here is my problem:

 

I have a site that has a members section. In the news area, when a user
clicks the link for an article, it pops open a new window a requests the
article via a PHP script.

 

What's happening is that when the new window pops up, the script isn't
getting the session info properly. I changed it so that the page opens
up in the main window instead of a new one and it works fine.

 

I presume this is because the browser is not sending the session ID to
the script when opening the new window. Does anyone know of a way for me
to fix this without embedding the session ID in the URL?

 

I thought the only criteria that the browser used when deciding if to
send a Session ID or not was if the page is located at the same domain
name.

 

P.S. Its Internet Explorer 6 I am using.

 

Thanks.

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



php-general Digest 5 Nov 2003 14:23:20 -0000 Issue 2397

2003-11-05 Thread php-general-digest-help

php-general Digest 5 Nov 2003 14:23:20 - Issue 2397

Topics (messages 168531 through 168554):

Re: Mail Delivery Acknowledgement
168531 by: John Nichel

Re: [Stats] PHP Net List: October 2003
168532 by: John Nichel
168537 by: Burhan Khalid
168541 by: John W. Holmes
168542 by: Roger Spears
168544 by: Marco Tabini
168545 by: Marek Kilimajer
168547 by: Jay Blanchard

Return mysql_fetch_array($result) from a function
168533 by: Terence
168534 by: David Otton

Re: help with EVAL direct
168535 by: j.sobotka.psgraph.cz

Building PHP source for Linux / Unix.
168536 by: Ananth Kesari
168539 by: Chris Hayes

Re: Handling checkboxes that aren't checked!!!
168538 by: Ford, Mike   [LSS]

create a php timetable problem.
168540 by: irinchiang.justeducation.com

Re: Instant timeout
168543 by: Bogdan Stancescu

Changing the php.ini file
168546 by: Mike At Spy
168548 by: Jay Blanchard
168550 by: Bogdan Stancescu
168551 by: Mike At Spy
168552 by: Mike At Spy
168553 by: Marek Kilimajer

Sessions within new windows
168549 by: Donald Tyler
168554 by: Donald Tyler

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--
--- Begin Message ---
[EMAIL PROTECTED] wrote:

Thank you for contacting me



Your e-mail has been forwarded to the appropriate person Mr. Imran Asghar.

  

We welcome all comments and suggestions. 



Due to the high volume of e-mails received, not all e-mails are responded to directly.



All e-mails that are responded to are handled in the order in which they are received.  If you need more immediate information or assistance, call us on following telephone numbers



+92 3009467711

mv imran /dev/null

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--- End Message ---
--- Begin Message ---
Bill Doerrfeld wrote:

Top 20 Contributors by Number of Posts
--
Marek Kilimajer181
Curt Zirzow164
Chris Shiflett 141
Robert Cummings113
John Nichel 83
Jay Blanchard   78
Chris W. Parker 78
Eugene Lee  75
Tom Rogers  59
Evan Nemerson   59
Jason Wong  57
Burhan Khalid   52
Ryan A  52
Raditha Dissanayake 52
David Otton 49
Scott Fletcher  46
CPT John W. Holmes  43
- Edwin -   41
Leif K-Brooks   38
John W. Holmes  37


Hey, I beat John Holmes  That's me baby, quanity, not quality.  ;)

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--- End Message ---
--- Begin Message ---
John Nichel wrote:


Hey, I beat John Holmes  That's me baby, quanity, not quality.  ;)
Yeah apparently it is :P

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--- End Message ---
--- Begin Message ---
John Nichel wrote:

Hey, I beat John Holmes  
You mean you're bigger than 14 inc... err, nevermind, you're talking 
about something else...

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
That is funny stuff..I often wonder why no one ever cracks jokes or 
makes a connection...

John W. Holmes wrote:

John Nichel wrote:

Hey, I beat John Holmes  


You mean you're bigger than 14 inc... err, nevermind, you're talking 
about something else...


--- End Message ---
--- Begin Message ---
Probably because nobody wants to risk offending John--or (more likely) 
because no one will admit knowing who the "other" John Holmes is ;-)

Cheers,

Marco

--

php|architect - The Magazine for PHP Professionals
Tr

Re: [PHP] Changing the php.ini file

2003-11-05 Thread John W. Holmes
Mike At Spy wrote:

I changed a value for max uploads in my php.ini file (linux box); I
restarted apache, then the whole server, to get the new value to come up
and, generally, take affect.
Neither of those things did it.  Does anyone know what I need to do to get
the ini file re-read by the OS, or system, so that the new value goes into
effect?
Take a look at the first block of the output from phpinfo() and make 
sure you were editing the correct php.ini file. Actually, make sure the 
phpinfo() still shows the old value for your setting and you're really 
sure you're changes haven't taken effect.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


Re: [PHP] [Stats] PHP Net List: October 2003

2003-11-05 Thread John W. Holmes
Jay Blanchard wrote:

Aren't you dead? And have a movie? 
Yes and Yes. Val Kilmer asked if he could play me and I gave him the go 
ahead... and, umm, PHP rocks.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


Re: [PHP] Sessions within new windows

2003-11-05 Thread John W. Holmes
Donald Tyler wrote:

What's happening is that when the new window pops up, the script isn't
getting the session info properly. I changed it so that the page opens
up in the main window instead of a new one and it works fine.
I presume this is because the browser is not sending the session ID to
the script when opening the new window. Does anyone know of a way for me
to fix this without embedding the session ID in the URL?
I thought the only criteria that the browser used when deciding if to
send a Session ID or not was if the page is located at the same domain
name.
P.S. Its Internet Explorer 6 I am using.
Do you have another browser you can try it in? Sounds like an IE feature 
to me. :)

There was some discussion regarding this on the list last month. Each 
browser is different in whether it'll send the same cookies based upon 
how the new window or browser instance is started...

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


Re: [PHP] Changing the php.ini file

2003-11-05 Thread John W. Holmes
Marek Kilimajer wrote:

post_max_size is another setting that has effect on uploads. It should 
be higher than upload_max_filesize.
Make sure it isn't Apache doing the limiting, also. Some searching will 
tell you the setting, but Apache has a limit itself on the size of files 
it'll accept.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


RE: [PHP] Changing the php.ini file

2003-11-05 Thread Mike At Spy

I re-checked the files - nothing I change in the php.ini files seems to take
effect.  How do I check apache?

I saw the post_max_size thing and changed that to be equal to the
upload_max_filesize.  I'll make it a little higher.

Outside of that, I have a cobalt raq4 I am working on with this, and the
php.ini file is here:

/usr/local/bin/php.ini

Any other place an ini file might be?  I've certainly learned not to depend
on 'whereis' to list everything in the past.

:)

Thanks fot the help,

-Mike




> -Original Message-
> From: John W. Holmes [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, November 05, 2003 9:25 AM
> To: Marek Kilimajer
> Cc: Mike At Spy; [EMAIL PROTECTED]
> Subject: Re: [PHP] Changing the php.ini file
>
>
> Marek Kilimajer wrote:
>
> > post_max_size is another setting that has effect on uploads. It should
> > be higher than upload_max_filesize.
>
> Make sure it isn't Apache doing the limiting, also. Some searching will
> tell you the setting, but Apache has a limit itself on the size of files
> it'll accept.
>
> --
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> php|architect: The Magazine for PHP Professionals – www.phparch.com
>
> --
> 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] Sessions within new windows

2003-11-05 Thread Marek Kilimajer
Are you using _blank as target. Then try a named window. But this is 
just a wild guess.

Donald Tyler wrote:

Just a quick update:

It seems to only be a problem with Internet Explorer on the PC. Both IE
& Safari on MacOSX work as expected.
-Original Message-
From: Donald Tyler [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 05, 2003 8:17 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Sessions within new windows

Hi,

 

Not sure if this is a PHP or Browser issue but here is my problem:

 

I have a site that has a members section. In the news area, when a user
clicks the link for an article, it pops open a new window a requests the
article via a PHP script.
 

What's happening is that when the new window pops up, the script isn't
getting the session info properly. I changed it so that the page opens
up in the main window instead of a new one and it works fine.
 

I presume this is because the browser is not sending the session ID to
the script when opening the new window. Does anyone know of a way for me
to fix this without embedding the session ID in the URL?
 

I thought the only criteria that the browser used when deciding if to
send a Session ID or not was if the page is located at the same domain
name.
 

P.S. Its Internet Explorer 6 I am using.

 

Thanks.

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


Re: [PHP] Changing the php.ini file

2003-11-05 Thread Jason Wong
On Wednesday 05 November 2003 22:38, Mike At Spy wrote:

> Outside of that, I have a cobalt raq4 I am working on with this, and the
> php.ini file is here:
>
> /usr/local/bin/php.ini
>
> Any other place an ini file might be?  I've certainly learned not to depend
> on 'whereis' to list everything in the past.

Where the php.ini is located is not the issue here. The issue is where php is 
expecting it to be. Search the archives (try using "php.ini mac") for tips on 
how to determine this.  

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
In this vale
Of toil and sin
Your head grows bald
But not your chin.
-- Burma Shave
*/

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



RE: [PHP] Changing the php.ini file

2003-11-05 Thread Ford, Mike [LSS]
On 05 November 2003 14:39, Mike At Spy contributed these pearls of wisdom:

> I re-checked the files - nothing I change in the php.ini
> files seems to take
> effect.  How do I check apache?
> 
> I saw the post_max_size thing and changed that to be equal to
> the upload_max_filesize.  I'll make it a little higher.
> 
> Outside of that, I have a cobalt raq4 I am working on with
> this, and the
> php.ini file is here:
> 
> /usr/local/bin/php.ini

That's all possibly irrelevant.  Have you looked at your phpinfo() output to
see where PHP is *expecting* to find the php.ini file?  And is there a
php.ini file there?

Cheers!

Mike

-- 
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211

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



RE: [PHP] Sessions within new windows

2003-11-05 Thread Donald Tyler
Yeah I was. I did try that though and it made no difference =0(

-Original Message-
From: Marek Kilimajer [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 05, 2003 8:40 AM
To: Donald Tyler
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Sessions within new windows

Are you using _blank as target. Then try a named window. But this is 
just a wild guess.

Donald Tyler wrote:

> Just a quick update:
> 
> It seems to only be a problem with Internet Explorer on the PC. Both
IE
> & Safari on MacOSX work as expected.
> 
> -Original Message-
> From: Donald Tyler [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, November 05, 2003 8:17 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Sessions within new windows
> 
> Hi,
> 
>  
> 
> Not sure if this is a PHP or Browser issue but here is my problem:
> 
>  
> 
> I have a site that has a members section. In the news area, when a
user
> clicks the link for an article, it pops open a new window a requests
the
> article via a PHP script.
> 
>  
> 
> What's happening is that when the new window pops up, the script isn't
> getting the session info properly. I changed it so that the page opens
> up in the main window instead of a new one and it works fine.
> 
>  
> 
> I presume this is because the browser is not sending the session ID to
> the script when opening the new window. Does anyone know of a way for
me
> to fix this without embedding the session ID in the URL?
> 
>  
> 
> I thought the only criteria that the browser used when deciding if to
> send a Session ID or not was if the page is located at the same domain
> name.
> 
>  
> 
> P.S. Its Internet Explorer 6 I am using.
> 
>  
> 
> Thanks.
> 

-- 
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] replace special chars

2003-11-05 Thread Victor Spång Arthursson
Are there any good function to replace special characters, for example 
double qoutes, with something that are more html-safe?

For example:



The above is generated with PHP and fetched from a database 
(postgresql). I'ld like to have the double qoutes replaced with 
"something else" ;) There could be other strange characters as well 
that needs to be replaced, so some sort of universal function would be 
really nice to get tips on… ;)

Sincerely

Victor

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


RE: [PHP] replace special chars

2003-11-05 Thread Jay Blanchard
[snip]
Are there any good function to replace special characters, for example 
double qoutes, with something that are more html-safe?
[/snip]

http://www.php.net/str_replace

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



Re: [PHP] replace special chars

2003-11-05 Thread Pavel Jartsev
Victor Spång Arthursson wrote:
Are there any good function to replace special characters, for example 
double qoutes, with something that are more html-safe?

For example:



The above is generated with PHP and fetched from a database 
(postgresql). I'ld like to have the double qoutes replaced with 
"something else" ;) There could be other strange characters as well that 
needs to be replaced, so some sort of universal function would be really 
nice to get tips on… ;)

Sincerely

Victor

Try "htmlspecialchars()" and/or "htmlentities()".

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


[PHP] Load Stress tool

2003-11-05 Thread Luis Lebron
I am looking for suggestions on a tool to "load stress" a php application.
We want to make sure that the application/web server will be able to handle
the amount of users we expect. I have found a few but they seem to be very
expensive. Can anyone suggestion an "affordable" and user friendly stress
test app?


thanks,



Luis R. Lebron
Sigmatech, Inc


RE: [PHP] Load Stress tool

2003-11-05 Thread Gregory Kornblum
[snip]
I am looking for suggestions on a tool to "load stress" a php application.
We want to make sure that the application/web server will be able to handle
the amount of users we expect. I have found a few but they seem to be very
expensive. Can anyone suggestion an "affordable" and user friendly stress
test app?
[/snip]

http://jakarta.apache.org/jmeter/index.html

Regards,
Gregory

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



Re: [PHP] replace special chars

2003-11-05 Thread Victor Spång Arthursson

2003-11-05 kl. 16.07 skrev Pavel Jartsev:
Try "htmlspecialchars()" and/or "htmlentities()".
htmlentities() did it best!

Thanks,

/.v

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


Re: [PHP] replace special chars

2003-11-05 Thread John W. Holmes
Victor Spång Arthursson wrote:
Are there any good function to replace special characters, for example 
double qoutes, with something that are more html-safe?
If only the PHP gods would bless us with a function such as 
htmlspecialchars() or maybe even htmlentities()... what a great world it 
would be... ;)

Take a look at the manual pages and they convert different character 
sets and handle quotes differently based upon the second parameter.

http://us2.php.net/htmlentities
http://us2.php.net/htmlspecialchars
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


RE: [PHP] Shared SessionIDs?

2003-11-05 Thread Guillaume Dupuis
I'll try the 'msession' road.

Thanks again for everybody's input,
Guillaume

-Original Message-
From: Chris Shiflett [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 04, 2003 6:36 PM
To: Guillaume Dupuis; [EMAIL PROTECTED]
Subject: Re: [PHP] Shared SessionIDs?


--- Guillaume Dupuis <[EMAIL PROTECTED]> wrote:
> We currently have 3 php servers. Can we use the same SessionID to
> connect across the 3 systems?

Yes, assuming I understand you correctly.

There are many ways to address this challenge, but one method is to use a
database for your session store. This database can be on one of your three
servers or somewhere else.

A similar approach is to use an NFS mount to create a virtual filesystem
for storing session data. Yet another approach is the msession PHP
extension.

Hope that helps.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



Re: [PHP] Load Stress tool

2003-11-05 Thread Mike Migurski
>I am looking for suggestions on a tool to "load stress" a php
>application. We want to make sure that the application/web server will be
>able to handle the amount of users we expect. I have found a few but they
>seem to be very expensive. Can anyone suggestion an "affordable" and user
>friendly stress test app?

Apache ships free with 'ab', a benchmarking tool:


It doesn't do a whole lot, but it will happily hammer away at a given URL
and tell you how your server did.

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

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



[PHP] dictionary

2003-11-05 Thread pete M
Got a bit of a peculiar problem.

I'm recovering a hard disk which has got corrupted (work for a data 
recovery business).

I've got a whole stack of text files which I need to clean up to try and 
get back some of the text information
here's an example snippet

YuR(I\aQMKNXe17lq~Pr?Xhb^~{ikiF..CIC1(
/7;{;e$zwv?xj)(8kkOg(61&[EMAIL PROTECTED]>`
[EMAIL PROTECTED]'FCWL[w)fwe#5B^C`$P"lW
rc&GSrVL _DlVM7KNnvOmp= 
Jk3]cqXR]{Qp;Y23`GPDjnP,Y6>M}z`7N
LANGUAGE=English
MONIKER={DE907F20-A4A0-11d2-A985-00104B70545A}
PRODUCT=LiveUpdate
PRODUCTNAME=LiveUpdate

The way I'm processing is by reading eacho file line by line, keeping 
all charachters ascii >=32 <= 127

What I want is a dictinary of some sort to try and eliminate the lines 
where and english word does not exist !!

Anyone got any ideas ... greatly appreciated

pete

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


RE: [PHP] dictionary

2003-11-05 Thread Craig Lonsbury
are you using windows or *nix?

There is a good dictionary (I think it is called dict)
built into most *nix distros,and have yet to find a
good dictionary for windows.

maybe someone else knows a good one =)

Craig

> -Original Message-
> From: pete M [mailto:[EMAIL PROTECTED]
> Sent: November 5, 2003 8:40 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] dictionary
>
>
> Got a bit of a peculiar problem.
>
> I'm recovering a hard disk which has got corrupted (work for a data
> recovery business).
>
> I've got a whole stack of text files which I need to clean up
> to try and
> get back some of the text information
> here's an example snippet
>
>
> YuR(I\aQMKNXe17lq~Pr?Xhb^~{ikiF..CIC1( }vNHDfQkT%B3R|*ADt?'6T+?k%,^N{
> "2wjObU=/[EMAIL PROTECTED]@WG8.AH9Y6IZ rldhBi(bTAAXAoB%}%&l
> [EMAIL PROTECTED])[EMAIL PROTECTED]&Ol4~Y//
> /7;{;e$zwv?xj)(8kkOg(61&[EMAIL PROTECTED]>` p< [EMAIL PROTECTED]'FCWL[w)fwe#5B^C`$P"lW
> rc&GSrVL _DlVM7KNnvOmp=
> Jk3]cqXR]{Qp;Y23`GPDjnP,Y6>M}z`7N s:x3)GP;uFreD]N3GQQbb+X`kN[Product0]
> LANGUAGE=English
> MONIKER={DE907F20-A4A0-11d2-A985-00104B70545A}
> PRODUCT=LiveUpdate
> PRODUCTNAME=LiveUpdate
>
> The way I'm processing is by reading eacho file line by line, keeping
> all charachters ascii >=32 <= 127
>
> What I want is a dictinary of some sort to try and eliminate
> the lines
> where and english word does not exist !!
>
> Anyone got any ideas ... greatly appreciated
>
> pete
>
> --
> 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] dictionary

2003-11-05 Thread pete M
Linux
;-
Craig Lonsbury wrote:

are you using windows or *nix?

There is a good dictionary (I think it is called dict)
built into most *nix distros,and have yet to find a
good dictionary for windows.
maybe someone else knows a good one =)

Craig


-Original Message-
From: pete M [mailto:[EMAIL PROTECTED]
Sent: November 5, 2003 8:40 AM
To: [EMAIL PROTECTED]
Subject: [PHP] dictionary
Got a bit of a peculiar problem.

I'm recovering a hard disk which has got corrupted (work for a data
recovery business).
I've got a whole stack of text files which I need to clean up
to try and
get back some of the text information
here's an example snippet
YuR(I\aQMKNXe17lq~Pr?Xhb^~{ikiF..CIC1(`M}z`7N
The way I'm processing is by reading eacho file line by line, keeping
all charachters ascii >=32 <= 127
What I want is a dictinary of some sort to try and eliminate
the lines
where and english word does not exist !!
Anyone got any ideas ... greatly appreciated

pete

--
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] url_encode question

2003-11-05 Thread Styve Couture
Hi,

I use urlencode to encode some adress in my application. I have notice a strange 
behavior that I cannot explaned by reading the docs for urlencode(). Those lines will 
explained what I want to say...

  $str_nomFichier = "http://"; .$GLOBALS["str_IpCW"] ."/records/".$path_salle ."/" 
.$path_date ."/" .$file;
  echo  $str_nomFichier."";
  $str_nomFichier = url_encode($str_nomFichier);
  echo  $str_nomFichier."";
  exit;

result :

http://192.168.10.5/records/Salle_16B/2003-05-06/Salle_16B_2003-05-06.010 

http://192.168.10.5records/Salle_16B/2003-05-06/Salle_16B_2003-05-06.010 



As you can see, my URL miss a '/' beetween the server IP and the rest of the path 
after using urlencode() ?

Anything I have miss ?

Win2000, PHP 4.3.3, Apache 2.0.48

Regards.

Styve


  Styve Couture 
  Programmeur/Analyste 
  Novo Technologie inc. 
  49 Rue Du Bel-Air suite 202 
  Levis (Qc) 
  Canada, G6V 6K9 
  telephone: 418-833-6601 #244  
  fax: 418-833-6607  
  web: www.novo.ca  




[PHP] Java JSP and PHP script relation..??

2003-11-05 Thread Ryan A
Hi,
Coming from a java JSP background I have a small question,

in Java when you make a JSP, a servlet is created during execution and if
you poke around the webserver
you can actually find this servlet and read exactly what java reads before
executing...is the same thing possible
with php?

In theory PHP must be doing pretty much the same thing right? it must be
having its own copy of the script
which strips out all the commens etc, any idea where i can find this file as
i need to know exactly what php is
seeing and "rendering"

Thanks,
-Ryan

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



[PHP] Having trouble with Uploading Files to Server...

2003-11-05 Thread Dimitri Marshall
Hi,
I'm trying to allow users to upload files to my server. I have the
appropriate code (I think) but I'm getting this error message. Can someone
tell me why, and how to fix this?

Warning:
move_uploaded_file(/home/unit-dir/public_html/members/memberpix/dimitrihomel
ess.gif): failed to open stream: Permission denied in
/home/unit-dir/public_html/members/updatehomepage.php on line 36

Warning: move_uploaded_file(): Unable to move '/tmp/php9PUwlg' to
'/home/unit-dir/public_html/members/memberpix/dimitrihomeless.gif' in
/home/unit-dir/public_html/members/updatehomepage.php on line 36
Couldn't upload first image

Thanks,
Dimitri Marshall

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



RE: [PHP] Having trouble with Uploading Files to Server...

2003-11-05 Thread Pablo Gosse
On Wednesday, November 05, 2003 8:03 AM, Dimitri wrote:

> I'm trying to allow users to upload files to my server. I have the
> appropriate code (I think) but I'm getting this error message. Can
someone
> tell me why, and how to fix this?
>
> Warning:
> move_uploaded_file(/home/unit-
> dir/public_html/members/memberpix/dimitrihomel
> ess.gif): failed to open stream: Permission denied in
> /home/unit-dir/public_html/members/updatehomepage.php on line 36
> 
> Warning: move_uploaded_file(): Unable to move '/tmp/php9PUwlg' to
> '/home/unit-dir/public_html/members/memberpix/dimitrihomeless.gif' in
> /home/unit-dir/public_html/members/updatehomepage.php on line 36
> Couldn't upload first image

Hi Dimitri.  Check the permissions on the directories you're working
with.  The user which php runs as (usually apache or nobody) needs to be
able to write to the directories to which you are trying to upload the
files (both the temp directory and the final location).

Cheers,
Pablo

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



Re: [PHP] Having trouble with Uploading Files to Server...

2003-11-05 Thread Marek Kilimajer
Web server need permission to write to 
/home/unit-dir/public_html/members/memberpix/ directory. Change the 
directory permissions to 777.

Dimitri Marshall wrote:

Hi,
I'm trying to allow users to upload files to my server. I have the
appropriate code (I think) but I'm getting this error message. Can someone
tell me why, and how to fix this?
Warning:
move_uploaded_file(/home/unit-dir/public_html/members/memberpix/dimitrihomel
ess.gif): failed to open stream: Permission denied in
/home/unit-dir/public_html/members/updatehomepage.php on line 36
Warning: move_uploaded_file(): Unable to move '/tmp/php9PUwlg' to
'/home/unit-dir/public_html/members/memberpix/dimitrihomeless.gif' in
/home/unit-dir/public_html/members/updatehomepage.php on line 36
Couldn't upload first image
Thanks,
Dimitri Marshall
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Java JSP and PHP script relation..??

2003-11-05 Thread Bogdan Stancescu
PHP is interpreted at runtime, I don't think it stores any such 
pre-parsed files, even for caching, anywhere else but in the memory. I 
might be wrong, but I've got a pretty strong gut feeling that's the way 
it goes.

Bogdan

Ryan A wrote:

Hi,
Coming from a java JSP background I have a small question,
in Java when you make a JSP, a servlet is created during execution and if
you poke around the webserver
you can actually find this servlet and read exactly what java reads before
executing...is the same thing possible
with php?
In theory PHP must be doing pretty much the same thing right? it must be
having its own copy of the script
which strips out all the commens etc, any idea where i can find this file as
i need to know exactly what php is
seeing and "rendering"
Thanks,
-Ryan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] url_encode question

2003-11-05 Thread Marek Kilimajer
You want to use urlencode, but you are using url_encode, which must be 
user defined function. Urlencode output would be:

http%3A%2F%2F192.168.10.5%2Frecords%2FSalle_16B%2F2003-05-06%2FSalle_16B_2003-05-06.010

urlencode is supposed to be used for encoding values and not the whole url.

Styve Couture wrote:

Hi,

I use urlencode to encode some adress in my application. I have notice a strange behavior that I cannot explaned by reading the docs for urlencode(). Those lines will explained what I want to say...

  $str_nomFichier = "http://"; .$GLOBALS["str_IpCW"] ."/records/".$path_salle ."/" .$path_date 
."/" .$file;
  echo  $str_nomFichier."";
  $str_nomFichier = url_encode($str_nomFichier);
  echo  $str_nomFichier."";
  exit;
result :

http://192.168.10.5/records/Salle_16B/2003-05-06/Salle_16B_2003-05-06.010 

http://192.168.10.5records/Salle_16B/2003-05-06/Salle_16B_2003-05-06.010 


As you can see, my URL miss a '/' beetween the server IP and the rest of the path after using urlencode() ?

Anything I have miss ?

Win2000, PHP 4.3.3, Apache 2.0.48

Regards.

Styve


  Styve Couture 
  Programmeur/Analyste 
  Novo Technologie inc. 
  49 Rue Du Bel-Air suite 202 
  Levis (Qc) 
  Canada, G6V 6K9 
  telephone: 418-833-6601 #244  
  fax: 418-833-6607  
  web: www.novo.ca  



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


Re: [PHP] dictionary

2003-11-05 Thread Lowell Allen
> Got a bit of a peculiar problem.
> 
> I'm recovering a hard disk which has got corrupted (work for a data
> recovery business).
> 
> I've got a whole stack of text files which I need to clean up to try and
> get back some of the text information
> here's an example snippet
> 
[snip]
> 
> What I want is a dictinary of some sort to try and eliminate the lines
> where and english word does not exist !!
> 
> Anyone got any ideas ... greatly appreciated

The GNU Aspell project includes dictionaries:



--
Lowell Allen

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



Re: [PHP] Return mysql_fetch_array($result) from a function

2003-11-05 Thread Chris Shiflett
--- Terence <[EMAIL PROTECTED]> wrote:
> I am trying to get the results of a function, which queries MySQL, back
> into an array for me to order. I only want to print out certain fields
> (I call the same query, but use different fields in different places).
> 
> This works is I print out the fields in the function itself:
> 
> while($row = mysql_fetch_array($result)) {
> echo $row["id"] . "";
> }

So why do you not want to use this method? Does it not do what you need?


> This however prints out an unending list of values:
[snip]
> $mysql_query = mysql_fetch_array($result);
> 
> while($row = $mysql_query) {
> echo $row["id"] . "";
> }

$row here is being set to a result set. You are querying MySQL (with an
empty query, something I've never tried), and until MySQL fails, this will
run forever.

You probably want to run your query once and then loop through the result
set. Mind your variable names as well, because your use of $row above adds
to the confusion.

$result = mysql_query($sql);
$row = mysql_fetch_assoc($result);

Use things like that. You can also make sure $result is not false prior to
using it, because that is indicative of a failed query.

Hope that helps.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



[PHP] PHP Documentation procedure

2003-11-05 Thread Ahbaid Gaffoor
Is there any utility that can be run against a php script to generate 
documentation of the functions in that script?

Sort of like javadoc is for java code

thanks

Ahbaid

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


Re: [PHP] Sessions within new windows

2003-11-05 Thread Chris Shiflett
--- Donald Tyler <[EMAIL PROTECTED]> wrote:
> I have a site that has a members section. In the news area, when a user
> clicks the link for an article, it pops open a new window a requests the
> article via a PHP script.
> 
> What's happening is that when the new window pops up, the script isn't
> getting the session info properly.

[snip]

> P.S. Its Internet Explorer 6 I am using.

This is a feature/bug of IE 6. It might be something you can configure
somewhere, but I avoid IE like the plague, so I'm not sure about that.

Every other browser, to my knowledge, will work properly.

Hope that helps.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



Re: [PHP] PHP Documentation procedure

2003-11-05 Thread zhuravlev alexander
On Wed, Nov 05, 2003 at 10:42:02AM -0600, Ahbaid Gaffoor wrote:
> Is there any utility that can be run against a php script to generate 
> documentation of the functions in that script?
> 
> Sort of like javadoc is for java code

http://www.phpdoc.de/
http://phpdocu.sourceforge.net/

 -- zhuravlev alexander
   u l s t u  n o c
 ([EMAIL PROTECTED])

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



Re: [PHP] dictionary

2003-11-05 Thread Cesar Cordovez
To the original poster:

The data you posted is not text.  Or it has been encrypted.  I don't 
think that the idea of the dictionary will work.  Keep us posted with 
your findings!  I'll love to see the conclusion.

Cesar

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


Re: [PHP] PHP Documentation procedure

2003-11-05 Thread Burhan Khalid
Ahbaid Gaffoor wrote:
Is there any utility that can be run against a php script to generate 
documentation of the functions in that script?

Sort of like javadoc is for java code
Why do you mean phpdocumentor?

http://pear.php.net/package/PhpDocumentor

"The phpDocumentor tool is a standalone auto-documentor similar to 
JavaDoc written in PHP."

There is also a phpdoc iirc.

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP Documentation procedure

2003-11-05 Thread Boyan Nedkov


http://phpdocu.sourceforge.net/
http://www.callowayprints.com/phpdoc/
http://sourceforge.net/projects/phpdocu/
http://www.stack.nl/~dimitri/doxygen/


Ahbaid Gaffoor wrote:
Is there any utility that can be run against a php script to generate 
documentation of the functions in that script?

Sort of like javadoc is for java code

thanks

Ahbaid

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


[PHP] Re: [PHP-DB] Unsuscribe

2003-11-05 Thread Boyan Nedkov
try to do this here:
http://www.php.net/mailing-lists.php
[EMAIL PROTECTED] wrote:

Unsubscribe

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


RE: [PHP] Shared SessionIDs?

2003-11-05 Thread Chris W. Parker
John W. Holmes 
on Tuesday, November 04, 2003 6:07 PM said:

> I think you missed the part where he said "while keeping secure"... :)
> 
> Storing something like this in a cookie is in no way secure.

Hey man! That's why I put the disclaimer...

>> Here's an idea (whether or not it's a good idea is another story):

:)


But seriously, why is it such a bad idea? I'd like to finally figure
this out so I don't keep coming up with them (not that I've ever used
any). ;)


Chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

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



RE: [PHP] Changing the php.ini file

2003-11-05 Thread Mike At Spy

Bingo.  I didn't even notice that the phpinfo was saying the ini file was in
a different directory than the one I was looking at.

So much for 'whereis' - again. :\

:)

Thanks!

-Mike


> -Original Message-
> From: Ford, Mike [LSS] [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, November 05, 2003 9:50 AM
> To: 'Mike At Spy'
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP] Changing the php.ini file
>
>
> On 05 November 2003 14:39, Mike At Spy contributed these pearls of wisdom:
>
> > I re-checked the files - nothing I change in the php.ini
> > files seems to take
> > effect.  How do I check apache?
> >
> > I saw the post_max_size thing and changed that to be equal to
> > the upload_max_filesize.  I'll make it a little higher.
> >
> > Outside of that, I have a cobalt raq4 I am working on with
> > this, and the
> > php.ini file is here:
> >
> > /usr/local/bin/php.ini
>
> That's all possibly irrelevant.  Have you looked at your
> phpinfo() output to
> see where PHP is *expecting* to find the php.ini file?  And is there a
> php.ini file there?
>
> Cheers!
>
> Mike
>
> --
> Mike Ford,  Electronic Information Services Adviser,
> Learning Support Services, Learning & Information Services,
> JG125, James Graham Building, Leeds Metropolitan University,
> Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
> Email: [EMAIL PROTECTED]
> Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211
>

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



RE: [PHP] Changing the php.ini file

2003-11-05 Thread Jay Blanchard
[snip]
Bingo.  I didn't even notice that the phpinfo was saying the ini file
was in
a different directory than the one I was looking at.

So much for 'whereis' - again. :\
[/snip]

>From the command line Mike try 'locate php.ini' (drop the quotes).
You'll be surprised at what you might see.

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



RE: [PHP] Sessions within new windows

2003-11-05 Thread Pablo Gosse
That's strange, as I've been writing a CMS over the past year which
requires the user to have IE 5.5 or newer, and I have no problems with
pop-ups accessing session values under IE 6.0.

Perhaps it's an issue of how you're invoking the new windows?

Are you using a normal link with target="_blank" or are you using
Javascript to launch the new window?

Cheers,
Pablo

-Original Message-
From: Chris Shiflett [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 05, 2003 8:42 AM
To: Donald Tyler; [EMAIL PROTECTED]
Subject: Re: [PHP] Sessions within new windows

--- Donald Tyler <[EMAIL PROTECTED]> wrote:
> I have a site that has a members section. In the news area, when a
user
> clicks the link for an article, it pops open a new window a requests
the
> article via a PHP script.
> 
> What's happening is that when the new window pops up, the script isn't
> getting the session info properly.

[snip]

> P.S. Its Internet Explorer 6 I am using.

This is a feature/bug of IE 6. It might be something you can configure
somewhere, but I avoid IE like the plague, so I'm not sure about that.

Every other browser, to my knowledge, will work properly.

Hope that helps.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

-- 
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] Shared SessionIDs?

2003-11-05 Thread CPT John W. Holmes
From: "Chris W. Parker" <[EMAIL PROTECTED]>
> But seriously, why is it such a bad idea? I'd like to finally figure
> this out so I don't keep coming up with them (not that I've ever used
> any). ;)

I've got to remember back to what the original thread was about... :)

The suggestion, iirc, was to pass an MD5() hash of the username and password
in a cookie to identify the user. The problem with this is that cookies are
sent plain text and can be intercepted. So, anyone intercepting the cookie
and finding out the MD5() hash needs only to create a cookie on their own
machine with this same hash to now "become" the other user. They don't need
to know the actual username or password and you're script wouldn't know the
difference.

Now, there are some scripts that do this (forums, for example) as a sort of
"remember me" feature, but they do it at a trade off for security. Using a
method like this is saying that if one user impersonates another, it's not
really going to mess up anything on the site, there's not much harm they can
do, etc. An impersonated user on a forum may cause a little havoc, but it'd
be real TROUBLE if done on a banking site.

One way to alleviate some of the security issues is to have the hash
unrelated to the username and password and have it change often. That way,
even if another user gets it, it's only good for so long.

Hope that helps. Contact me offline anytime for more explanation if you
want. :)

---John Holmes...

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



RE: [PHP] Shared SessionIDs?

2003-11-05 Thread Chris Shiflett
--- "Chris W. Parker" <[EMAIL PROTECTED]> wrote:
> But seriously, why is it such a bad idea? I'd like to finally figure
> this out so I don't keep coming up with them (not that I've ever used
> any). ;)

I have a free chapter that explains cookies at the protocol level here:

http://shiflett.org/books/http-developers-handbook/chapters/11

The idea of cookies is a very good one, and Netscape deserves credit for
the innovation. However, some implementations have been known to have
problems. Most notably, Internet Explorer versions 4.0, 5.0, 5.5, and 6.0
all have vulnerabilities that, if not patched, allow anyone to read
cookies from any domain. This means that Web developers, such as
ourselves, must consider all information in a cookie to be public for the
purposes of security assessment. The worst case scenario must be taken
into consideration, and when you set a cookie, the worst case is that the
contents are compromised.

So, getting back to your approach, you store authentication credentials in
a cookie, although you mentioned several steps that add obscurity. Even if
the data in the cookie cannot possibly reveal the user's authentication
credentials, if your session mechanism considers the cookie itself to be
an authentication credential, you have already lost. Anyone who can
compromise this cookie can impersonate a user on your Web application. A
security vulnerability is born.

Hope that helps.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



RE: [PHP] Load Stress tool

2003-11-05 Thread Luis Lebron
Thanks for the information. I also found the MS Web Application Stress Tool
which may work

http://www.microsoft.com/technet/treeview/default.asp?url=/technet/itsolutio
ns/intranet/downloads/webstres.asp

-Original Message-
From: Mike Migurski [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 05, 2003 9:32 AM
To: Luis Lebron
Cc: Php-General (E-mail)
Subject: Re: [PHP] Load Stress tool


>I am looking for suggestions on a tool to "load stress" a php
>application. We want to make sure that the application/web server will be
>able to handle the amount of users we expect. I have found a few but they
>seem to be very expensive. Can anyone suggestion an "affordable" and user
>friendly stress test app?

Apache ships free with 'ab', a benchmarking tool:


It doesn't do a whole lot, but it will happily hammer away at a given URL
and tell you how your server did.

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html


[PHP] Apache1.3.28 vs PHP4.3.3

2003-11-05 Thread orlandopozo
Apache 1.3.28 / PHP 4.3.3

hello, I tried to configure php as module SAPI of the apache web server, I
put this line:

 LoadModule php4_module D:/PHP4.3.3/sapi/php4apache.dll
AddModule mod_php4.c
AddType application/x-httpd-php .php

When I tested the configuration, I got this error:

Cannot remove module mod_php4.c: not found module list
 
 I removed the "AddModule mod_php4.c" directive, restart the server, but
 remain the same problem

Thanks for any help, I will really aprecciate your support, bye.

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



Re: [PHP] PHP Documentation procedure

2003-11-05 Thread Ahbaid Gaffoor
Thank you!

Just what I needed.

Ahbaid

Boyan Nedkov wrote:



http://phpdocu.sourceforge.net/
http://www.callowayprints.com/phpdoc/
http://sourceforge.net/projects/phpdocu/
http://www.stack.nl/~dimitri/doxygen/


Ahbaid Gaffoor wrote:

Is there any utility that can be run against a php script to generate 
documentation of the functions in that script?

Sort of like javadoc is for java code

thanks

Ahbaid


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


Re: [PHP] Apache1.3.28 vs PHP4.3.3

2003-11-05 Thread Burhan Khalid
[EMAIL PROTECTED] wrote:

Apache 1.3.28 / PHP 4.3.3

hello, I tried to configure php as module SAPI of the apache web server, I
put this line:
 LoadModule php4_module D:/PHP4.3.3/sapi/php4apache.dll
AddModule mod_php4.c
AddType application/x-httpd-php .php
When I tested the configuration, I got this error:

Cannot remove module mod_php4.c: not found module list
 
 I removed the "AddModule mod_php4.c" directive, restart the server, but
 remain the same problem
Verify the path to php4apache.dll

Read this > http://www.meidomus.com/node/view/9

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Site Security

2003-11-05 Thread Shaun
Hi,

I have created a site that allows users to schedule staff, make appointments
etc. Users must log in to use the site and the users data is held in the
Users table of the MySQL database. However, due to the nature of the site I
need to make sure it is 110% secure against hacks etc. Now I know this isn't
actually possible but I would appreciate any advice on how I can get it as
secure as possible, I have no experience on this aspect of web development.

Thanks for your help

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



RE: [PHP] Site Security

2003-11-05 Thread Dan Joseph
Hi,


> I have created a site that allows users to schedule staff, make
> appointments
> etc. Users must log in to use the site and the users data is held in the
> Users table of the MySQL database. However, due to the nature of
> the site I
> need to make sure it is 110% secure against hacks etc. Now I know
> this isn't
> actually possible but I would appreciate any advice on how I can get it as
> secure as possible, I have no experience on this aspect of web
> development.

Turn off register globals.  Validate all form posts for bogus data.  Check
that the cookie hasn't been changed with bad characters malliciously.
Things like that.  Try and break into the site w/o logging in.  We paid for
a security audit from a company called @stake (www.atstake.com).  If you can
afford it, I'd contract someone to audit you.

-Dan Joseph

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



Re: [PHP] Site Security

2003-11-05 Thread Chris Shiflett
--- Shaun <[EMAIL PROTECTED]> wrote:
> However, due to the nature of the site I need to make sure it is 110%
> secure against hacks etc. Now I know this isn't actually possible

That's a very good thing to realize. Security is a measurement, sort of
like temperature, so saying something is 100% secure is like saying
something is 100% hot. It can always be hotter. :-)

> I would appreciate any advice on how I can get it as secure as possible,
> I have no experience on this aspect of web development.

Peer code reviews are good and cheap. It all comes down to how much you're
willing to spend on security. Professional code reviews are also good, but
they can be extremely expensive. Another good idea is to educate yourself,
since you probably know your own code the best. There is a lot of great
information that has been posted on this list. Just search for security in
the archives.

There is also a book being written on the topic I hear. :-) But, none
exist yet. Oh, the OWASP guide has a little bit of information on PHP.
I've read it, and it's pretty good advice (I disgree about some of their
coding standards, but that's not too important).

Hope that helps.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



[PHP] simple?

2003-11-05 Thread Jason
Hello all,

I have written a script for the purpose of uploading an image and block of
text for a site. Real simple stuff but I can't get the form to write? code
looks like this...




I have some error checking above this but the meat of it still doesn't work.
I get:

Parse error: parse error in
/var/www/html/site/directory/subdirectory/upload.php on line 68

in the upload.php file there are only 64 or so lines of code.

HELP!

Jason

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



Re: [PHP] simple?

2003-11-05 Thread Rolf Brusletto
Jason wrote:

Hello all,

I have written a script for the purpose of uploading an image and block of
text for a site. Real simple stuff but I can't get the form to write? code
looks like this...

I have some error checking above this but the meat of it still doesn't work.
I get:
Parse error: parse error in
/var/www/html/site/directory/subdirectory/upload.php on line 68
in the upload.php file there are only 64 or so lines of code.

HELP!

Jason

 

Jason - here is what I see straight off the bat..

return (ereg_replace(,/+, '/', $tmp_file ==$filename);

should be 

return (ereg_replace(,/+, '/', $tmp_file ==$filename));

notice the second parenthesis at the end... i.e. return(ereg_replace())

that could possibly cause it to err out later... 

Rolf Brusletto
www.phpExamples.net


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


Re: [PHP] simple?

2003-11-05 Thread Burhan Khalid
Jason wrote:

[ snip ]

Parse error: parse error in
/var/www/html/site/directory/subdirectory/upload.php on line 68
in the upload.php file there are only 64 or so lines of code.

HELP!
Check for missing ;
Check for proper nesting of }
Check for proper nesting of )
Cut and paste your code in a php-aware syntax highlighting text editor 
like vim (Linux/Unix) or Editplus/Ultraedit, etc. for Windows. That also 
helps.

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] High bandwidth application tips

2003-11-05 Thread Luis Lebron
I have been coding php for a few years now, but I haven't build a "high
bandwidth" application. I am currently working on an application for a
customer that may have a very large amount of users (10,000 or more
according to the customer).  Are there any good reference books, articles
and general information on building such a site. I have been "googling" for
a while but have found anything on this particular topic.

thanks,

Luis R. Lebron
Sigmatech, Inc


RE: [PHP] Sessions within new windows

2003-11-05 Thread Donald Tyler
I am using a normal link. Here is the exact html code:



-Original Message-
From: Pablo Gosse [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 05, 2003 11:17 AM
To: [EMAIL PROTECTED]; Donald Tyler; [EMAIL PROTECTED]
Subject: RE: [PHP] Sessions within new windows

That's strange, as I've been writing a CMS over the past year which
requires the user to have IE 5.5 or newer, and I have no problems with
pop-ups accessing session values under IE 6.0.

Perhaps it's an issue of how you're invoking the new windows?

Are you using a normal link with target="_blank" or are you using
Javascript to launch the new window?

Cheers,
Pablo

-Original Message-
From: Chris Shiflett [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 05, 2003 8:42 AM
To: Donald Tyler; [EMAIL PROTECTED]
Subject: Re: [PHP] Sessions within new windows

--- Donald Tyler <[EMAIL PROTECTED]> wrote:
> I have a site that has a members section. In the news area, when a
user
> clicks the link for an article, it pops open a new window a requests
the
> article via a PHP script.
> 
> What's happening is that when the new window pops up, the script isn't
> getting the session info properly.

[snip]

> P.S. Its Internet Explorer 6 I am using.

This is a feature/bug of IE 6. It might be something you can configure
somewhere, but I avoid IE like the plague, so I'm not sure about that.

Every other browser, to my knowledge, will work properly.

Hope that helps.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

-- 
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] High bandwidth application tips

2003-11-05 Thread Chris Shiflett
--- Luis Lebron <[EMAIL PROTECTED]> wrote:
> I am currently working on an application for a customer that may have
> a very large amount of users (10,000 or more according to the customer).

I currently design, develop, and maintain a suite of Web applications and
utilities that receive ten million hits a day, and my experience has shown
that the number one thing you can do to make the biggest difference is to
limit the number of times you need to hit the database.

PHP itself, even without an accelerator, is very fast. A single Web server
can handle most people's needs, so long as the application is designed
well otherwise.

As an example of limiting database access, consider whether your
application queries the database many times to receive the exact same
result set. Is there a way to cache that locally? Or, perhaps you are
generating statistics for some reason, where you need to record data for
every visitor. What if, instead, you stored such statistical data once for
every 100 visits? Assuming the rand() function is very good, this should
allow you to multiply your statistics by 100 and have fairly accurate
statistics (assuming large data sets, like saying you have 1.4 million
users from the US). Your accuracy diminishes by a factor of 100, so you
just have to determine what amount of accuracy you need.

There are a lot of things you can do, but I have found that performance
tuning your PHP logic can be very helpful, but it's nothing compared to
limiting your database access.

Hope that helps.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



Re: [PHP] High bandwidth application tips

2003-11-05 Thread Marco Tabini
Chris Shiflett wrote:
I currently design, develop, and maintain a suite of Web applications and
utilities that receive ten million hits a day, and my experience has shown
that the number one thing you can do to make the biggest difference is to
limit the number of times you need to hit the database.
I second Chris on this. No matter how fast your servers are, there is an 
inherent latency in hitting the database, particularly if you do so 
continuously and unnecessarily. Caching is usually a good solution to 
this problem--there are commercial products that will help you (like the 
Zend Performance Suite), but if you design with caching in mind from the 
outset, you should be able to obtain excellent results even without them.

Cheers,

Marco

--

php|architect - The Magazine for PHP Professionals
Try us free at http://www.phparch.com!
Complete searchable PHP mailing list archives at 
http://www.phparch.com/mailinglists

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


RE: [PHP] High bandwidth application tips

2003-11-05 Thread Jay Blanchard
[snip]
> limit the number of times you need to hit the database.
> 
I second Chris on this.
[/snip]

I third that. The problem can become especially apparent in large
databases containing millions of records. Other than that just code
cleanly and document, document, document.

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



RE: [PHP] High bandwidth application tips

2003-11-05 Thread Luis Lebron
One of the things I have suggested to the customer is offloading some of the
work to a different server. For example, he wants to email a weekly message
to all the users with information on records that match their search
criteria. I suggested setting up a second server that handles this and other
admin function while the main server takes care of the users.

Does this sound like a good idea?

thanks,

Luis

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 05, 2003 2:10 PM
To: Marco Tabini; [EMAIL PROTECTED]
Cc: Luis Lebron; Php-General (E-mail)
Subject: RE: [PHP] High bandwidth application tips


[snip]
> limit the number of times you need to hit the database.
> 
I second Chris on this.
[/snip]

I third that. The problem can become especially apparent in large
databases containing millions of records. Other than that just code
cleanly and document, document, document.


RE: [PHP] Sessions within new windows

2003-11-05 Thread Pablo Gosse
Hmm, that's strange.

I use Javascript functions to control the few pop-up windows in the CMS,
but I just went in and changed some to standard href tags with the
_blank for the target attribute, as you have, and it still works with no
problem.

If, as Chris wrote, this is indeed a feature/bug of IE, then it must be
configurable somewhere, though I'm lost as to where that might be.

I just tested it out on a number of systems around here, both on a
Windoze 2000 box and on a RedHat box using a Terminal Services
connection, and it worked fine for me.

Does anyone have any ideas how this could be controlled via IE's
settings?

Cheers,
Pablo

-Original Message-
From: Donald Tyler [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 05, 2003 11:48 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Sessions within new windows

I am using a normal link. Here is the exact html code:



-Original Message-
From: Pablo Gosse [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 05, 2003 11:17 AM
To: [EMAIL PROTECTED]; Donald Tyler; [EMAIL PROTECTED]
Subject: RE: [PHP] Sessions within new windows

That's strange, as I've been writing a CMS over the past year which
requires the user to have IE 5.5 or newer, and I have no problems with
pop-ups accessing session values under IE 6.0.

Perhaps it's an issue of how you're invoking the new windows?

Are you using a normal link with target="_blank" or are you using
Javascript to launch the new window?

Cheers,
Pablo

-Original Message-
From: Chris Shiflett [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 05, 2003 8:42 AM
To: Donald Tyler; [EMAIL PROTECTED]
Subject: Re: [PHP] Sessions within new windows

--- Donald Tyler <[EMAIL PROTECTED]> wrote:
> I have a site that has a members section. In the news area, when a
user
> clicks the link for an article, it pops open a new window a requests
the
> article via a PHP script.
> 
> What's happening is that when the new window pops up, the script isn't
> getting the session info properly.

[snip]

> P.S. Its Internet Explorer 6 I am using.

This is a feature/bug of IE 6. It might be something you can configure
somewhere, but I avoid IE like the plague, so I'm not sure about that.

Every other browser, to my knowledge, will work properly.

Hope that helps.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



FW: [PHP] Sessions within new windows

2003-11-05 Thread Donald Tyler


-Original Message-
From: Pablo Gosse [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 05, 2003 2:11 PM
To: Donald Tyler
Subject: RE: [PHP] Sessions within new windows

Hmm, that's strange.

I use Javascript functions to control the few pop-up windows in the CMS,
but I just went in and changed some to standard href tags with the
_blank for the target attribute, as you have, and it still works with no
problem.

If, as Chris wrote, this is indeed a feature/bug of IE, then it must be
configurable somewhere, though I'm lost as to where that might be.

I just tested it out on a number of systems around here, both on a
Windoze 2000 box and on a RedHat box using a Terminal Services
connection, and it worked fine for me.

Does anyone have any ideas how this could be controlled via IE's
settings?

Cheers,
Pablo

-Original Message-
From: Donald Tyler [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 05, 2003 11:48 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Sessions within new windows

I am using a normal link. Here is the exact html code:



-Original Message-
From: Pablo Gosse [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 05, 2003 11:17 AM
To: [EMAIL PROTECTED]; Donald Tyler; [EMAIL PROTECTED]
Subject: RE: [PHP] Sessions within new windows

That's strange, as I've been writing a CMS over the past year which
requires the user to have IE 5.5 or newer, and I have no problems with
pop-ups accessing session values under IE 6.0.

Perhaps it's an issue of how you're invoking the new windows?

Are you using a normal link with target="_blank" or are you using
Javascript to launch the new window?

Cheers,
Pablo

-Original Message-
From: Chris Shiflett [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 05, 2003 8:42 AM
To: Donald Tyler; [EMAIL PROTECTED]
Subject: Re: [PHP] Sessions within new windows

--- Donald Tyler <[EMAIL PROTECTED]> wrote:
> I have a site that has a members section. In the news area, when a
user
> clicks the link for an article, it pops open a new window a requests
the
> article via a PHP script.
> 
> What's happening is that when the new window pops up, the script isn't
> getting the session info properly.

[snip]

> P.S. Its Internet Explorer 6 I am using.

This is a feature/bug of IE 6. It might be something you can configure
somewhere, but I avoid IE like the plague, so I'm not sure about that.

Every other browser, to my knowledge, will work properly.

Hope that helps.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



RE: [PHP] Sessions within new windows

2003-11-05 Thread Chris Shiflett
--- Pablo Gosse <[EMAIL PROTECTED]> wrote:
> If, as Chris wrote, this is indeed a feature/bug of IE, then it must be
> configurable somewhere, though I'm lost as to where that might be.

I have no first-hand experience with this, since I don't use Windows (and
I use Safari when I use Macs). But, there was a discussion on the list a
week or two ago about this same thing, and someone did some testing to
find that IE did not send session cookies upon a new instance. I was under
the impression that this was somehow configurable, but that the default
behavior in IE 6 was to consider each separate instance to be using a
different pool for session cookies.

> Does anyone have any ideas how this could be controlled via IE's
> settings?

I would also be interested in this, as well as some sort of confirmation
of this behavior. It could be that the person who described this behavior
was wrong. :-)

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



[PHP] getting array slice of function output

2003-11-05 Thread David T-G
Hi, all --

I have a line which strips the suffix (gif, GIF, TIFF, jpg, JPEG, etcetc
or I would just use basename() :-) from a string but it seems needlessly
drawn out:

  $file = preg_split('/\./',$dirfiles[0]) ; $file = $file[0] ;

I would like to just assign the 0th element of the preg_split() output to
my variable.  I've also had to use a temp array for stat() output in
other places.

Is there a way to address

  preg_split('/\./',$string[0])[0]

or

  stat("$somefile")[mode]

directly instead?


TIA & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] getting array slice of function output

2003-11-05 Thread Mike Migurski
>I have a line which strips the suffix (gif, GIF, TIFF, jpg, JPEG, etcetc
>or I would just use basename() :-) from a string but it seems needlessly
>drawn out:
>
>  $file = preg_split('/\./',$dirfiles[0]) ; $file = $file[0] ;
>
>I would like to just assign the 0th element of the preg_split() output to
>my variable.  I've also had to use a temp array for stat() output in
>other places.

try:
$file = reset(preg_split('/\./',$dirfiles[0]));

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

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



Re: [PHP] simple?

2003-11-05 Thread Marek Kilimajer
return (ereg_replace('/+', '/', $tmp_file ==$filename));

Jason wrote:
Hello all,

I have written a script for the purpose of uploading an image and block of
text for a site. Real simple stuff but I can't get the form to write? code
looks like this...

I have some error checking above this but the meat of it still doesn't work.
I get:
Parse error: parse error in
/var/www/html/site/directory/subdirectory/upload.php on line 68
in the upload.php file there are only 64 or so lines of code.

HELP!

Jason

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


RE: [PHP] Sessions within new windows

2003-11-05 Thread Pablo Gosse
On Wednesday, November 05, 2003 12:38 PM, Chris wrote:

> I would also be interested in this, as well as some sort of
confirmation
> of this behavior. It could be that the person who described this
behavior
> was wrong. :-)

I think Chris is correct in thinking that the person who started the
previous thread on this subject described the behavior incorrectly.
I've been developing web applications with PHP/PostgreSQL for a few
years now, and I've never been able to duplicate the behaviors described
in the original thread.

>From my experience over the past few years, here's how IE works with
sessions and new windows.

If you open a web application in Internet Explorer and a session is
activated, opening a new window either via a JavaScript link, an href
with the target attribute set to _blank or by hitting ctrl-n will cause
the new window to inherit the session of the opener.

However, if you have a window open in which a session is activated and
you open a new IE window via a desktop shortcut (basically create a
separate instance of the browser) this window will NOT inherit the
session of the already active window.

I tried to replicate the behaviors described in the previous thread with
IE 5.5 and 6.0 running on Win2K boxes and on Linux boxes connected via
TSS, and was unsuccessful.

Anyone else have any ideas as to why this would be happening? It seems a
very strange behavior to me.

Cheers,
Pablo 

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



RE: [PHP] Sessions within new windows

2003-11-05 Thread Chris W. Parker
Pablo Gosse 
on Wednesday, November 05, 2003 3:08 PM said:

> From my experience over the past few years, here's how IE works with
> sessions and new windows.

[snip Pablo's experience]

Your description is the way I understand it.



Chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

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



[PHP] Input Validation of $_SESSION values

2003-11-05 Thread Pablo Gosse
Hi all.  A quick question as an extension to the threads about input
validation over the past weeks.

It's obviously best practice to rigorously check and validate all input
coming via $_GET or $_POST, but what about $_SESSION values?

Without proper checking of $_GET and $_POST, it is very easy for someone
to exploit an application.  But what are the potentials of this
happening with session values?

As an example, in my CMS when the user logs in a number of session
variables are registered, including a user id, group id and clearance
level, all of which are used extensively in queries.

Throughout the CMS I use a custom function to validate any ids coming
from $_GET or $_POST, but are those which come from $_SESSION equally
dangerous?  It would seem to me that they wouldn't be quite as
dangerous, but I can't really say for sure.

For example, if someone is attempting to retrieve a specific content
block within the CMS for editing, the following query is executed:


$query  = 'select c.* from cms_content c, cms_access x ';
$query .= 'where x.status = 1 and x.c_id = c.c_id and ';
$query .= 'x.p_id = '.$p_id.' and c.p_id = '.$p_id.' ';
$query .= 'and x.u_id = '.$_SESSION['u_id'].' and ';
$query .= 'x.g_id = '.$_SESSION['g_id'].' ';
$query .= $_SESSION['clearance'] < 2 ? 'and (c.release < now() and
(c.expires is null or c.expires > now()) and ((c.begin_suspend is null
and c.end_suspend is null) or (now() not between c.begin_suspend and
c.end_suspend))) ' : '';


What are the implications of not validating the $_SESSION['u_id'],
$_SESSION['g_id'] and $_SESSION['clearance'] values?

In this query, for example, the last ternary statement checks if the
clearance value for the current session is less than 2, and if so the
content can only be accessed if the conditions run against the timestamp
fields for that specific record are valid.

However, if someone were somehow able to hijack the value of
$_SESSION['clearance'] and set it to 3 or 4, then this check would be
ignored.

How big of an issue is this?  I'd be very interested in some opinions
from those with more experience on the security side of things.

Cheers,
Pablo

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



[PHP] REPOST TO FIX MANGLED QUERY - Input validation of $_SESSION values

2003-11-05 Thread Pablo Gosse
Hi all.  Sorry for the repost but the query got seriously mangled in the
previous post.

A quick question as an extension to the threads about input validation
over the past weeks.

It's obviously best practice to rigorously check and validate all input
coming via $_GET or $_POST, but what about $_SESSION values?

Without proper checking of $_GET and $_POST, it is very easy for someone
to exploit an application.  But what are the potentials of this
happening with session values?

As an example, in my CMS when the user logs in a number of session
variables are registered, including a user id, group id and clearance
level, all of which are used extensively in queries.

Throughout the CMS I use a custom function to validate any ids coming
from $_GET or $_POST, but are those which come from $_SESSION equally
dangerous?  It would seem to me that they wouldn't be quite as
dangerous, but I can't really say for sure.

For example, if someone is attempting to retrieve a specific content
block within the CMS for editing, the following query is executed:


$query  = 'select c.* from cms_content c, cms_access x ';

$query .= 'where x.status = 1 and x.c_id = c.c_id and ';

$query .= 'x.p_id = '.$p_id.' and c.p_id = '.$p_id.' ';

$query .= 'and x.u_id = '.$_SESSION['u_id'].' and ';

$query .= 'x.g_id = '.$_SESSION['g_id'].' ';

$query .= $_SESSION['clearance'] < 2 ? 'and (c.release < now() and
(c.expires is null or c.expires > now()) and ((c.begin_suspend is null
and c.end_suspend is null) or (now() not between c.begin_suspend and
c.end_suspend))) ' : '';


What are the implications of not validating the $_SESSION['u_id'],
$_SESSION['g_id'] and $_SESSION['clearance'] values?

In this query, for example, the last ternary statement checks if the
clearance value for the current session is less than 2, and if so the
content can only be accessed if the conditions run against the timestamp
fields for that specific record are valid.

However, if someone were somehow able to hijack the value of
$_SESSION['clearance'] and set it to 3 or 4, then this check would be
ignored.

How big of an issue is this?  I'd be very interested in some opinions
from those with more experience on the security side of things.

Cheers,
Pablo

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



Re: [PHP] Apache1.3.28 vs PHP4.3.3

2003-11-05 Thread Boyan Nedkov
For getting up and running php on WinXX box you need only:

LoadModule php4_module D:/PHP4.3.3/sapi/php4apache.dll
AddType application/x-httpd-php .php
To avoid the problem with removing 'mod_php4.c' try to find 
'ClearModuleList' directive in httpd.conf and comment it, then restart 
the server once again

Hope this help,

boyan
--
[EMAIL PROTECTED] wrote:

Apache 1.3.28 / PHP 4.3.3

hello, I tried to configure php as module SAPI of the apache web server, I
put this line:
 LoadModule php4_module D:/PHP4.3.3/sapi/php4apache.dll
AddModule mod_php4.c
AddType application/x-httpd-php .php
When I tested the configuration, I got this error:

Cannot remove module mod_php4.c: not found module list
 
 I removed the "AddModule mod_php4.c" directive, restart the server, but
 remain the same problem

Thanks for any help, I will really aprecciate your support, bye.

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


[PHP] anyway to return more than one value?

2003-11-05 Thread Chris W. Parker
Hi list.

Ok I know it's not possible to "return" more than one value. But I'm
going to explain what I'd like to do so maybe there's an easy way to do
it.

I've got some functions that query a database and turn the result into
an array and return that array. What I'd like to do is not only return
the array of results but ALSO return a row count and field count of that
result.

Here is some pseudo code:

function get_results()
{
// query database
$result = query($sql);

// turn result set into a useable array
$theResultArray = get_results($result);

$rows = mysql_num_rows($result);
$fields = mysql_num_fields($result);

return $theResultArray;
return $rows;
return $fields;
}

Ok I know that won't work but that's just basically what I want to do.

The only way around this I've come up with is to stick all the values
into ANOTHER array and return then and then dissect that array in the
calling function, but that just seems messy.

All of a sudden the word "reference" came to mind. Is that what I want
to use?


Any help would be appreciated.


Thanks,
Chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

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



Re: [PHP] anyway to return more than one value?

2003-11-05 Thread Robert Cummings
On Wed, 2003-11-05 at 19:02, Chris W. Parker wrote:
> Hi list.
> 
> Ok I know it's not possible to "return" more than one value. But I'm
> going to explain what I'd like to do so maybe there's an easy way to do
> it.
> 
> I've got some functions that query a database and turn the result into
> an array and return that array. What I'd like to do is not only return
> the array of results but ALSO return a row count and field count of that
> result.
> 
> Here is some pseudo code:
> 
> function get_results()
> {
> // query database
>   $result = query($sql);
>   
> // turn result set into a useable array
>   $theResultArray = get_results($result);
> 
>   $rows = mysql_num_rows($result);
>   $fields = mysql_num_fields($result);
> 
>   return $theResultArray;
>   return $rows;
>   return $fields;
> }
> 

You can do the following:

function get_results( &$rows, &$fields )
{
// query database
$result = query($sql);

// turn result set into a useable array
$theResultArray = get_results($result);

$rows = mysql_num_rows($result);
$fields = mysql_num_fields($result);

return $theResultArray;
}

HTH,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



RE: [PHP] anyway to return more than one value?

2003-11-05 Thread Chris W. Parker
Robert Cummings 
on Wednesday, November 05, 2003 4:07 PM said:

> You can do the following:
> 
> function get_results( &$rows, &$fields )

Works great!


Thanks.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

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



RE: [PHP] fwrite, fopen, or fread limit?

2003-11-05 Thread Wouter van Vliet
I highly doubt that was all. Now uploads bigger than 7megs are allowed, you
should also make sure your script is able to deal with it files LARGER than
that. Hmm, maybe this didn't seem to make much sense. 

What I'm talking about is this:

 memory_limit = 8M  ; Maximum amount of memory a script may
consume (8MB) 

When using fwrite you probably load the entire file into memory and have a
high chance on exceeding the size of 8MB. Or if you're smart you do it line
by line and there's less problem with it.

Also I'd like to point you to the "move_uploaded_file" function. Just in
case you didn't know about it. 

Greetz,
Wouter

( sorry for the messy kinda post. I'm just all too confused about the
disappointing Matrix Revolutions... I'd like to compare it to a third-level
rip off of The Lord of the Rings (trilogy) meets Star Wars )

-Original Message-
From: Mike At Spy [mailto:[EMAIL PROTECTED] 
Sent: Tuesday 04 November 2003 18:55
To: Roger Spears
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] fwrite, fopen, or fread limit?


Yes, that was it.

Thanks! :)

-Mike


> -Original Message-
> From: Roger Spears [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, November 04, 2003 12:45 PM
> To: Mike At Spy
> Subject: Re: [PHP] fwrite, fopen, or fread limit?
> 
> 
> check the php.ini file, there may be a file upload limit placed there.  
> I ran into a similar problem awhile backI think it's called 
> max_file_upload or something like that...
> 
> Thanks,
> Roger
> 
> Mike At Spy wrote:
> 
> >Does anyone know if the commands for fwrite, fopen, or fread have 
> >memory limits in dealing with large files?
> >
> >I created a system for uploading files to a server.  Small files
> work fine.
> >Larger ones (around 7 megs) do not work at all.
> >
> >Thanks,
> >
> >-Mike
> >
> >  
> >
> 
> 
> 

--
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 objects problem

2003-11-05 Thread Michal O¹kera
Hi,
I've discovered strange behavior of PHP. The following script has no sense
and value,
it is simplified due to clearness. The output of the script should be (in my
opinion):

class A2
class A1

But it isn't (using PHP 4.3.4). The problem arise, when the Callback
function of a1
object calls GetOtherCnt. There, only a1 object is valid but not a2 although
it should be.
So, the output is:


class A1

It works, if the a1->Init() call is performed after creating the a2 object.
And in my
real script no replacing of this call helps. It is not clear to me why it
happens so.
What do You think about it? Have You any explanation for that?

Thanks for answers,
Mike

Here is the script:

control_class = $control_class;
}

function Callback()
{
return $this->control_class->GetOtherCnt($this->cnt);
}
}

class A1 extends A
{
var $cnt = "class A1";
}

class A2 extends A
{
var $cnt = "class A2";
}

class Control
{
var $a1 = FALSE;
var $a2 = FALSE;

function Init()
{
$this->a1 = new A1();
$this->a1->Init($this);

$this->a2 = new A2();
$this->a2->Init($this);
}

function PrintIt()
{
echo $this->a1->Callback() . "";
echo $this->a2->Callback() . "";
}

function GetOtherCnt($cnt)
{
if($cnt == $this->a1->cnt)
return $this->a2->cnt;
if($cnt == $this->a2->cnt)
return $this->a1->cnt;
return "";
}
}

$test = new Control();
$test->Init();

$test->PrintIt();

?>

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



Re: [PHP] anyway to return more than one value?

2003-11-05 Thread Boyan Nedkov
One possible solution could be to write a simple class that will hold 
all data you need at one single place:

class MyData {
  var $_resultArray;
  var $_rows;
  var $_fields;
  function MyData($resultArray, $rows, $fields) {
$this->data = $data;
$this->rowcounr = $rowcount;
$this->fildcount = $fildcount;
  }
  function getResultArray() {
return $this->_resultArray;
  }
  function getRows() {
return $this->_rows;
  }
  function getFilds () {
return $this->_fields;
  }
}
To put some data in that object write:

$data = new MyData($theResultArray, $rows, $fields);

To get back your stuff in your code use something like:

$theResultArray = MyData->getResultArray();
$rows =  MyData->getRows();
$fields = MyData->getFields();
This is only an example code, you should adjust it according your needs

hth

Boyan
--
Chris W. Parker wrote:

Hi list.

Ok I know it's not possible to "return" more than one value. But I'm
going to explain what I'd like to do so maybe there's an easy way to do
it.
I've got some functions that query a database and turn the result into
an array and return that array. What I'd like to do is not only return
the array of results but ALSO return a row count and field count of that
result.
Here is some pseudo code:

function get_results()
{
// query database
$result = query($sql);

// turn result set into a useable array
$theResultArray = get_results($result);
$rows = mysql_num_rows($result);
$fields = mysql_num_fields($result);
return $theResultArray;
return $rows;
return $fields;
}
Ok I know that won't work but that's just basically what I want to do.

The only way around this I've come up with is to stick all the values
into ANOTHER array and return then and then dissect that array in the
calling function, but that just seems messy.
All of a sudden the word "reference" came to mind. Is that what I want
to use?
Any help would be appreciated.

Thanks,
Chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] anyway to return more than one value?

2003-11-05 Thread John W. Holmes
Chris W. Parker wrote:
Ok I know it's not possible to "return" more than one value. But I'm
going to explain what I'd like to do so maybe there's an easy way to do
it.
I've got some functions that query a database and turn the result into
an array and return that array. What I'd like to do is not only return
the array of results but ALSO return a row count and field count of that
result.
Here is some pseudo code:

function get_results()
{
// query database
$result = query($sql);

// turn result set into a useable array
$theResultArray = get_results($result);
$rows = mysql_num_rows($result);
$fields = mysql_num_fields($result);
return $theResultArray;
return $rows;
return $fields;
}
Ok I know that won't work but that's just basically what I want to do.

The only way around this I've come up with is to stick all the values
into ANOTHER array and return then and then dissect that array in the
calling function, but that just seems messy.
Are you talking about something like this:

$retval['result'] = get_results($result);
$retval['rows'] = mysql_num_rows($result);
$retval['fields'] = mysql_num_fields($result);
return $retval;

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


Re: [PHP] Having trouble with Uploading Files to Server...

2003-11-05 Thread Dimitri Marshall
Wicked... Works, thanks.

Dimitri Marshall

"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Web server need permission to write to
> /home/unit-dir/public_html/members/memberpix/ directory. Change the
> directory permissions to 777.
>
> Dimitri Marshall wrote:
>
> > Hi,
> > I'm trying to allow users to upload files to my server. I have the
> > appropriate code (I think) but I'm getting this error message. Can
someone
> > tell me why, and how to fix this?
> >
> > Warning:
> >
move_uploaded_file(/home/unit-dir/public_html/members/memberpix/dimitrihomel
> > ess.gif): failed to open stream: Permission denied in
> > /home/unit-dir/public_html/members/updatehomepage.php on line 36
> >
> > Warning: move_uploaded_file(): Unable to move '/tmp/php9PUwlg' to
> > '/home/unit-dir/public_html/members/memberpix/dimitrihomeless.gif' in
> > /home/unit-dir/public_html/members/updatehomepage.php on line 36
> > Couldn't upload first image
> >
> > Thanks,
> > Dimitri Marshall
> >

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



  1   2   >