[PHP] problem install pws and php

2004-05-12 Thread lee 03

i am  a beginner for php programming, my OS is win98 while my webserver is PWS, all is 
in the same machine,when i try to run my internet explorer( type in 
http://localhost/phpinfo.php), phpinfo.php cannot be display.
 
i try to reinstall pws and php follow the instrustruction but its still same problem. 
 
i hope yours can help me to show whats wrong, thanks for your help

 



-
  Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download 
Messenger Now

RE: [PHP] PHP5 - instanceof [SOLVED]

2004-05-12 Thread Martin Towell
ah yes, of course "instanceof" means you're working with an instance of an
class - 

Pity there's no equivalent for classes :( oh well, I'll just have
instantiate the class first then do the checking.

Thanks
Martin

> -Original Message-
> From: Travis Low [mailto:[EMAIL PROTECTED]
> Sent: Thursday, 13 May 2004 2:42 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] PHP5 - instanceof
> 
> 
> An instance only exists after it has been instantiated.  So 
> you can't know 
> anything about an instance (== an object) beforehand.  It's 
> like knowing a 
> person before they are born.
> 
> Maybe you mean you want to determine if class B is a subclass 
> of class A. 
> That's the same problem again.  Even if PHP5 had a Class 
> object (a la Java), 
> you'd have to instantiate *it* in order to find the 
> relationship between class 
> A and class B.  Prior to that point, you only have text 
> strings to work with. 
> I suppose you could search the text of the file for "extends 
> FooBar" or something.
> 
> cheers,
> 
> Travis
> 
> Martin Towell wrote:
> > I have been playing with PHP5 and am liking it more and 
> more. But I have one
> > question about "instanceof"
> > 
> > If you have something like this:
> > 
> >  > class A { }
> > class B extends A { }
> > $x = new B;
> > if ($x instanceof B)  echo "B";
> > if ($x instanceof A)  echo "A";
> > ?>
> > 
> > This would echo "BA". That's good, I understand that.
> > 
> > Now the question: Is it possible to determine if B is an 
> instance of A
> > without instantiating it?
> > 
> > Thanks
> > Martin
> > 
> 
> -- 
> Travis Low

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



[PHP] Multiple Socket's at one time

2004-05-12 Thread Terence
Hi All,

A simple example I got from the manual:

$fp = @fsockopen ($address, $port, $errno, $errstr, 5);
if (!$fp) {
   echo "Oops";
} else {
 echo "Ok";
  fclose ($fp);
}

Can someone point me in the direction of being able to probe multiple ports
at the same time? (multi-threading or forking concept) We are looking at
creating our own monitoring service to test if ports are open on our
servers. If we scan every minute, and each takes 5 seconds, that only allows
us 12 such ports before we overflow into the next minute. Unless someone
else has a better solution that we can implement?


Thanks!
Terence

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



Re: [PHP] PHP5 - instanceof

2004-05-12 Thread Travis Low
An instance only exists after it has been instantiated.  So you can't know 
anything about an instance (== an object) beforehand.  It's like knowing a 
person before they are born.

Maybe you mean you want to determine if class B is a subclass of class A. 
That's the same problem again.  Even if PHP5 had a Class object (a la Java), 
you'd have to instantiate *it* in order to find the relationship between class 
A and class B.  Prior to that point, you only have text strings to work with. 
I suppose you could search the text of the file for "extends FooBar" or something.

cheers,

Travis

Martin Towell wrote:
I have been playing with PHP5 and am liking it more and more. But I have one
question about "instanceof"
If you have something like this:


This would echo "BA". That's good, I understand that.

Now the question: Is it possible to determine if B is an instance of A
without instantiating it?
Thanks
Martin
--
Travis Low


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


[PHP] PHP5 - instanceof

2004-05-12 Thread Martin Towell
I have been playing with PHP5 and am liking it more and more. But I have one
question about "instanceof"

If you have something like this:



This would echo "BA". That's good, I understand that.

Now the question: Is it possible to determine if B is an instance of A
without instantiating it?

Thanks
Martin

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



RE: [PHP] a good user directory application...

2004-05-12 Thread bruce
ryan...

we've seen apps that have had some of the functions we're looking for... ie
dating apps, cms systems, etc... we're curious if anybody has seen/used
something that they've considered to be really good/solid...

-bruce
[EMAIL PROTECTED]


-Original Message-
From: Ryan A [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 12, 2004 8:59 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] a good user directory application...



On 5/13/2004 4:29:52 AM, [EMAIL PROTECTED] wrote:
> hey...
>
> hi.
> we're looking for a good/really good web based user directory
> application. we'd
> like the app to be able to allow users to login, and add
> information to their profile.
> we'd prefer an app that would provide the
> ability to select/add additional information fields and not constrain us.
we
> would also like an app that allows the user to upload a picture for the
> other users to be able to see...
>
> we're
> looking for something that will allow our users to be able to search
> through the profile information, to find other users with the skills that
> they need. The goal is to be able to support a distributed team of users.
> this would be a way of allowing them to kind of stay in touch.
>
> we'd also prefer that the app have a good admin function.
>
> if need be, we could always rip this function out of an existing app if
you
> know of one, and create a stand alone app
>
> Of course we'd
> also prefer that the app be "open source"...

Of course...why pay for something so useful??
Maybe you would also prefer for someone to make this for you...open source
and free of course :-)

Cheers,
-Ryan

--
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] a good user directory application...

2004-05-12 Thread Ryan A

On 5/13/2004 4:29:52 AM, [EMAIL PROTECTED] wrote:
> hey...
>
> hi.
> we're looking for a good/really good web based user directory
> application. we'd
> like the app to be able to allow users to login, and add
> information to their profile.
> we'd prefer an app that would provide the
> ability to select/add additional information fields and not constrain us.
we
> would also like an app that allows the user to upload a picture for the
> other users to be able to see...
>
> we're
> looking for something that will allow our users to be able to search
> through the profile information, to find other users with the skills that
> they need. The goal is to be able to support a distributed team of users.
> this would be a way of allowing them to kind of stay in touch.
>
> we'd also prefer that the app have a good admin function.
>
> if need be, we could always rip this function out of an existing app if
you
> know of one, and create a stand alone app
>
> Of course we'd
> also prefer that the app be "open source"...

Of course...why pay for something so useful??
Maybe you would also prefer for someone to make this for you...open source
and free of course :-)

Cheers,
-Ryan

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



Re: [PHP] HTTP_RAW_POST_DATA

2004-05-12 Thread Michal Migurski
> > Isn't this potentially a DoS attack vector anyway? I don't need a server
> > to accept or read my obscenely long POST requests to clog the pipes with
> > them. Would the proper way to handle this risk be to disallow POST at the
> > webserver level, or does turning always_populate_raw_post_data off cause
> > the connection to be automatically dropped after Connection: close?
>
> By default php streams the STDIN to a file so your just dealing with
> buffer sized ~2K-4K.  enabling this option makes php put the contents
> into memory, thus leaving open the possiblity of someone using up all
> your memory and bringing the machine to a standstill till, then when
> swap space runs out.. watch out! :)

This makes sense, thanks.

-
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] a good user directory application...

2004-05-12 Thread bruce
hey...

hi. we're looking for a good/really good web based user directory
application. we'd like the app to be able to allow users to login, and add
information to their profile. we'd prefer an app that would provide the
ability to select/add additional information fields and not constrain us. we
would also like an app that allows the user to upload a picture for the
other users to be able to see...

we're looking for something that will allow our users to be able to search
through the profile information, to find other users with the skills that
they need. The goal is to be able to support a distributed team of users.
this would be a way of allowing them to kind of stay in touch.

we'd also prefer that the app have a good admin function.

if need be, we could always rip this function out of an existing app if you
know of one, and create a stand alone app

Of course we'd also prefer that the app be "open source"...

Thanks,

bruce
[EMAIL PROTECTED]

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



Re: [PHP] HTTP_RAW_POST_DATA

2004-05-12 Thread Curt Zirzow
* Thus wrote Michal Migurski ([EMAIL PROTECTED]):
> > > Anyone have any clue why this is the case? Is there a performance
> > > reason that raw post data must be explicitly enabled, or is it more of
> > > a protective measure for overly permissive beginner scripts?
> >
> > If it was always enabled, it sure would make a DoS attack easy. I'd just
> > send lots of huge POST requests to any PHP script on your server. Hope
> > you have "migs and megs of memories," as Strong Bad would say. :-)
> 
> Isn't this potentially a DoS attack vector anyway? I don't need a server
> to accept or read my obscenely long POST requests to clog the pipes with
> them. Would the proper way to handle this risk be to disallow POST at the
> webserver level, or does turning always_populate_raw_post_data off cause
> the connection to be automatically dropped after Connection: close?

The POST data basically sits in STDIN for the webserver, it will
just sit there unless somebody like php reads that data and does
something with it.

By default php streams the STDIN to a file so your just dealing
with buffer sized ~2K-4K.  enabling this option makes php put the
contents into memory, thus leaving open the possiblity of someone
using up all your memory and bringing the machine to a standstill
till, then when swap space runs out.. watch out! :)


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



[PHP] Re: Zip-code Form Validation Scripts and Zipcode Program

2004-05-12 Thread Manuel Lemos
Hello,

On 05/12/2004 09:22 PM, Ryan Munevar wrote:
Question 1:  Does anyone have a really good php form validation script 
for Zip-codes?

Question 2:  Does anyone know of a great depository of form validation 
scripts for all kinds of form inputs?
http://www.phpclasses.org/formsgeneration



Question 3:  Does anyone know (yea I know, getting tedious here) of a 
way or program to check the real distance from one zip-code to another 
zip-code like on yahoo maps?
http://www.phpclasses.org/phpziplocator

--

Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] HTTP_RAW_POST_DATA

2004-05-12 Thread raditha dissanayake
Michal Migurski wrote:

Anyone have any clue why this is the case? Is there a performance
reason that raw post data must be explicitly enabled, or is it more of
a protective measure for overly permissive beginner scripts?
 

If it was always enabled, it sure would make a DoS attack easy. I'd just
send lots of huge POST requests to any PHP script on your server. Hope
you have "migs and megs of memories," as Strong Bad would say. :-)
   

Isn't this potentially a DoS attack vector anyway? I don't need a server
to accept or read my obscenely long POST requests to clog the pipes with
them. Would the proper way to handle this risk be to disallow POST at the
webserver level, or does turning always_populate_raw_post_data off cause
the connection to be automatically dropped after Connection: close?
 

Well if you disallow post, you will have to use get for things like 
login in - insecure. And you will be limited to about 1024 bytes of data 
on most systems and you can't use file uploads.

I guess you would know how to how to create malformed packets. Doing a 
dos attack on a PHP script that accepts POST you only need about 10 
lines of code, don't need to know how to create malformed packets, and 
you don't waste your own bandwidth.

--
Raditha Dissanayake.
-
http://www.radinks.com/print/upload.php
SFTP, FTP and HTTP File Upload solutions 

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


Re: [PHP] HTTP_RAW_POST_DATA

2004-05-12 Thread raditha dissanayake
Chris Shiflett wrote:

--- raditha dissanayake <[EMAIL PROTECTED]> wrote:
 

NOw I am very curious, the raw_post_data doesn't always get
populated even with that setting. If i have not been barking up
the wrong tree all these years that variable only gets populated
if the content type is not url-encoded or multipart/form-data. If
you are indeed using one of these types please be so kind as to
share more info about your set up, this is something i would like
to reproduce.
   

This is what our tangential conversation touched on. Curt mentioned that
always_populate_raw_post_data is a funny name, and I mentioned how it was
also misleading (always should mean always).
I assume the original poster is using neither of the content types you
mention, since this was already working for him in one environment.
 

Hi,
Thants what I am also thinking, i was quite taken aback to read the original post. 
shocked in fact.
Raditha Dissanayake.
-
http://www.radinks.com/print/upload.php
SFTP, FTP and HTTP File Upload solutions 

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


[PHP] Zip-code Form Validation Scripts and Zipcode Program

2004-05-12 Thread Ryan Munevar
Hey Guys,
	
Question 1:  Does anyone have a really good php form validation script 
for Zip-codes?

Question 2:  Does anyone know of a great depository of form validation 
scripts for all kinds of form inputs?

Question 3:  Does anyone know (yea I know, getting tedious here) of a 
way or program to check the real distance from one zip-code to another 
zip-code like on yahoo maps?

Thank you.

   
 Later,
   
 Ryan
P.S.  "Man only needs 3 things to survive...  Water, food, and 37 lb. 
of fluid resistant pornography.  Everything else is just semantics." 
 

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


Re: [PHP] mysql went away

2004-05-12 Thread raditha dissanayake
This should be in a mysql newsgroup.

Bill Green wrote:

HI. I've been using mySQL 4.0.13, php4.3.4, and phpMyAdmin2.5.5 on Mac 
OS 10.3.3 as a learning/testing/development environment for a couple 
of months now - no problems, works great.

I've created more than a few mySQL databases and tables, but yesterday 
I created a database, a table, and LOAD DATA from within phpMyAdmin. 
Successfully. I looked at the data and all was fine. Logged out and 
went away for a while. Came back and phpMyAdmin would not show me my 
databases in the left frame, and I could not launch a query window. I 
could see runtime information, system vars, processes, and even 
privileges.

I tried logging in to mySQL through the terminal Through the command 
line client I can run simple commands, but no commands to view or 
affect databases or tables.

I can run php scripts from a browser - connect to databases, retrieve 
and even insert/update data, but I cannot view databases or tables, 
and though I haven't tried I doubt I'll be able to create, delete, or 
backup databases or tables.

Does anyone have a clue about what the problems may be or where I 
should start?

---
Bill Green
[EMAIL PROTECTED]


--
Raditha Dissanayake.
-
http://www.radinks.com/print/upload.php
SFTP, FTP and HTTP File Upload solutions 

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


[PHP] site search engine.. not dynamic

2004-05-12 Thread Aaron Wolski
Hi all,
 
Can anyone point me in the direction of a site search engine that reads
files in a directory find relevant results for an search term that a
person might enter on a site?
 
I need to build a site search engine but the problem is. the site isn't
dynamic (yet) so I need to read actual files to pull things together.
 
Anything out there?
 
Thanks!
 
Aaron
 


[PHP] Re: Ordering alphabetical in secondary select string

2004-05-12 Thread R.G. Vervoort
it are different table and the first table does not contain names, onlu the
id form names.

Ordering ASC woll not work because it is not in the first query

thank for thinking with me anyway
"Dennis Biletsky" <[EMAIL PROTECTED]> schreef in bericht
news:[EMAIL PROTECTED]
>
> "R.G. Vervoort" <[EMAIL PROTECTED]> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ
> ÓÌÅÄÕÀÝÅÅ: news:[EMAIL PROTECTED]
> >
> >
> >
> >
> > Does anyone have a suggestion how I can order a list with names in a
> > secondary select string.
> >
> >
> >
> > The first string selects a number of locations where people work
> >
> >
> >
> > From this string I get several id's form people (in the location table
> there
> > are no names but id's form the people table) that work on those
locations
> >
> >
> >
> > No I make another select to get the name form the people table using the
> id
> > I got before.
> >
> >
> >
> > I would like to have the table ordered alphabetical by the name of the
> > people
> >
> >
> >
> > Since the number op people is very long is will be to slow working the
> other
> > way around (first selecting people and then  looking for the location)
> >
> >
> >
> > Example:
> >
> >
> >
> > Location 1Name A
> >
> > Name B
> >
> > Name C
> >
> > Location 3Name D
> >
> > Name E
> >
> > Location 5Name F
> >
> > Location 2Name G
> >
> > Location 9Name H
> >
> > Location 7Name I
> >
> >
> >
> >
> >
> >
> >
> >
> ORDER BY name ASC
>
>

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



Re: [PHP] Reshuffling an array

2004-05-12 Thread Todd Cary
Works as advertised.  Made it a sort.

Todd

John W. Holmes wrote:
From: "Todd Cary" <[EMAIL PROTECTED]>

I do the following:

  $eventList = array();
  $eventList[] = "Any";
  $dbh = db_open($host, $user, $password, $database);
  if($dbh) {
$sthdl = db_get_event_data($dbh);
while ($row = mysql_fetch_object($sthdl)) {
  $eventList[] = $row->EV_EVENT;
}
  } else {
$eventList[] = "* None found *";
  }
  asort( $eventList );
Now I want to put "Any" as the first item.  What is the best way to do
this?  Often the sort puts it as an item down the list.


Remove the line adding 'Any' at the beginning of your code and use
array_unshift() to add it at the end.
   $eventList = array();
   $dbh = db_open($host, $user, $password, $database);
   if($dbh) {
 $sthdl = db_get_event_data($dbh);
 while ($row = mysql_fetch_object($sthdl)) {
   $eventList[] = $row->EV_EVENT;
 }
   } else {
 $eventList[] = "* None found *";
   }
   asort( $eventList );
   array_unshift($eventList,'Any');
do you really need to maintain the numeric keys to the array by using
asort() instead of just sort()? If so, this may not work. You may be able to
use array_splice($input, 0, 0, array('Any')) or array_merge().
---John Holmes...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Breaking out of a loop...

2004-05-12 Thread Tom Rogers
Hi,

Thursday, May 13, 2004, 6:57:14 AM, you wrote:
RF> Hi,

RF> I have this code (below) that waits for particular data to come over
RF> the socket ("ENX"), at which point it breaks out of the loop and does
RF> other things. Presently, it will loop forever, until it receives 
RF> "ENX"—a good start—but I also need it to break-out if the loop runs
RF> longer than five seconds. This is where I'm having a problem. It seems
RF> that it is only reading once data comes over the socket, so it is stuck
RF> on that first  'while' line ("while(($buf = 
RF> socket_read($socket,128,PHP_BINARY_READ)) !== false) {").

RF> $timer = time();
RF> while(($buf = socket_read($socket,128,PHP_BINARY_READ)) !== false) {
RF> $data .= $buf;
RF> $elapsed = time() - $timer; 
RF> if(preg_match("/ENX/", $data)) {
RF> break;
RF> } elseif ($elapsed > 5) {
RF> echo "TOO LONG!\n";
RF> break;
RF> }
RF> }

RF> Maybe set non-blocking / blocking socket is the answer? Only problem is
RF> I can't find much [good] documentation describing what blocking and
RF> non-blocking sockets are good for, etc. Any ideas? Thanks.

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


Try doing this at the error point

} elseif ($elapsed > 5) {
  echo "TOO LONG!\n";
  break 2; //kill both loops
}

-- 
regards,
Tom

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



Re: [PHP] HTTP_RAW_POST_DATA

2004-05-12 Thread Chris Shiflett
--- raditha dissanayake <[EMAIL PROTECTED]> wrote:
> NOw I am very curious, the raw_post_data doesn't always get
> populated even with that setting. If i have not been barking up
> the wrong tree all these years that variable only gets populated
> if the content type is not url-encoded or multipart/form-data. If
> you are indeed using one of these types please be so kind as to
> share more info about your set up, this is something i would like
> to reproduce.

This is what our tangential conversation touched on. Curt mentioned that
always_populate_raw_post_data is a funny name, and I mentioned how it was
also misleading (always should mean always).

I assume the original poster is using neither of the content types you
mention, since this was already working for him in one environment.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming Fall 2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



Re: [PHP] Breaking out of a loop...

2004-05-12 Thread Curt Zirzow
* Thus wrote Ren Fournier ([EMAIL PROTECTED]):
> Thanks for the help, but I now get the error "PHP Warning:   
> socket_set_option() expects exactly 4 parameters, 3 given in  
> /Users/test/cr.php on line 51" when I run the script. Also, it still  
> seems to just wait on that "while" line, instead of skipping to the "}  
> elseif ($elapsed > 5) {" and breaking from the loop (which is what I  
> want it to do). (Is it just me, or is the PHP documentation on  
> socket_set_block and socket_set_option a bit too sparse? I mean, where  
> do you find the docs on those options and values?)

yeah it is rather undocumentated, probably because of its current
EXPERIMENTAL status.

the actual call should be this:

$timeout = array('sec' => 5, 'usec' => 0);
socket_set_option($socket, SOL_SOCKET, SO_RCVTIMEO, $timeout); 


The idea of using the blocking method and letting the read() call
to handle the time, makes you're loop simplier and not have to
manage the time elapsed.

If you want to manage the elapsed time yourself (nonblocking),
you'll have to restructure your loop because the read() will fail
if no data is available.  Not to mention it will be rather
unfriendly for your cpu since you're going to have a loop that
continue to run for 5 seconds.  

Another option would be to use the fsockopen/fread tools.
 
Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] Breaking out of a loop...

2004-05-12 Thread René Fournier
Thanks for the help, but I now get the error "PHP Warning:   
socket_set_option() expects exactly 4 parameters, 3 given in  
/Users/test/cr.php on line 51" when I run the script. Also, it still  
seems to just wait on that "while" line, instead of skipping to the "}  
elseif ($elapsed > 5) {" and breaking from the loop (which is what I  
want it to do). (Is it just me, or is the PHP documentation on  
socket_set_block and socket_set_option a bit too sparse? I mean, where  
do you find the docs on those options and values?)

 
-
socket_set_block($socket);
socket_set_option($socket,SO_RCVTIMEO,5000); // milliseconds iirc

do {
	$timer = time();
	while(($buf = socket_read($socket,128,PHP_BINARY_READ)) !== false) {
		$data .= $buf;
		$elapsed = time() - $timer;	
		if(preg_match("/ENX/", $data)) {
			break;
			} elseif ($elapsed > 5) {
			echo "TOO LONG!\n";
			break;
			}
		if ($error = socket_last_error($socket)) {
			echo "socket error [$error]:" . socket_strerror($error);
			}
		}
 
-



On Wednesday, May 12, 2004, at 03:41 PM, Curt Zirzow wrote:

* Thus wrote Ren Fournier ([EMAIL PROTECTED]):
Hi,

I have this code (below) that waits for particular data to come over
the socket ("ENX"), at which point it breaks out of the loop and does
other things. Presently, it will loop forever, until it receives
"ENX"—a good start—but I also need it to break-out if the loop runs
longer than five seconds. This is where I'm having a problem. It seems
that it is only reading once data comes over the socket, so it is  
stuck
on that first  'while' line ("while(($buf =
socket_read($socket,128,PHP_BINARY_READ)) !== false) {").

$timer = time();
while(($buf = socket_read($socket,128,PHP_BINARY_READ)) !== false) {
$data .= $buf;
$elapsed = time() - $timer; 
if(preg_match("/ENX/", $data)) {
break;
} elseif ($elapsed > 5) {
echo "TOO LONG!\n";
break;
}
}
Maybe set non-blocking / blocking socket is the answer? Only problem  
is
I can't find much [good] documentation describing what blocking and
non-blocking sockets are good for, etc. Any ideas? Thanks.
blocking - wait for response or till timeout
non-blocking - return right away
If you use blocking and then set the timeout for the read, you can
just check for socket_last_error() after the loop.
socket_set_block($socket);
socket_set_option($socket, SO_RCVTIMEO, 5000); // milliseconds iirc
while(($buf = socket_read($socket,128,PHP_BINARY_READ)) !== false) {
  //...
}
if ($error = socket_last_error($socket) ) {
  echo "socket error [$error]:" . socket_strerror($error);
}
or something like that.

Curt
--
"I used to think I was indecisive, but now I'm not so sure."
--
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] PHP Session Handlers

2004-05-12 Thread Paul Higgins
Ok, thanks.

One other question.  If I use the example I cited earlier, are the session 
values still stored in a flat file?  Or do I have to replace that with 
database entries?

Thanks.


From: "John W. Holmes" <[EMAIL PROTECTED]>
Reply-To: "John W. Holmes" <[EMAIL PROTECTED]>
To: "Paul Higgins" 
<[EMAIL PROTECTED]>,<[EMAIL PROTECTED]>
Subject: Re: [PHP] PHP Session Handlers
Date: Wed, 12 May 2004 15:14:36 -0400

From: "Paul Higgins" <[EMAIL PROTECTED]>

> I just read this tutorial:
> http://www.phpbuilder.com/columns/ying2602.php3
>
> I understand what each function does and what to do in each function.
> However, my question is this:  If I write my own session handling
functions,
> do I have to explicity call them myself?  If so, when do I call them?
No, you'll just use sessions as normal and these functions will be used by
PHP when needed. For instance, at the end of the script when PHP needs to
save the current session variables, it'll call your "write()" function. You
just use sessions as normal, though.
---John Holmes...

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
_
Getting married? Find tips, tools and the latest trends at MSN Life Events. 
http://lifeevents.msn.com/category.aspx?cid=married

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


[PHP] security and extended ascii characters

2004-05-12 Thread Chris W
In an effort to make sure no binary data is maliciously submitted via a
form I have code the makes sure all characters in any input field are
with in the range of a space to a "~".  However now that I am getting
some users of my site from Europe, that are having problems submitting
some extended characters.  I don't have the time to localize this site
for every language but I would like to make it so European users can
enter the character that you don't find in the English alphabet.  So I
was wondering what other ascii values I need to allow so users in Europe
won't have these problems?
Chris W
Bring Back the HP 15C
http://hp15c.org:8080
If you don't get the gifts you "really want", maybe The Wish Zone can help.
http://thewishzone.com:8086
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] mysql went away

2004-05-12 Thread Bill Green
HI. I've been using mySQL 4.0.13, php4.3.4, and phpMyAdmin2.5.5 on Mac 
OS 10.3.3 as a learning/testing/development environment for a couple of 
months now - no problems, works great.

I've created more than a few mySQL databases and tables, but yesterday 
I created a database, a table, and LOAD DATA from within phpMyAdmin. 
Successfully. I looked at the data and all was fine. Logged out and 
went away for a while. Came back and phpMyAdmin would not show me my 
databases in the left frame, and I could not launch a query window. I 
could see runtime information, system vars, processes, and even 
privileges.

I tried logging in to mySQL through the terminal Through the command 
line client I can run simple commands, but no commands to view or 
affect databases or tables.

I can run php scripts from a browser - connect to databases, retrieve 
and even insert/update data, but I cannot view databases or tables, and 
though I haven't tried I doubt I'll be able to create, delete, or 
backup databases or tables.

Does anyone have a clue about what the problems may be or where I 
should start?

---
Bill Green
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] HTTP_RAW_POST_DATA

2004-05-12 Thread Michal Migurski
> > Anyone have any clue why this is the case? Is there a performance
> > reason that raw post data must be explicitly enabled, or is it more of
> > a protective measure for overly permissive beginner scripts?
>
> If it was always enabled, it sure would make a DoS attack easy. I'd just
> send lots of huge POST requests to any PHP script on your server. Hope
> you have "migs and megs of memories," as Strong Bad would say. :-)

Isn't this potentially a DoS attack vector anyway? I don't need a server
to accept or read my obscenely long POST requests to clog the pipes with
them. Would the proper way to handle this risk be to disallow POST at the
webserver level, or does turning always_populate_raw_post_data off cause
the connection to be automatically dropped after Connection: close?

-mike.

-
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] Breaking out of a loop...

2004-05-12 Thread Curt Zirzow
* Thus wrote Ren Fournier ([EMAIL PROTECTED]):
> Hi,
> 
> I have this code (below) that waits for particular data to come over 
> the socket ("ENX"), at which point it breaks out of the loop and does 
> other things. Presently, it will loop forever, until it receives 
> "ENX"—a good start—but I also need it to break-out if the loop runs 
> longer than five seconds. This is where I'm having a problem. It seems 
> that it is only reading once data comes over the socket, so it is stuck 
> on that first  'while' line ("while(($buf = 
> socket_read($socket,128,PHP_BINARY_READ)) !== false) {").
> 
>   $timer = time();
>   while(($buf = socket_read($socket,128,PHP_BINARY_READ)) !== false) {
>   $data .= $buf;
>   $elapsed = time() - $timer; 
>   if(preg_match("/ENX/", $data)) {
>   break;
>   } elseif ($elapsed > 5) {
>   echo "TOO LONG!\n";
>   break;
>   }
>   }
> 
> Maybe set non-blocking / blocking socket is the answer? Only problem is 
> I can't find much [good] documentation describing what blocking and 
> non-blocking sockets are good for, etc. Any ideas? Thanks.

blocking - wait for response or till timeout
non-blocking - return right away

If you use blocking and then set the timeout for the read, you can
just check for socket_last_error() after the loop.

socket_set_block($socket);
socket_set_option($socket, SO_RCVTIMEO, 5000); // milliseconds iirc
while(($buf = socket_read($socket,128,PHP_BINARY_READ)) !== false) {
  //...
}
if ($error = socket_last_error($socket) ) {
  echo "socket error [$error]:" . socket_strerror($error);
}


or something like that.

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] HTTP_RAW_POST_DATA

2004-05-12 Thread Chris Shiflett
--- Michal Migurski <[EMAIL PROTECTED]> wrote:
> Anyone have any clue why this is the case? Is there a performance
> reason that raw post data must be explicitly enabled, or is it more
> of a protective measure for overly permissive beginner scripts?

If it was always enabled, it sure would make a DoS attack easy. I'd just
send lots of huge POST requests to any PHP script on your server. Hope you
have "migs and megs of memories," as Strong Bad would say. :-)

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming Fall 2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



[PHP] Breaking out of a loop...

2004-05-12 Thread René Fournier
Hi,

I have this code (below) that waits for particular data to come over 
the socket ("ENX"), at which point it breaks out of the loop and does 
other things. Presently, it will loop forever, until it receives 
"ENX"—a good start—but I also need it to break-out if the loop runs 
longer than five seconds. This is where I'm having a problem. It seems 
that it is only reading once data comes over the socket, so it is stuck 
on that first  'while' line ("while(($buf = 
socket_read($socket,128,PHP_BINARY_READ)) !== false) {").

$timer = time();
while(($buf = socket_read($socket,128,PHP_BINARY_READ)) !== false) {
$data .= $buf;
$elapsed = time() - $timer; 
if(preg_match("/ENX/", $data)) {
break;
} elseif ($elapsed > 5) {
echo "TOO LONG!\n";
break;
}
}
Maybe set non-blocking / blocking socket is the answer? Only problem is 
I can't find much [good] documentation describing what blocking and 
non-blocking sockets are good for, etc. Any ideas? Thanks.

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


[PHP] Re: Memory usage

2004-05-12 Thread Torsten Roehr
"Oliver Hankeln" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi!
>
> I get memory exceded errors and want to find out why. So I am looking
> for a way to determine how much memory is currently beeing used by my
> script. Is this possible?
> getPID + reading from /proc dosent work because php is an apache module.
> (I can´t change this)
>
> Thanks!

Maybe this script will help you:
http://phpsysinfo.sourceforge.net/

Regards, Torsten

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



[PHP] mcrypt & pdflib configuration

2004-05-12 Thread William Holroyd
I've already posted this question in comp.lang.php but no one seemed to have
an answer to it.

So I've got PHP to recognize mcrypt and pdflib in the phpinfo() output, but
trying to use any of the functions fail with "...undefined function
called..". There aren't any configurable files with either distro and
neither mention php.ini settings need to be made. Restarting the apache
server does not fix this and no errors are reported while starting.

The most recent stable releases Apache 2.0.49 and PHP 4.3.6 are being used
with mcrypt 2.4 (stable, but 2.6.4 is most recent) and pdflib 5.0.3p1 (most
recent stable release) libraries, running on Windows 2003 Server Enterprise
with all updates applied.

I picked up a copy of Visual Studio .NET Enterprise but am also stumped of
how to compile these functions from source which I would prefer to do at
this point.

Any help on either topic is much appreciated.

-William

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



[PHP] Re: User/Group rights system?

2004-05-12 Thread Torsten Roehr
"David David" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello,
>
> Does anyone know of an open source "user/group" based
> permission system built with php/MySQL?
>
> That is, the effective rights for any user on a
> specific secured object are computed from various
> permit/deny permissions assigned to the user or any of
> the groups he/she belongs to.
>
> PEAR::Auth seems only to support basic user
> authentication.



Take a look at PEAR's LiveUser:
http://pear.php.net/package/LiveUser

Regards, Torsten

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



[PHP] Re: include (or require) doesn't seem to work

2004-05-12 Thread Torsten Roehr
"Daniel Barbar" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Thanks Torsten! Using the file-system relative path made it work (I had
> tried only with the absolute path, which ddidn't work). However, I checked
> again and I did have 'allow_url_fopen = On' in /etc/php.ini. I'll take a
> closer look later and report the problem if I find it. Thanks again,
>
> Daniel

Using the absolute path works as well - but you have to use the full LOCAL
file path, e.g. /htdocs/www/your-domain etc.

You can get this value from $_SERVER['DOCUMENT_ROOT'].

Regards, Torsten

>
> "Torsten Roehr" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > > Try including it as a local file:
> > > require_once library.php'; // if it is in the same directory as the
file
> > you
> >
> > Forgot a quote here, sorry:
> > require_once 'library.php';
> >
> > Torsten

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



[PHP] SuExec and PHP

2004-05-12 Thread Travis Low
Greetings.  We have a need for our PHP scripts to run as the user and group 
associated with each Apache virtual domain on our Redhat server.  Currently, 
all PHP scripts run as nobody.nobody.

I know that the apache suexec module allows CGI scripts to run as the user and 
group of the virtual host, but that doesn't seem to be the case for PHP scripts 
run under the apache php module (mod_php).

So my questions are:

(1) Can we use suexec to force PHP scripts (running under mod_php) to run as 
the user/group associated with the virtual host?  If so, how?  Are there any 
special configuration tricks to make this happen?

(2) If we CAN'T use suexec with mod_php, I assume we can run PHP as CGI to 
solve our problem.  However, I'm worried about performance.  Have any of you 
done this on linux?  Is it difficult to configure?  Do you have to audit all of 
your PHP scripts?  Etc., etc.

I did read the pages http://www.php.net/security.cgi_bin and 
http://www.php.net/manual/en/security.apache.php, but did not come away with 
clear answers to my questions.  There were also a lot of contradictory comments 
at the bottom of those pages, and a whole mess of stuff on google, so I'm 
getting more lost, not less.  Please help!

cheers,

Travis

--
Travis Low


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


[PHP] Using PHP4 4.3.4 as a CGI

2004-05-12 Thread Mark Constable
Debian testing system with a recent update to php-cgi 4.3.4.

I have been using the /usr/bin/php4 binary as a some.cgi with
a shbang line of "#!/usr/bin/php4" which worked fine up until
this recent 4.3.4 update. Now the new 4.3.4 php4 binary does
not produce a "Content-type: index/html\n\n" header nor does
it receive any GPC (GET POST etc) variables at all. I've been
throught the new php.ini and I cannot see any parameters or
advice as to what may have changed.

Could anyone advise me how to re-enable receiving incoming
variables for a /usr/bin/php4 binary used as a CGI please ?

--markc

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



Re: [PHP] PHP Session Handlers

2004-05-12 Thread John W. Holmes
From: "Paul Higgins" <[EMAIL PROTECTED]>

> I just read this tutorial:
> http://www.phpbuilder.com/columns/ying2602.php3
>
> I understand what each function does and what to do in each function.
> However, my question is this:  If I write my own session handling
functions,
> do I have to explicity call them myself?  If so, when do I call them?

No, you'll just use sessions as normal and these functions will be used by
PHP when needed. For instance, at the end of the script when PHP needs to
save the current session variables, it'll call your "write()" function. You
just use sessions as normal, though.

---John Holmes...

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



[PHP] PHP Session Handlers

2004-05-12 Thread Paul Higgins
Hi all,

I just read this tutorial:  
http://www.phpbuilder.com/columns/ying2602.php3

I understand what each function does and what to do in each function.  
However, my question is this:  If I write my own session handling functions, 
do I have to explicity call them myself?  If so, when do I call them?

Thanks

_
MSN Toolbar provides one-click access to Hotmail from any Web page – FREE 
download! http://toolbar.msn.com/go/onm00200413ave/direct/01/

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


RE: [PHP] Strange music playing behavior

2004-05-12 Thread Jay Blanchard
[snip]
> Top posting rocks!
> 

You like to live dangerously.  ;)
[/snip]

Dammit! I forgot the [sarcasm] tags! :)

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



RE: [PHP] Strange music playing behavior

2004-05-12 Thread Ryan Schefke
I fixed it, thanks!  It turns out my src=" " location was wrong since I
moved the file.  I just freaked cause I thought it was an issue with
php+html.

Sorry, Ryan

-Original Message-
From: Ryan Schefke [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 12, 2004 2:35 PM
To: 'Jay Blanchard'; 'Php-General-Help'; 'Ryan Schefke'
Subject: RE: [PHP] Strange music playing behavior

I just tried it between the  tags, that doesn't make a difference.  As
I mentioned, when I run it standalone it will work fine and it's a php file,
not html so the html tags aren't needed.

...this is painful!

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 12, 2004 2:30 PM
To: Ryan Schefke; Php-General-Help
Subject: RE: [PHP] Strange music playing behavior

[snip]
I know it's a lot of code but it's below.  Again, when I have the /*
MUSIC?
*/ section as a standalone file (making sure to open and close the
database
and include the correct require statements) it works fine; however, when
added to the code below (music section 4 paragraphs down) it doesn't
play
but all the  tags and echo statements are displaying correctly.

Any clues to keep me from banging my head against the wall?
[/snip]

Top posting rocks!

It looks like you're outputting your  tags before the html even
starts. Try placing the code somewhere mid-page...between the 
tags

-- 
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] Strange music playing behavior

2004-05-12 Thread John Nichel
Jay Blanchard wrote:
Top posting rocks!

You like to live dangerously.  ;)

--
John C. Nichel
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Strange music playing behavior

2004-05-12 Thread Ryan Schefke
I just tried it between the  tags, that doesn't make a difference.  As
I mentioned, when I run it standalone it will work fine and it's a php file,
not html so the html tags aren't needed.

...this is painful!

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 12, 2004 2:30 PM
To: Ryan Schefke; Php-General-Help
Subject: RE: [PHP] Strange music playing behavior

[snip]
I know it's a lot of code but it's below.  Again, when I have the /*
MUSIC?
*/ section as a standalone file (making sure to open and close the
database
and include the correct require statements) it works fine; however, when
added to the code below (music section 4 paragraphs down) it doesn't
play
but all the  tags and echo statements are displaying correctly.

Any clues to keep me from banging my head against the wall?
[/snip]

Top posting rocks!

It looks like you're outputting your  tags before the html even
starts. Try placing the code somewhere mid-page...between the 
tags

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



RE: [PHP] Strange music playing behavior

2004-05-12 Thread Jay Blanchard
[snip]
I know it's a lot of code but it's below.  Again, when I have the /*
MUSIC?
*/ section as a standalone file (making sure to open and close the
database
and include the correct require statements) it works fine; however, when
added to the code below (music section 4 paragraphs down) it doesn't
play
but all the  tags and echo statements are displaying correctly.

Any clues to keep me from banging my head against the wall?
[/snip]

Top posting rocks!

It looks like you're outputting your  tags before the html even
starts. Try placing the code somewhere mid-page...between the 
tags

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



RE: [PHP] Strange music playing behavior

2004-05-12 Thread Ryan Schefke
I know it's a lot of code but it's below.  Again, when I have the /* MUSIC?
*/ section as a standalone file (making sure to open and close the database
and include the correct require statements) it works fine; however, when
added to the code below (music section 4 paragraphs down) it doesn't play
but all the  tags and echo statements are displaying correctly.

Any clues to keep me from banging my head against the wall?

==

 

 
'; 
} else {
echo ' 

 
'; 
}
}
/* MUSIC? */



?>


'.$row[1].'\'s Wedding Website'.''; ?>






  

 

 
  


  
  

 
   
   

  
   
  
  

   

  
  

 
  
  
   

  


 
  
  
   

  


 
  
  
   


  
  

  
  
   


';

 ?> 

'.$row_preferences[0].'';
echo 'Sorted by first
name:';
 ?>
'.$row_lists[1].' '.$row_lists[2].'';
} else $list_person = null;

if (!empty($row_lists[0])) {
$list_position = ''.$row_lists[0].'';
} else $list_position = null;

if (!empty($row_lists[3])) {
$list_story = 'Story:'.$row_lists[3].'';
} else $list_story = null;

if (!empty($row_lists[3])) {
$storyYN = "".$row_lists[1] ."'s
Story:";
} else {
$storyYN = null;
}   

if (!empty($row_lists[4]) || !empty($row_lists[3]))
{
$theirphoto = '';
$list_photo = ''.$storyYN.''.$row_lists[3].''.$theirphoto.'<
/tr>';
} else $list_photo = null;

echo  ''.$list_person.$list_position.
' 
   
'
//  .$list_story.
.$list_photo.
'
  ';
} 
?>
  
   
  


  
  
  
  






-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 12, 2004 2:20 PM
To: Ryan Schefke; Php-General-Help
Subject: RE: [PHP] Strange music playing behavior

[snip]
I'm getting some strange behavior trying to play music. The script below
works fine standalone. However, when I put it into a larger script the
music
doesn't play but all of the echo statements work and when I view the
source
the  tags are fine, etc. What could the issue be? If you need me
to
send the larger file let me know.
[snip]

Since the code snippet you sent works I would have to say that something
about this code being plugged into other code is a problem. I believe
that is what it is. For sure.

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



Re: [PHP] Reshuffling an array

2004-05-12 Thread John W. Holmes
From: "Todd Cary" <[EMAIL PROTECTED]>

> I do the following:
>
>$eventList = array();
>$eventList[] = "Any";
>$dbh = db_open($host, $user, $password, $database);
>if($dbh) {
>  $sthdl = db_get_event_data($dbh);
>  while ($row = mysql_fetch_object($sthdl)) {
>$eventList[] = $row->EV_EVENT;
>  }
>} else {
>  $eventList[] = "* None found *";
>}
>asort( $eventList );
>
> Now I want to put "Any" as the first item.  What is the best way to do
> this?  Often the sort puts it as an item down the list.

Remove the line adding 'Any' at the beginning of your code and use
array_unshift() to add it at the end.

   $eventList = array();
   $dbh = db_open($host, $user, $password, $database);
   if($dbh) {
 $sthdl = db_get_event_data($dbh);
 while ($row = mysql_fetch_object($sthdl)) {
   $eventList[] = $row->EV_EVENT;
 }
   } else {
 $eventList[] = "* None found *";
   }
   asort( $eventList );
   array_unshift($eventList,'Any');

do you really need to maintain the numeric keys to the array by using
asort() instead of just sort()? If so, this may not work. You may be able to
use array_splice($input, 0, 0, array('Any')) or array_merge().

---John Holmes...

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



RE: [PHP] Strange music playing behavior

2004-05-12 Thread Jay Blanchard
[snip]
I'm getting some strange behavior trying to play music. The script below
works fine standalone. However, when I put it into a larger script the
music
doesn't play but all of the echo statements work and when I view the
source
the  tags are fine, etc. What could the issue be? If you need me
to
send the larger file let me know.
[snip]

Since the code snippet you sent works I would have to say that something
about this code being plugged into other code is a problem. I believe
that is what it is. For sure.

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



[PHP] Strange music playing behavior

2004-05-12 Thread Ryan Schefke
I'm getting some strange behavior trying to play music. The script below
works fine standalone. However, when I put it into a larger script the music
doesn't play but all of the echo statements work and when I view the source
the  tags are fine, etc. What could the issue be? If you need me to
send the larger file let me know.

 

 

 
'; 
} else {
echo ' 

 
'; 
}
}
/* MUSIC? */
mysql_close();
?> 



RE: [PHP] Re: Automatically send auth info

2004-05-12 Thread jon roig
I may be mistaken, but I think you can use CURL to grab that data. Check
out the options available here:

http://us3.php.net/manual/en/function.curl-setopt.php

In particular, you may want to look at CURLOPT_USERPWD


- jon roig

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.668 / Virus Database: 430 - Release Date: 4/24/2004
 

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



[PHP] Re: Reshuffling an array

2004-05-12 Thread Justin Patrin
Todd Cary wrote:

I do the following:

  $eventList = array();
  $eventList[] = "Any";
  $dbh = db_open($host, $user, $password, $database);
  if($dbh) {
$sthdl = db_get_event_data($dbh);
while ($row = mysql_fetch_object($sthdl)) {
  $eventList[] = $row->EV_EVENT;
}
  } else {
$eventList[] = "* None found *";
  }
  asort( $eventList );
Now I want to put "Any" as the first item.  What is the best way to do 
this?  Often the sort puts it as an item down the list.

Todd
Take out the $eventList[] = "Any"; at the top and at the bottom:

array_unshift($eventList, 'Any');

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


RE: [PHP] Re: Automatically send auth info

2004-05-12 Thread motorpsychkill
> Are you using a web form?  You can just grab the values from the form if
> that's the case.  But I suppose that you are not doing that, so you
> could just add some variables for username / password as part of the
> query string.  Just realize, you're now sending login info in plain text!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

No, it's not a web form.  I'm trying to include an IP addressed video camera
into my webpage.  The problem is that the video camera is password protected
using htaccess.  I don't have the option to remove the password.

I tried looking through the PEAR auth libraries but I didn't find anything
that *passed* authentication info, but only prompted for it, etc.

I thought there would be a class that would allow me to send the username
and password to a website and then include it, something like the following
pseudo-code:

website_address("http://127.0.0.1";);
$crap->website_username("joe");
$crap->website_password("shmoe");
$crap->retune_website();


?>

The camera used to be accessible with:

http://joe:[EMAIL PROTECTED]

But it is no longer available via Internet Explorer since the new MS
security updates on most windows boxes.

Thanks again.

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



[PHP] Reshuffling an array

2004-05-12 Thread Todd Cary
I do the following:

  $eventList = array();
  $eventList[] = "Any";
  $dbh = db_open($host, $user, $password, $database);
  if($dbh) {
$sthdl = db_get_event_data($dbh);
while ($row = mysql_fetch_object($sthdl)) {
  $eventList[] = $row->EV_EVENT;
}
  } else {
$eventList[] = "* None found *";
  }
  asort( $eventList );
Now I want to put "Any" as the first item.  What is the best way to do 
this?  Often the sort puts it as an item down the list.

Todd

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


Re: [PHP] Constant questions

2004-05-12 Thread Curt Zirzow
* Thus wrote Ren Fournier ([EMAIL PROTECTED]):
> Hi,
> 
> I have two questions involving Constants.
> 
> 1. I want to refer to a refer to a Constant by its value (which is 
> unique), and return its name. E.g.,:
> 
>   define ("SEND_DS","1");
>   define ("SEND_DS_ACK","2");
>   define ("RESEND_DS","3");
>   define ("STARTUP_DS","12");
> 
> For example, if I receive "3", I would like to echo "RESEND_DS"--the 
> name of the constant. Is there a simply way to do this? Or am I better 
> using an Associative Array (which is what I was thinking)? Then I could 
> such refer to an element by its key or value (both of which are 
> unique). I suppose this more of a performance/elegance issue, than 
> outright problem. Just curious what you think.

Constants are more for the programmer to use within the program to
avoid hard coding arbitrary numbers embeded deep inside code.

You can use a combination of both Constants and arrays to achive
your task:

define('SEND_DS', 1);
define('SEND_DS_ACK', 2);
...

$lookup = array(
  SEND_DS  => 'SEND_DS',
  SEND_DS_ACK  => 'SEND_DS_ACK',
);


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] Constant questions

2004-05-12 Thread Richard Davey
Hello René,

Wednesday, May 12, 2004, 6:29:13 PM, you wrote:

RF> Such that the output will be MY_NAME. If I echo $val, the output will
RF> be Rene. But I want to see the constants Name, not Value. Any ideas?

No easy way I can think of, but you could do:

$array = get_defined_constants();

and then search $array for your value, returning the key if found.

-- 
Best regards,
 Richard Davey
 http://www.launchcode.co.uk / PHP Development Services
 http://www.phpcommunity.org/wiki/296.html / PHP Community

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



[PHP] Re: Submit button as image

2004-05-12 Thread Justin Patrin
Sam wrote:

What do you do with this?
Submit.x=22&Submit.y=13
if($_GET['Submit.x'] > 0) ???

Is there some smarter way of dealing with an image as a submit button?

input name="Submit" type="image" value="doesNOTseemTOmatter"

Thanks
Well, it comes through as an image map in most browsers. I've found that 
you can't rely on the value of a submit button anyway as it is usually 
possible to just hit enter in a form to submit it, which, in most 
browsers, doesn't send the submit button. Use a hidden or ohter field to 
check for submission.

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


Re: [PHP] Submit button as image

2004-05-12 Thread Curt Zirzow
* Thus wrote Sam ([EMAIL PROTECTED]):
> 
> What do you do with this?
> Submit.x=22&Submit.y=13
> 
> if($_GET['Submit.x'] > 0) ???

$_GET['Submit_x']; 

php converts .x to _x to be compatible accross browser versions.

> 
> Is there some smarter way of dealing with an image as a submit button?
> 
> input name="Submit" type="image" value="doesNOTseemTOmatter"

mozilla/firefox is the only browser that I know of that will pass
the value.


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



RE: [PHP] Submit button as image

2004-05-12 Thread Chris W. Parker
Sam 
on Wednesday, May 12, 2004 10:10 AM said:

> What do you do with this?

nothing. i usually don't give my image buttons a name value so that
never shows up. what it's meant for is server side image maps. the
browser is telling the server where on the image the user clicked. then
you as the programmer decide where the user be taken depending on where
they clicked.

> Is there some smarter way of dealing with an image as a submit button?
> 
> input name="Submit" type="image" value="doesNOTseemTOmatter"

maybe the following will suffice?




hth,
chris.

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



[PHP] Constant questions

2004-05-12 Thread René Fournier
Hi,

I have two questions involving Constants.

1. I want to refer to a refer to a Constant by its value (which is 
unique), and return its name. E.g.,:

define ("SEND_DS","1");
define ("SEND_DS_ACK","2");
define ("RESEND_DS","3");
define ("STARTUP_DS","12");
For example, if I receive "3", I would like to echo "RESEND_DS"--the 
name of the constant. Is there a simply way to do this? Or am I better 
using an Associative Array (which is what I was thinking)? Then I could 
such refer to an element by its key or value (both of which are 
unique). I suppose this more of a performance/elegance issue, than 
outright problem. Just curious what you think.

2. Let's say I have a Constant called MY_NAME, the value of which is 
"Rene", and I pass it to a function, such as:

function example ($val) {
echo ???;
}
example (MY_NAME);

Such that the output will be MY_NAME. If I echo $val, the output will 
be Rene. But I want to see the constants Name, not Value. Any ideas?

Thanks.

...Rene

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


[PHP] Submit button as image

2004-05-12 Thread Sam

What do you do with this?
Submit.x=22&Submit.y=13

if($_GET['Submit.x'] > 0) ???

Is there some smarter way of dealing with an image as a submit button?

input name="Submit" type="image" value="doesNOTseemTOmatter"

Thanks

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



Re: [PHP] HTTP_RAW_POST_DATA

2004-05-12 Thread raditha dissanayake
Chris Boget wrote:

same configuration.  Where would I look to discover why one
server would have data held in $HTTP_RAW_POST_DATA
whereas the other server would not?
 

Check the value of "always_populate_raw_post_data" in php.ini 
on both servers.
   

That was it.  Thank you so very much!!

Chris

 

NOw I am very curious, the raw_post_data doesn't always get populated 
even with that setting. If i have not been barking up the wrong tree all 
these years that variable only gets populated if the content type is not 
url-encoded or multipart/form-data. If you are indeed using one of these 
types please be so kind as to share more info about your set up, this is 
something i would like to reproduce.

best regards
raditha
--
Raditha Dissanayake.
-
http://www.radinks.com/print/upload.php
SFTP, FTP and HTTP File Upload solutions 

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


Re: [PHP] search query analyzer

2004-05-12 Thread raditha dissanayake
Paul Godard wrote:

Hi

I am looking for some good ideas to combine some fields with query operators (multiple words, or/and, >/„/¾<, range of numerical values...).

Let's say I have 2 fields (numerical & text) to combine where the serach criteria can 
be as complicated as this :
- year : >1950, 1960-1965, not1980-2000, >2002
- subject : (boy and bicycle) or (man and tractor)
Is there a bullet proof function that can filter such field values and return a valid sql query?
 

I sure hope not, if such things existed in the API we would all be out 
of jobs :-)

before you get started, i suggest taking a look at full text indexing , 
you will find that a lot friendlier than ordinary look ups.

--
Raditha Dissanayake.
-
http://www.radinks.com/print/upload.php
SFTP, FTP and HTTP File Upload solutions 

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


Re: [PHP] Max file size for uploads?

2004-05-12 Thread Brian Dunning
Is there a true max size or do I just have something messed up 
somewhere
that I need to tweak??
I've got a client who needs their customers to upload large files for 
printing this way - and it stops at 30MB. There is some setting in 
Windows XP that we have not been able to change. It's been a lot of fun 
digging through Microsoft support docs but have had no luck. The IIS 
setting seems to override whatever you tell PHP to do.

- Brian

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


Re: [PHP] loading 250kb include files, performance degration?

2004-05-12 Thread raditha dissanayake
Merlin wrote:

Hi there,

I am working on a complex webapp written in php. Recently I was 
reading about performance issues and after analysing the code I found 
that most of the files load 5 external php include files to run. All 
together those include files make about 250KB (there are 5 files).

how about trying out turck MMCache?

--
Raditha Dissanayake.
-
http://www.radinks.com/print/upload.php
SFTP, FTP and HTTP File Upload solutions 

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


Re: [PHP] PHP Sessions on Windows

2004-05-12 Thread John W. Holmes
David Mitchell wrote:

I first attempted to edit the php.ini so that the session save path was
C:\Temp. No matter what I did, the save path always showed up in phpinfo()
as /tmp. So I created folder on the root of C: called tmp and everything
worked.
You were not editing the correct php.ini, then.

--
---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] Max file size for uploads?

2004-05-12 Thread raditha dissanayake
Robert Sossomon wrote:

I have an upload script that I am trying to allow for 725MB, I have
written the script to handle files of that size, and I modified the
upload_max_filesize = 730M
I tried uploading a 15MB file and it blew up (current error message is
not in my brain).
Is there a true max size or do I just have something messed up somewhere
that I need to tweak??
 

There are quite a few some have already been mentioned, in other posts 
but I invite you to look at http://www.radinks.com/upload/config.php 
that will give you a good idea about all the settings involved.

Having said that you probably ought to switch to FTP or SFTP if you want 
to transfer so much data. Web servers are always optimized to deliver 
thousands of files at once instead of accepting large incoming files.

Thanks,
Robert
 



--
Raditha Dissanayake.
-
http://www.radinks.com/print/upload.php
SFTP, FTP and HTTP File Upload solutions 

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


[PHP] changing http to https

2004-05-12 Thread David T-G
Hi, all --

We have lovely variables like $_SERVER['SCRIPT_URI'] so that we don't
have to hard-code the site or script name into our files, and that's
great; it even includes the SID for me if cookies are off.  I'd like to
be able to point someone to https://sitename/script.php to log in
securely, but I see no way of changing the request method or port number
or such.  So far all I've dreamed up is to either manually build

  https://{$_SERVER['HTTP_HOST']}{$_SERVER['SCRIPT_NAME']}

or perhaps

  str_replace('http','https',$_SERVER['SCRIPT_URI'])

which both seem kinda kludgey.

Any better ideas?


TIA & HAND

:-D
-- 
David T-G
[EMAIL PROTECTED]
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


[PHP] function "gethostbyname" - how can i deactivate cache / force look-up???

2004-05-12 Thread Tobes
Hi there -
in a script I use the function "gethostbyname" to resolve a hostname
(www.example.com) into an IP-address.
Unfortunately, the host name that I try to resolve changes its IP address
frequently.
Since the function "gethostbyname" caches its results, it sooner or later
returns a wrong IP-address.

How can I deactivate cache for this function (or force the look-up) or what
other function could I use to get the IP-address?

Thanks a lot for your help in advance!!!

Tobes =)

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



Re: [PHP] Memory usage

2004-05-12 Thread Curt Zirzow
* Thus wrote Oliver Hankeln ([EMAIL PROTECTED]):
> Hi!
> 
> I get memory exceded errors and want to find out why. So I am looking 
> for a way to determine how much memory is currently beeing used by my 
> script. Is this possible?
> getPID + reading from /proc dosent work because php is an apache module. 
> (I can´t change this)

Its possible:
  http://us2.php.net/memory_get_usage

You'll most likely need to recompile php with:
  --enable-memory-limit


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



[PHP] Re: include from another URL

2004-05-12 Thread AcZ
Nik wrote:
Hi there,
I'm new to these groups so forgive me if I'm asking at the wrong place (tell me where 
then :)
Ok,
I'm not PHP guru but I need to create a simple script that would do this:
Include a content from another URL into the current output. I have done something like
this:
-- code start
http://myotherurl.com:8080';
?>
-- code end
and it seems to work with one exception: it produces a warning message saying 
something like
 "Warning: main(): stream does not support seeking in .../web-root/index.php on line 9"
where line #9 is: include 'http://myotherurl.com:8080'; from above code.
It then shows a message from 'http://myotherurl.com:8080'
Thanks!!!
Nik
Nik,

try fopen instead of include..

http://br.php.net/manual/en/function.fopen.php
look at comments...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] default and another constructor

2004-05-12 Thread Ford, Mike [LSS]
> -Original Message-
> From: Rudy Metzger [mailto:[EMAIL PROTECTED] 
> Sent: 12 May 2004 14:27
> 
> On Wed, 2004-05-12 at 15:18, Mark Constable wrote:
> > 
> >  function forum($naam=NULL,$tijd=NULL,$tekst=NULL)
> > 
> > and test the incoming variables with isset() before 
> > attempting to use 
> > any of them.
> If you assign default values to the method arguments, you 
> cannot test them with isset() anymore, as they will be set.

Not if the default is NULL -- isset(NULL) is false.

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] Linux command in PHP

2004-05-12 Thread Curt Zirzow
* Thus wrote Mike Mapsnac ([EMAIL PROTECTED]):
> I have script  that basically process a file. If  something found in the 
> file, the script send email.
> 
> Today I tried to add another  option, that gives sound and send email.
> The script works ok when I run from  shell. But when I add the code to 
> cronjob, the email is send but NO SOUND. Any ideas what can cause such 
> problem?
> 
> # Below the code that start the xmms sound
> $alert = "/usr/bin/xmms /home/mike/Desktop/song1.mp3";
>
> `$alert';

This is an X problem, not php. xmms has no clue what :display to 
run xmms on.


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] Send username & password in HTTP headers

2004-05-12 Thread Nagendra Prasad
Hi,
That worked,
Thanks a lot..

Regards
TNP
Professional Services
ZUSTEK INDIA
__


-- Original Message ---
From: Chris Shiflett <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Sent: Wed, 12 May 2004 08:55:55 -0700 (PDT)
Subject: Re: [PHP] Send username & password in HTTP headers

> --- Nagendra Prasad <[EMAIL PROTECTED]> wrote:
> > I'm posting some XML data to my client's website using HTTP Post.
> > Assume I'm posting to getxml.php (hosted on my clients server).
> > Now my client has put authentication on his website using 
> > header('WWW-Authenticate: Basic realm="Private Area"');
> > 
> > Now the page getxml.php asks me to prove my identity before it
> > acceps my xml posts. So how do I send the username & pwd when I'm
> > posting the xml details?
> 
> Include an Authorization header, which should look something like this:
> 
> Authorization: Basic bXluYW1lOm15cGFzcw==
> 
> The encoded string is just the result of this:
> 
> base64_encode('myname:mypass')
> 
> Substitute with the correct username and password.
> 
> Hope that helps.
> 
> Chris
> 
> =
> Chris Shiflett - http://shiflett.org/
> 
> PHP Security - O'Reilly
>  Coming Fall 2004
> HTTP Developer's Handbook - Sams
>  http://httphandbook.org/
> PHP Community Site
>  http://phpcommunity.org/
--- End of Original Message ---

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



RE: [PHP] PHP Sessions on Windows

2004-05-12 Thread Daniel Clark
I think you need to restart PHP to pickup the new php.ini changes.

My php.ini is in the windows directory (I believe).

>> -Original Message-
>> From: David Mitchell [mailto:[EMAIL PROTECTED]
>> Sent: 12 May 2004 13:21
>>
>> OK, I managed to get it working.
>>
>> I first attempted to edit the php.ini so that the session
>> save path was C:\Temp. No matter what I did, the save path
>> always showed up in phpinfo() as /tmp. So I created folder on
>> the root of C: called tmp and everything worked.
>
> This still looks like PHP is not looking for the php.ini file where you
> think it is.  I strongly suggest you follow the previous advice to work
> out
> where PHP is actually expecting your php.ini to be, before you have a need
> to change another initialization parameter.
>
> Cheers!
>
> Mike

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



[PHP] Re: Automatically send auth info

2004-05-12 Thread Jason Barnett
Motorpsychkill wrote:

Hi all,

Some of my webpages are no longer working with the IE browser after MS
implemented some security patches which disable sending authentication info
through the URL:
http://user:[EMAIL PROTECTED]

This no longer works with IE, but is fine with most other browsers.  Does
anybody know of a workaround using PHP to send the user & pass "in the
background", i.e. without user interaction?
Thanks for your help!

-m
Are you using a web form?  You can just grab the values from the form if 
that's the case.  But I suppose that you are not doing that, so you 
could just add some variables for username / password as part of the 
query string.  Just realize, you're now sending login info in plain text!

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


RE: [PHP] Linux command in PHP

2004-05-12 Thread Jay Blanchard
[snip]
Today I tried to add another  option, that gives sound and send email.
The script works ok when I run from  shell. But when I add the code to 
cronjob, the email is send but NO SOUND. Any ideas what can cause such 
problem?

# Below the code that start the xmms sound
$alert = "/usr/bin/xmms /home/mike/Desktop/song1.mp3";
`$alert';
[/snip]

The problem is caused by bad code. See http://www.php.net/exec

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



[PHP] Memory usage

2004-05-12 Thread Oliver Hankeln
Hi!

I get memory exceded errors and want to find out why. So I am looking 
for a way to determine how much memory is currently beeing used by my 
script. Is this possible?
getPID + reading from /proc dosent work because php is an apache module. 
(I can´t change this)

Thanks!

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


[PHP] Linux command in PHP

2004-05-12 Thread Mike Mapsnac
I have script  that basically process a file. If  something found in the 
file, the script send email.

Today I tried to add another  option, that gives sound and send email.
The script works ok when I run from  shell. But when I add the code to 
cronjob, the email is send but NO SOUND. Any ideas what can cause such 
problem?

# Below the code that start the xmms sound
$alert = "/usr/bin/xmms /home/mike/Desktop/song1.mp3";
`$alert';
_
Is your PC infected? Get a FREE online computer virus scan from McAfee® 
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

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


Re: [PHP] Send username & password in HTTP headers

2004-05-12 Thread Chris Shiflett
--- Nagendra Prasad <[EMAIL PROTECTED]> wrote:
> I'm posting some XML data to my client's website using HTTP Post.
> Assume I'm posting to getxml.php (hosted on my clients server).
> Now my client has put authentication on his website using 
> header('WWW-Authenticate: Basic realm="Private Area"');
> 
> Now the page getxml.php asks me to prove my identity before it
> acceps my xml posts. So how do I send the username & pwd when I'm
> posting the xml details?

Include an Authorization header, which should look something like this:

Authorization: Basic bXluYW1lOm15cGFzcw==

The encoded string is just the result of this:

base64_encode('myname:mypass')

Substitute with the correct username and password.

Hope that helps.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming Fall 2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



[PHP] FIXED: Max file size for uploads?

2004-05-12 Thread Robert Sossomon
It's fixed now..

If using Apache on RedHat here is everything to fix at once:

FIRST AND FOREMOST DECIDE THE MAX SIZE YOU WANT IN MB, ADD A COUPLE MORE
TO IT, AND THEN CONVERT TO BYTES (MB * 1024 * 1024)

1.  httpd/conf.d/php.conf 
LimitRequestBody  ?? #byte size you calculated

2.  /etc/php.ini
max_file_size = ???M #Max size in MB
post_max_size = ???M #Max size in MB

/etc/init.d/httpd restart

Then upload!  

HTH!!

Robert

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



RE: [PHP] PHP Sessions on Windows

2004-05-12 Thread Ford, Mike [LSS]
> -Original Message-
> From: David Mitchell [mailto:[EMAIL PROTECTED] 
> Sent: 12 May 2004 13:21
> 
> OK, I managed to get it working. 
> 
> I first attempted to edit the php.ini so that the session 
> save path was C:\Temp. No matter what I did, the save path 
> always showed up in phpinfo() as /tmp. So I created folder on 
> the root of C: called tmp and everything worked.

This still looks like PHP is not looking for the php.ini file where you
think it is.  I strongly suggest you follow the previous advice to work out
where PHP is actually expecting your php.ini to be, before you have a need
to change another initialization parameter.

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] PHP5 and static attributes

2004-05-12 Thread Curt Zirzow
* Thus wrote Rudy Metzger ([EMAIL PROTECTED]):
> Dear all,
> 
> I have a problem with 'referencing' static attributes. I have the
> following class tree.
> 
> // --- CLASS A -
> class A
> {
>   protected static $myInstance;
> }
> 
> // --- CLASS B --
> class B extends class A
> {
> }
> 
> // --- CLASS C --
> class C extends class B
> {
> 
> public function Debug()
> {
>   echo self::$myInstance; // does not work (undefined)
>   echo parent::$myInstance;  // also does not work
>   echo A::$myInstance; // works
> }
> 
> }
> 
> -
> The Problem is that you always have to know in which class the static
> was defined to reference it. Or is there something like
> static::$myInstance or this::$myInstance or class::$myInstance. If not,
> it maybe would be a great idea to add something to PHP, otherwise you
> always have to track in which class the static had been defined if you
> want to reference it!

What version of php are you using? It appears to work with RC1 to
CVS version. The actual result I get is:

public function Debug() {

  echo self::$myInstance;   // works
  echo parent::$myInstance; // error: Cannot access protected property
  echo A::$myInstance;  // error: Cannot access protected property
}

Its expected for the errors on the last two since you're accessing
the protected variable from outsite the public scope of Debug().


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] Max file size for uploads?

2004-05-12 Thread Mark Pecaut
On Wed, May 12, 2004 at 10:07:09AM -0400, Robert Sossomon wrote:
> I get this error message now in my httpd error log:
> 
> [Wed May 12 10:07:01 2004] [error] [client 66.43.177.38] Requested
> content-length of 69888498 is larger than the configured limit of
> 524288, referer: http://dinghy.homeip.net/upload.php
> 
> Any thoughts?

If you are using apache, this might help:

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

-Mark

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



Re: [PHP] default and another constructor

2004-05-12 Thread Michal Migurski
> No, you cannot do this kind of method overloading, not like this anyway.
> If you are using PHP5 you can kind of emulate overloading by using the
> __call() function... some googling will find examples.
>
> You can at least make the below work by removing the first forum()
> instance and using
>
>  function forum($naam=NULL,$tijd=NULL,$tekst=NULL)

Another option, if you wish to have varying argument lists, is to define
the methods with no arguments at all, and use the func_get_args(),
func_num_args(), and func_get_arg() functions described here:

http://php.net/manual/en/ref.funchand.php

-
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] Max file size for uploads?

2004-05-12 Thread Robert Sossomon
I get this error message now in my httpd error log:

[Wed May 12 10:07:01 2004] [error] [client 66.43.177.38] Requested
content-length of 69888498 is larger than the configured limit of
524288, referer: http://dinghy.homeip.net/upload.php

Any thoughts?

TIA!

Robert

-Original Message-
From: Richard Davey [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 12, 2004 9:43 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Max file size for uploads?


Hello Robert,

Wednesday, May 12, 2004, 2:37:23 PM, you wrote:

RS> I have an upload script that I am trying to allow for 725MB, I have 
RS> written the script to handle files of that size, and I modified the 
RS> upload_max_filesize = 730M

RS> I tried uploading a 15MB file and it blew up (current error message 
RS> is not in my brain).

RS> Is there a true max size or do I just have something messed up 
RS> somewhere that I need to tweak??

POST file size is the other one.

and that's HELL of a file size.. what is it, an ISO dump site? ;)

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

-- 
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] default and another constructor

2004-05-12 Thread Mark Constable
On Wed, 12 May 2004 11:27 pm, Rudy Metzger wrote:
> On Wed, 2004-05-12 at 15:18, Mark Constable wrote:
> > You can at least make the below work by removing the first
> > forum() instance and using
> >
> >  function forum($naam=NULL,$tijd=NULL,$tekst=NULL)
> >
> > and test the incoming variables with isset() before attempting
> > to use any of them.
>
> If you assign default values to the method arguments, you cannot test
> them with isset() anymore, as they will be set.

# cat null_test.php

# php null_test.php
'hi'
NULL
NULL

--markc

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



Re: [PHP] HTTP_RAW_POST_DATA

2004-05-12 Thread Michal Migurski
> > > Check the value of "always_populate_raw_post_data" in php.ini on
> > both servers.
> >
> > Thats such a funny name.
>
> Not to mention misleading, since it doesn't always populate
> $HTTP_RAW_POST_DATA when enabled. Always should mean always.

Anyone have any clue why this is the case? Is there a performance reason
that raw post data must be explicitly enabled, or is it more of a
protective measure for overly permissive beginner scripts?

Inquiring minds demand answers!

-
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] Sessions not working on Linux - Apache - FOllow Up

2004-05-12 Thread Zac
Have looked at this more and can now tell you that this is definatley 
down to the server not writing any contents into the sess_nnn file.

Does anyone have any ideas why this would happen? I've checked all 
permissions and tried changing the save_path to another folder that I 
created specifically for the sessions with global write permissions this 
had no effect.

Made sure the $_SESSION[name] had '  - $_SESSION['name'] made no 
difference. (Thanks though)

Any help really appreciated.

Zac


Running on apache 1.3

session.save_handler = files
session.save_path = /tmp
session.use_cookies = 1
session.name = i
session.auto_start = 0
session.cookie_lifetime = 0
session_start() is included in the top of each page.

When I test session files are being written into the /tmp folder and the 
session variable is corerctly added to the url when moving to another 
page, BUT the sessions do not appear to be working?

I can set a session var on one page and display it there but when moving 
to another page the session var is no longer available?

If I look in the tmp folder a relevant sess_nnn file is there but 
contains no data. I've checked permissions and the /tmp folder is world 
writable and the sess_nnn file is owned by the web server and is writable?

Can anyone suggest what to test next or where the problem may be?

Thanks

Zac

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


Re: [PHP] Max file size for uploads?

2004-05-12 Thread Richard Davey
Hello Robert,

Wednesday, May 12, 2004, 2:37:23 PM, you wrote:

RS> I have an upload script that I am trying to allow for 725MB, I have
RS> written the script to handle files of that size, and I modified the
RS> upload_max_filesize = 730M

RS> I tried uploading a 15MB file and it blew up (current error message is
RS> not in my brain).

RS> Is there a true max size or do I just have something messed up somewhere
RS> that I need to tweak??

POST file size is the other one.

and that's HELL of a file size.. what is it, an ISO dump site? ;)

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



Re: [PHP] default and another constructor

2004-05-12 Thread Lieve Vissenaeken
Thanks Mark for helping me out...
The way you describe it with "function
forum($naam=NULL,$tijd=NULL,$tekst=NULL)" is a good trick !!

Kind Regards.

"Mark Constable" <[EMAIL PROTECTED]> schreef in bericht
news:[EMAIL PROTECTED]
> On Wed, 12 May 2004 10:43 pm, Lieve Vissenaeken wrote:
> > Please ,could anybody help me ? I'm not so familiar with PHP.
> >
> > I've the following problem with my code  when I try to make an object
from
> > the class "forum" with the code "$test=new forum()".  I always get a
> > warning on this: "Warning: Missing argument 1 for forum() in
> > /lvdata/www/tennis/php/sql.inc"
> > Is it not possible to just make a default constructor and an other
> > constructor like in JAVA ?
> > Thanks for helping
>
> No, you cannot do this kind of method overloading, not like
> this anyway. If you are using PHP5 you can kind of emulate
> overloading by using the __call() function... some googling
> will find examples.
>
> You can at least make the below work by removing the first
> forum() instance and using
>
>  function forum($naam=NULL,$tijd=NULL,$tekst=NULL)
>
> and test the incoming variables with isset() before attempting
> to use any of them.
>
> > class forum
> > {
> >  var $naam;
> >  var $tijd;
> >  var $tekst;
> >
> >  function forum()
> >  {
> >  }
> >
> >  function forum($naam,$tijd,$tekst)
> >  {
> >   $this->naam=$naam;
> >   $this->tijd=$tijd;
> >   $this->tekst=$tekst;
> > }
> > }
> >
> >
> > $test=new forum();
>
> --markc

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



[PHP] Max file size for uploads?

2004-05-12 Thread Robert Sossomon
I have an upload script that I am trying to allow for 725MB, I have
written the script to handle files of that size, and I modified the
upload_max_filesize = 730M

I tried uploading a 15MB file and it blew up (current error message is
not in my brain).

Is there a true max size or do I just have something messed up somewhere
that I need to tweak??

Thanks,
Robert

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



Re: [PHP] Sessions not working on Linux - Apache

2004-05-12 Thread John Nichel
Zac wrote:
Thanks for your response:

PHP Version 4.2.2

$_SESSION[test] = 'testData';

Regards

Zac
Please respond to the list, and not to an individual user (unless asked 
of course).

Try adding quotes around your key...

$_SESSION['test'] = "testData";

--
John C. Nichel
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Sessions not working on Linux - Apache

2004-05-12 Thread Zac
>> What version of PHP?  How are you 'setting' session variables?

Version 4.2.2

$_SESSION[test] = 'testData';

Cheers

Zac

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


Re: [PHP] default and another constructor

2004-05-12 Thread Rudy Metzger
On Wed, 2004-05-12 at 15:18, Mark Constable wrote:
> On Wed, 12 May 2004 10:43 pm, Lieve Vissenaeken wrote:
> > Please ,could anybody help me ? I'm not so familiar with PHP.
> >
> > I've the following problem with my code  when I try to make an object from
> > the class "forum" with the code "$test=new forum()".  I always get a
> > warning on this: "Warning: Missing argument 1 for forum() in
> > /lvdata/www/tennis/php/sql.inc"
> > Is it not possible to just make a default constructor and an other
> > constructor like in JAVA ?
> > Thanks for helping
> 
> No, you cannot do this kind of method overloading, not like 
> this anyway. If you are using PHP5 you can kind of emulate 
> overloading by using the __call() function... some googling 
> will find examples.
> 
> You can at least make the below work by removing the first
> forum() instance and using
> 
>  function forum($naam=NULL,$tijd=NULL,$tekst=NULL)
> 
> and test the incoming variables with isset() before attempting
> to use any of them.
If you assign default values to the method arguments, you cannot test
them with isset() anymore, as they will be set.
> 
> > class forum
> > {
> >  var $naam;
> >  var $tijd;
> >  var $tekst;
> >
> >  function forum()
> >  {
> >  }
> >
> >  function forum($naam,$tijd,$tekst)
> >  {
> >   $this->naam=$naam;
> >   $this->tijd=$tijd;
> >   $this->tekst=$tekst;
> > }
> > }
> >
> >
> > $test=new forum();
> 
> --markc


signature.asc
Description: This is a digitally signed message part


Re: [PHP] default and another constructor

2004-05-12 Thread Rudy Metzger
Strange that you get this error. Normally you should get a "Fatal error:
Cannot redeclare forum::forum() "

PHP does not support 'function overloading', at least not in a way java
is doing it. One of the drawbacks of a free typed langauge (in contrary
to a strictly typed one).

cheerio
/rudy

On Wed, 2004-05-12 at 14:43, Lieve Vissenaeken wrote:
> Please ,could anybody help me ? I'm not so familiar with PHP.
> 
> I've the following problem with my code  when I try to make an object from
> the class "forum" with the code "$test=new forum()".  I always get a warning
> on this: "Warning: Missing argument 1 for forum() in
> /lvdata/www/tennis/php/sql.inc"
> Is it not possible to just make a default constructor and an other
> constructor like in JAVA ?
> Thanks for helping
> 
> 
> class forum
> {
>  var $naam;
>  var $tijd;
>  var $tekst;
> 
>  function forum()
>  {
>  }
> 
> 
>  function forum($naam,$tijd,$tekst)
>  {
>   $this->naam=$naam;
>   $this->tijd=$tijd;
>   $this->tekst=$tekst;
> }
> }
> 
> 
> $test=new forum();


signature.asc
Description: This is a digitally signed message part


Re: [PHP] default and another constructor

2004-05-12 Thread Mark Constable
On Wed, 12 May 2004 10:43 pm, Lieve Vissenaeken wrote:
> Please ,could anybody help me ? I'm not so familiar with PHP.
>
> I've the following problem with my code  when I try to make an object from
> the class "forum" with the code "$test=new forum()".  I always get a
> warning on this: "Warning: Missing argument 1 for forum() in
> /lvdata/www/tennis/php/sql.inc"
> Is it not possible to just make a default constructor and an other
> constructor like in JAVA ?
> Thanks for helping

No, you cannot do this kind of method overloading, not like 
this anyway. If you are using PHP5 you can kind of emulate 
overloading by using the __call() function... some googling 
will find examples.

You can at least make the below work by removing the first
forum() instance and using

 function forum($naam=NULL,$tijd=NULL,$tekst=NULL)

and test the incoming variables with isset() before attempting
to use any of them.

> class forum
> {
>  var $naam;
>  var $tijd;
>  var $tekst;
>
>  function forum()
>  {
>  }
>
>  function forum($naam,$tijd,$tekst)
>  {
>   $this->naam=$naam;
>   $this->tijd=$tijd;
>   $this->tekst=$tekst;
> }
> }
>
>
> $test=new forum();

--markc

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



Re: [PHP] Sessions not working on Linux - Apache

2004-05-12 Thread John Nichel
Zac Hillier - Net Affectors wrote:
Running on apache 1.3

session.save_handler = files
session.save_path = /tmp
session.use_cookies = 1
session.name = i
session.auto_start = 0
session.cookie_lifetime = 0
session_start() is included in the top of each page.

When I test session files are being written into the /tmp folder and the 
session variable is corerctly added to the url when moving to another 
page, BUT the sessions do not appear to be working?

I can set a session var on one page and display it there but when moving 
to another page the session var is no longer available?

If I look in the tmp folder a relevant sess_nnn file is there but 
contains no data. I've checked permissions and the /tmp folder is world 
writable and the sess_nnn file is owned by the web server and is writable?

Can anyone suggest what to test next or where the problem may be?

Thanks

Zac
What version of PHP?  How are you 'setting' session variables?

--
John C. Nichel
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] default and another constructor

2004-05-12 Thread Lieve Vissenaeken
Please ,could anybody help me ? I'm not so familiar with PHP.

I've the following problem with my code  when I try to make an object from
the class "forum" with the code "$test=new forum()".  I always get a warning
on this: "Warning: Missing argument 1 for forum() in
/lvdata/www/tennis/php/sql.inc"
Is it not possible to just make a default constructor and an other
constructor like in JAVA ?
Thanks for helping


class forum
{
 var $naam;
 var $tijd;
 var $tekst;

 function forum()
 {
 }


 function forum($naam,$tijd,$tekst)
 {
  $this->naam=$naam;
  $this->tijd=$tijd;
  $this->tekst=$tekst;
}
}


$test=new forum();

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



RE: [PHP] PHP Sessions on Windows

2004-05-12 Thread David Mitchell
OK, I managed to get it working. 

I first attempted to edit the php.ini so that the session save path was
C:\Temp. No matter what I did, the save path always showed up in phpinfo()
as /tmp. So I created folder on the root of C: called tmp and everything
worked.

Thanks,

Dave

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



Re: [PHP] parsing value by URL-worked

2004-05-12 Thread Richard Davey
Hello,

Wednesday, May 12, 2004, 12:53:44 PM, you wrote:

gr> thanks a lot dear Zac and richard
gr> that worked. I earlier tried $_POST[name] but not $_GET[name].
gr> thanks again

No worries. One point though - make sure you use $_GET['name'] and
*not* $_GET[name] (note the lack of quotes) - there is a big
difference between the two, the un-quoted version will cause PHP to
check its defined constants first, so you're adding un-needed overhead
and potential error warnings just by missing out those two little
characters :)

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



[PHP] Re: PHP5 and static attributes

2004-05-12 Thread Aidan Lister
Do you have to access that variable statically?

If you're scope is the class:
echo $this->myInstance;

Otherwise,
echo C::$myInstance will access it outside the class (I think), even though
it's inherited.



"Rudy Metzger" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Dear all,
>
> I have a problem with 'referencing' static attributes. I have the
> following class tree.
>
> // --- CLASS A -
> class A
> {
>   protected static $myInstance;
> }
>
> // --- CLASS B --
> class B extends class A
> {
> }
>
> // --- CLASS C --
> class C extends class B
> {
>
> public function Debug()
> {
>   echo self::$myInstance; // does not work (undefined)
>   echo parent::$myInstance;  // also does not work
>   echo A::$myInstance; // works
> }
>
> }
>
> -
> The Problem is that you always have to know in which class the static
> was defined to reference it. Or is there something like
> static::$myInstance or this::$myInstance or class::$myInstance. If not,
> it maybe would be a great idea to add something to PHP, otherwise you
> always have to track in which class the static had been defined if you
> want to reference it!
>
> Thanx for reading and if someone knows how to solve this, please let me
> know!
>
> Cheerio
> /rudy

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



Re: [PHP] parsing value by URL

2004-05-12 Thread Mark Constable
On Wed, 12 May 2004 09:42 pm, gowthaman ramasamy wrote:
> I have a problem in passing the value to another PHP script from the
> first one. can any one help me to debug it.
>
>  ENCTYPE="text/plain">
>  if(isset($_POST['submit']))
> {
>   does many things
>
> $detail_file='testrun_hetero_srtdout';
> echo " HREF=\"http:/gowtham/forphp/detailedresults.php?name=$detail_file&firstfile
>=$files\"> clik to see detailed page" }

> second script ... that is detailedresults.php
>print $name;
>   print "$name";
> ?>

Perhaps "register_globals = Off" ? Here is one debugging hint...

 ';
 // do whatever else
 ?>

and view the source of the resulting page. Assumes PHP v4.1.0+

--markc

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



Re: [PHP] Resequencing logic

2004-05-12 Thread Burhan Khalid
Matt Grimm wrote:

I apologize if this message is a repeat; I've had trouble posting with 
Thunderbird.

I'm interested in how you folks would approach the following issue:

You have a list of data, in a user-defined sequence.  For instance, a list 
of song titles that can be rearranged on a web page in any order. I don't 
think I have the best grasp of the logic involved, and as such, the problem 
is a real pain for me.  I use this approach:
I think you are after http://www.brainjar.com/dhtml/tablesort/demo.html

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


  1   2   >