Re: [PHP] PHP script won't run in the background

2011-11-30 Thread Alain Williams
On Wed, Nov 30, 2011 at 01:01:48PM +0100, richard gray wrote:

> >You need a bit more info, get a backtrace with 'where'.
> Thanks for the response Alain - below is the output:-

Ah, much more useful .

> [rich@LeMans] (/Web/scripts)> gdb --pid=3294
> GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Mon Aug  8 20:32:45 
> UTC 2011)
> Copyright 2004 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain 
> conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for details.
> This GDB was configured as "x86_64-apple-darwin".
> /Web/scripts/3294: No such file or directory
> Attaching to process 3294.
> Reading symbols for shared libraries . done
> Reading symbols for shared libraries 
> 
>  
> done
> Reading symbols for shared libraries + done
> 0x7fff8f8ac7ee in __ioctl ()
> (gdb) where
> #0  0x7fff8f8ac7ee in __ioctl ()
> #1  0x7fff8f8ac1fe in ioctl ()
> #2  0x7fff910a6b1c in tcsetattr ()

OK - it is setting tty modes as I suspected.

> #3  0x00010ab05df7 in tty_end ()
> #4  0x00010ab05c39 in tty_init ()
> #5  0x00010aaf7261 in el_init ()
> #6  0x00010aafeb8e in rl_initialize ()
> #7  0x00010a3ef39a in zm_startup_readline ()

This is the readline routine ... probably setting the tty to raw mode, thus the 
tcsetattr() above.

Look at the link below, it is how your CLI version of PHP is compiled:

http://www.php.net/manual/en/readline.installation.php

readline is mentioned as part of CLI:

http://www.php.net/manual/en/features.commandline.usage.php

> #8  0x00010a37a1c8 in zend_startup_module_ex ()
> #9  0x00010a38166b in zend_hash_apply ()
> #10 0x00010a37d3dd in zend_startup_modules ()
> #11 0x00010a3287bf in php_module_startup ()
> #12 0x00010a3ef637 in php_cli_startup ()

This is done BEFORE your script starts - so nothing that you can do to stop it.

> #13 0x00010a3efff8 in main ()

Try the daemonize that I wrote about a few minutes ago.

-- 
Alain Williams
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT 
Lecturer.
+44 (0) 787 668 0256  http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: 
http://www.phcomp.co.uk/contact.php
#include 

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



Re: [PHP] PHP script won't run in the background

2011-11-30 Thread Alain Williams
On Wed, Nov 30, 2011 at 12:58:26PM +0100, richard gray wrote:
> On 29/11/2011 17:16, Daniel Brown wrote:
> >On Sat, Nov 19, 2011 at 09:33, richard gray  wrote:
> >This happens because PHP is writing to STDOUT, of course, and then the 
> >command line redirection grabs that information and puts it into the 
> >file. Unfortunately, by itself, this won't work in the background, 
> >which is why you're getting the SIGTTOU (SIGnal TTy OUput). If you 
> >need to redirect the output and have it run in the background (where 
> >something like file_put_contents() or fwrite() isn't a practical 
> >option), give it a NOHUP (NO Hang-UP): nohup php test.php > test.log & 
> >This will automatically redirect STDERR to STDOUT, save for the 
> >message telling you the same. 
> 
> Thanks for your reply Daniel unfortunately nohup makes no difference the 
> script still stops with no output being logged -- and also on a 
> different machine (Ubuntu) php -f test.php >test.log 2>&1 & -- works 
> perfectly - seems to be an issue with OSX Lion and the version of PHP 
> that came with the machine -- I cannot compile my own build of PHP 
> because of this problem -> https://bugs.php.net/bug.php?id=60268 -- so I 
> am completely stuck :(

The point is that you need to completely disassociate the process from the tty.
Install the daemonize program, then use it to run your PHP script. See:

http://software.clapper.org/daemonize/

It claims to run under OSx (which is just BSD Unix).

-- 
Alain Williams
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT 
Lecturer.
+44 (0) 787 668 0256  http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: 
http://www.phcomp.co.uk/contact.php
#include 

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



Re: [PHP] PHP script won't run in the background

2011-11-30 Thread richard gray

On 23/11/2011 18:49, Alain Williams wrote:

On Wed, Nov 23, 2011 at 06:14:07PM +0100, richard gray wrote:


Reading symbols for shared libraries + done
0x000101d057ee in __ioctl ()

Any clues? To me it looks like PHP cli is trying to do some I/O but I'm
just a dumb developer... :)

ioctl on a tty is typically used to set it into single character at a time mode 
(remove stty's icanon).
It could have decided that since it is a tty then that should be set.

You need a bit more info, get a backtrace with 'where'.

Thanks for the response Alain - below is the output:-

[rich@LeMans] (/Web/scripts)> gdb --pid=3294
GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Mon Aug  8 20:32:45 
UTC 2011)

Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain 
conditions.

Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".
/Web/scripts/3294: No such file or directory
Attaching to process 3294.
Reading symbols for shared libraries . done
Reading symbols for shared libraries 
 
done

Reading symbols for shared libraries + done
0x7fff8f8ac7ee in __ioctl ()
(gdb) where
#0  0x7fff8f8ac7ee in __ioctl ()
#1  0x7fff8f8ac1fe in ioctl ()
#2  0x7fff910a6b1c in tcsetattr ()
#3  0x00010ab05df7 in tty_end ()
#4  0x00010ab05c39 in tty_init ()
#5  0x00010aaf7261 in el_init ()
#6  0x00010aafeb8e in rl_initialize ()
#7  0x00010a3ef39a in zm_startup_readline ()
#8  0x00010a37a1c8 in zend_startup_module_ex ()
#9  0x00010a38166b in zend_hash_apply ()
#10 0x00010a37d3dd in zend_startup_modules ()
#11 0x00010a3287bf in php_module_startup ()
#12 0x00010a3ef637 in php_cli_startup ()
#13 0x00010a3efff8 in main ()


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



Re: [PHP] PHP script won't run in the background

2011-11-30 Thread richard gray

On 29/11/2011 17:16, Daniel Brown wrote:

On Sat, Nov 19, 2011 at 09:33, richard gray  wrote:
This happens because PHP is writing to STDOUT, of course, and then the 
command line redirection grabs that information and puts it into the 
file. Unfortunately, by itself, this won't work in the background, 
which is why you're getting the SIGTTOU (SIGnal TTy OUput). If you 
need to redirect the output and have it run in the background (where 
something like file_put_contents() or fwrite() isn't a practical 
option), give it a NOHUP (NO Hang-UP): nohup php test.php > test.log & 
This will automatically redirect STDERR to STDOUT, save for the 
message telling you the same. 


Thanks for your reply Daniel unfortunately nohup makes no difference the 
script still stops with no output being logged -- and also on a 
different machine (Ubuntu) php -f test.php >test.log 2>&1 & -- works 
perfectly - seems to be an issue with OSX Lion and the version of PHP 
that came with the machine -- I cannot compile my own build of PHP 
because of this problem -> https://bugs.php.net/bug.php?id=60268 -- so I 
am completely stuck :(


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



Re: [PHP] PHP script won't run in the background

2011-11-23 Thread Alain Williams
On Wed, Nov 23, 2011 at 06:14:07PM +0100, richard gray wrote:

> Reading symbols for shared libraries + done
> 0x000101d057ee in __ioctl ()
> 
> Any clues? To me it looks like PHP cli is trying to do some I/O but I'm 
> just a dumb developer... :)

ioctl on a tty is typically used to set it into single character at a time mode 
(remove stty's icanon).
It could have decided that since it is a tty then that should be set.

You need a bit more info, get a backtrace with 'where'.

-- 
Alain Williams
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT 
Lecturer.
+44 (0) 787 668 0256  http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: 
http://www.phcomp.co.uk/contact.php
#include 

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



Re: [PHP] PHP script won't run in the background

2011-11-23 Thread richard gray

On 23/11/2011 11:05, Laruence wrote:

Hi:
   I mean,  do you built your php with readline support, or do you load
readline.so into PHP?

   if so, remove it, then try again.

   and you also can use:
   gdb --pid={the pid of the stopped php}

   then you will find where the php  hangs.

thanks
I didn't build PHP as it fails to make -- see 
https://bugs.php.net/bug.php?id=60268 so I am stuck with the PHP build 
provided by Apple... :(


Here's what gdb says

[rich@LeMans] (/web/scripts)> php -f test.php >test.log 2>&1 &
[1] 3513
[rich@LeMans] (/web/scripts)>
[1]+  Stopped php -f test.php > test.log 2>&1
[rich@LeMans] (/web/scripts)> gdb --pid 3513
GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Mon Aug  8 20:32:45 
UTC 2011)

Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain 
conditions.

Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".
/Web/scripts/3513: No such file or directory
Attaching to process 3513.
Reading symbols for shared libraries . done
Reading symbols for shared libraries 
 
done

Reading symbols for shared libraries + done
0x000101d057ee in __ioctl ()

Any clues? To me it looks like PHP cli is trying to do some I/O but I'm 
just a dumb developer... :)


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



Re: [PHP] PHP script won't run in the background

2011-11-23 Thread Laruence
Hi:
  I mean,  do you built your php with readline support, or do you load
readline.so into PHP?

  if so, remove it, then try again.

  and you also can use:
  gdb --pid={the pid of the stopped php}

  then you will find where the php  hangs.

thanks

On Wed, Nov 23, 2011 at 1:04 AM, richard gray  wrote:
> On 22/11/2011 05:51, Laruence wrote:
>>
>> did you run php with readline?  try run the script without php-readline.
>>
>> thanks
>
> No - the script was just a basic string echo - no readline was involved.
>



-- 
Laruence  Xinchen Hui
http://www.laruence.com/

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



Re: [PHP] PHP script won't run in the background

2011-11-22 Thread richard gray

On 22/11/2011 05:51, Laruence wrote:

did you run php with readline?  try run the script without php-readline.

thanks

No - the script was just a basic string echo - no readline was involved.

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



Re: [PHP] PHP script won't run in the background

2011-11-21 Thread Laruence
On Sat, Nov 19, 2011 at 11:27 PM, richard gray  wrote:
>
>> Laruence, while that may be a helpful answer to a few people in the know,
I think a clue is better, leave some space for the people to dance.  :)
>> just replying back with a single line like that isn't really going to help
>> the people who are having this problem. At least explain why you suggested
>> that, or what it does for those on the list that don't know, especially as
>> it's not a PHP thing, it's a Unix command thing.
>>
>> Richard, some more info on the command Laruence mentioned can be found at
>> http://docstore.mik.ua/orelly/unix/upt/ch12_07.htm which explains it in more
>> detail.
>>
> not sure this is relevant as my script is not trying to write to the
> terminal the >test.log 2>&1 is sending stdout and stderr to the log file not
> the tty...

did you run php with readline?  try run the script without php-readline.

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



-- 
Laruence  Xinchen Hui
http://www.laruence.com/

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



Re: [PHP] PHP script won't run in the background

2011-11-21 Thread Richard Quadling
On 19 November 2011 14:33, richard gray  wrote:
> Hi all
>
> Hope someone can help me with a weird issue I have...
>
> I am trying to run a php CLI script in the background and it just won't run
> - it has a status of Stopped SIGTOU (Trying to write output) - Here are the
> details
>
> OS
> Mac OS X Lion 10.7.2
>
> PHP
> PHP 5.3.6 with Suhosin-Patch (cli) (built: Sep  8 2011 19:34:00)
> Copyright (c) 1997-2011 The PHP Group
> Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
>
> I created a basic script  test.php
>
> 
>
> Here are the results of various tests:-
>
> Test 1) php -f test.php  (Hello world gets displayed)
> Test 2) php -f test.php >test.log 2>&1 (Hello world gets put into test.log)
> Test 3) php -f test.php >test.log 2>&1 & --- I get [1]+  Stopped(SIGTTOU)
>      php -f test.php > test.log 2>&1 -- and the job just sits there doing
> nothing nothing gets logged however lsof shows the log file is open
>
> It is something to do with php because a similar shell script gets executed
> no problems in the background...
>
> This has me stumped ... any ideas?
>
> TIA
> Rich
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

I've seen this ...

php script.php 1>nul 2>nul

Not sure how effective it is. But the code is tagged as a "fire and
forget" mechanism.

-- 
Richard Quadling
Twitter : EE : Zend : PHPDoc : Fantasy Shopper
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea :
fan.sh/6/370

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



Re: [PHP] PHP script won't run in the background

2011-11-19 Thread richard gray


Laruence, while that may be a helpful answer to a few people in the 
know, just replying back with a single line like that isn't really 
going to help the people who are having this problem. At least explain 
why you suggested that, or what it does for those on the list that 
don't know, especially as it's not a PHP thing, it's a Unix command thing.


Richard, some more info on the command Laruence mentioned can be found 
at http://docstore.mik.ua/orelly/unix/upt/ch12_07.htm which explains 
it in more detail.


not sure this is relevant as my script is not trying to write to the 
terminal the >test.log 2>&1 is sending stdout and stderr to the log file 
not the tty...



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



Re: [PHP] PHP script won't run in the background

2011-11-19 Thread richard gray

On 19/11/2011 16:09, Laruence wrote:

$ stty -tostop


makes no difference

# stty -tostop
# php -f test.php >test.log 2>&1 &
# jobs
# [1]+  Stopped(SIGTTOU)php -f test.php > test.log 2>&1

Any other ideas?



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



Re: [PHP] PHP script won't run in the background

2011-11-19 Thread Ashley Sheridan
On Sat, 2011-11-19 at 23:09 +0800, Laruence wrote:

> $ stty -tostop
> 
> thanks
> 
> On Sat, Nov 19, 2011 at 10:33 PM, richard gray  wrote:
> > Hi all
> >
> > Hope someone can help me with a weird issue I have...
> >
> > I am trying to run a php CLI script in the background and it just won't run
> > - it has a status of Stopped SIGTOU (Trying to write output) - Here are the
> > details
> >
> > OS
> > Mac OS X Lion 10.7.2
> >
> > PHP
> > PHP 5.3.6 with Suhosin-Patch (cli) (built: Sep  8 2011 19:34:00)
> > Copyright (c) 1997-2011 The PHP Group
> > Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
> >
> > I created a basic script  test.php
> >
> > 
> >
> > Here are the results of various tests:-
> >
> > Test 1) php -f test.php  (Hello world gets displayed)
> > Test 2) php -f test.php >test.log 2>&1 (Hello world gets put into test.log)
> > Test 3) php -f test.php >test.log 2>&1 & --- I get [1]+  Stopped(SIGTTOU)
> >  php -f test.php > test.log 2>&1 -- and the job just sits there doing
> > nothing nothing gets logged however lsof shows the log file is open
> >
> > It is something to do with php because a similar shell script gets executed
> > no problems in the background...
> >
> > This has me stumped ... any ideas?
> >
> > TIA
> > Rich
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> 
> 
> -- 
> Laruence  Xinchen Hui
> http://www.laruence.com/
> 


Laruence, while that may be a helpful answer to a few people in the
know, just replying back with a single line like that isn't really going
to help the people who are having this problem. At least explain why you
suggested that, or what it does for those on the list that don't know,
especially as it's not a PHP thing, it's a Unix command thing.

Richard, some more info on the command Laruence mentioned can be found
at http://docstore.mik.ua/orelly/unix/upt/ch12_07.htm which explains it
in more detail.

-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] PHP script won't run in the background

2011-11-19 Thread Laruence
$ stty -tostop

thanks

On Sat, Nov 19, 2011 at 10:33 PM, richard gray  wrote:
> Hi all
>
> Hope someone can help me with a weird issue I have...
>
> I am trying to run a php CLI script in the background and it just won't run
> - it has a status of Stopped SIGTOU (Trying to write output) - Here are the
> details
>
> OS
> Mac OS X Lion 10.7.2
>
> PHP
> PHP 5.3.6 with Suhosin-Patch (cli) (built: Sep  8 2011 19:34:00)
> Copyright (c) 1997-2011 The PHP Group
> Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
>
> I created a basic script  test.php
>
> 
>
> Here are the results of various tests:-
>
> Test 1) php -f test.php  (Hello world gets displayed)
> Test 2) php -f test.php >test.log 2>&1 (Hello world gets put into test.log)
> Test 3) php -f test.php >test.log 2>&1 & --- I get [1]+  Stopped(SIGTTOU)
>      php -f test.php > test.log 2>&1 -- and the job just sits there doing
> nothing nothing gets logged however lsof shows the log file is open
>
> It is something to do with php because a similar shell script gets executed
> no problems in the background...
>
> This has me stumped ... any ideas?
>
> TIA
> Rich
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
Laruence  Xinchen Hui
http://www.laruence.com/

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



Re: [PHP] PHP script for detecting pattern sequences?

2009-07-10 Thread Isaac Dover
i just got pwned!

thanks, andrew. i should've paid more attention to what i was reading.

- isaac

On Fri, Jul 10, 2009 at 11:19 AM, Andrew Ballard  wrote:

> On Fri, Jul 10, 2009 at 10:30 AM, Isaac Dover wrote:
> >> On Wed, Jul 8, 2009 at 11:32 PM, WenDong Zhang 
> wrote:
> >> On Thu, Jul 9, 2009 at 6:00 AM, Per Jessen  wrote:
> >> > A suitable regex might look something like this:
> >> >
> >> > /([0-9]+)\1+/
> >> >
> >> > Not tested, probably won't work on the first try.  You may need
> >> > greediness adjustments.
> >> >
> >> >
> >> > /Per
> >>
> >> yes
> >> (\d+?)\1+  works fine
> >>
> >>
> >>
> >> --
> >> Best Regards!
> >> Wen Dong
> > those regex patterns wouldn't solve his problem. he wants to pull
> > repetitions from the string _before_ knowing a pattern. those patterns
> will
> > match the entire source string
> >
> > - isaac
>
> Those patterns look like a pretty good starting point to me. True, the
> first captured result of preg_match would be the entire string, but
> the submatches array would contain the actual sequence that is
> repeated:
>
> 
> $pattern = '/(\d+?)\1+/';
>
> $subject = '032258064516129032258064516129032258064516129032258064516129';
> if (preg_match($pattern, $subject, $matches)) {
>var_dump($matches);
> }
>
> /*
> array(2) {
>  [0]=>
>  string(60) "032258064516129032258064516129032258064516129032258064516129"
>  [1]=>
>  string(15) "032258064516129"
> }
> */
>
> $subject = '037037037037037037037037037037037037037037037037037037037037';
> if (preg_match($pattern, $subject, $matches)) {
>var_dump($matches);
> }
> /*
> array(2) {
>  [0]=>
>  string(60) "037037037037037037037037037037037037037037037037037037037037"
>  [1]=>
>  string(3) "037"
> }
> */
>
> $subject = '';
> if (preg_match($pattern, $subject, $matches)) {
>var_dump($matches);
> }
> /*
> array(2) {
>  [0]=>
>  string(60) ""
>  [1]=>
>  string(1) "3"
> }
> */
>
> ?>
>
>
>
> Some slight adjustments to the pattern could also be useful.
>
> // This would catch a pattern of any repeating characters, not just
> numeric digits
> $pattern = '/(.+?)\1+/';
>
> // This would only match if the entire string was a repeated sequence
> $pattern = '/^(\d+?)\1+$/';
>
> // This would match the repeated sequence only if the string began
> with a repeated sequence.
> $pattern = '/^(\d+?)\1+/';
>
> // This would match the repeated sequence only if the string ended
> with a repeated sequence.
> $pattern = '/(\d+?)\1+$/';
>
> If a string had multiple sequences, you could also use preg_match_all
> to find each sequence, but that looks a bit more involved than the OP.
>
> None of these require knowing the sequence in advance. How do they not
> satisfy the OP?
>
> Andrew
>


Re: [PHP] PHP script for detecting pattern sequences?

2009-07-10 Thread Andrew Ballard
On Fri, Jul 10, 2009 at 10:30 AM, Isaac Dover wrote:
>> On Wed, Jul 8, 2009 at 11:32 PM, WenDong Zhang  wrote:
>> On Thu, Jul 9, 2009 at 6:00 AM, Per Jessen  wrote:
>> > A suitable regex might look something like this:
>> >
>> > /([0-9]+)\1+/
>> >
>> > Not tested, probably won't work on the first try.  You may need
>> > greediness adjustments.
>> >
>> >
>> > /Per
>>
>> yes
>> (\d+?)\1+  works fine
>>
>>
>>
>> --
>> Best Regards!
>> Wen Dong
> those regex patterns wouldn't solve his problem. he wants to pull
> repetitions from the string _before_ knowing a pattern. those patterns will
> match the entire source string
>
> - isaac

Those patterns look like a pretty good starting point to me. True, the
first captured result of preg_match would be the entire string, but
the submatches array would contain the actual sequence that is
repeated:


  string(60) "032258064516129032258064516129032258064516129032258064516129"
  [1]=>
  string(15) "032258064516129"
}
*/

$subject = '037037037037037037037037037037037037037037037037037037037037';
if (preg_match($pattern, $subject, $matches)) {
var_dump($matches);
}
/*
array(2) {
  [0]=>
  string(60) "037037037037037037037037037037037037037037037037037037037037"
  [1]=>
  string(3) "037"
}
*/

$subject = '';
if (preg_match($pattern, $subject, $matches)) {
var_dump($matches);
}
/*
array(2) {
  [0]=>
  string(60) ""
  [1]=>
  string(1) "3"
}
*/

?>



Some slight adjustments to the pattern could also be useful.

// This would catch a pattern of any repeating characters, not just
numeric digits
$pattern = '/(.+?)\1+/';

// This would only match if the entire string was a repeated sequence
$pattern = '/^(\d+?)\1+$/';

// This would match the repeated sequence only if the string began
with a repeated sequence.
$pattern = '/^(\d+?)\1+/';

// This would match the repeated sequence only if the string ended
with a repeated sequence.
$pattern = '/(\d+?)\1+$/';

If a string had multiple sequences, you could also use preg_match_all
to find each sequence, but that looks a bit more involved than the OP.

None of these require knowing the sequence in advance. How do they not
satisfy the OP?

Andrew

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



Re: [PHP] PHP script for detecting pattern sequences?

2009-07-10 Thread Isaac Dover
sorry, should have added that i'm not aware of any library to do this, but
you could certainly write one! :) and i forgot to use the list, sorry.

- isaac

On Fri, Jul 10, 2009 at 10:28 AM, Isaac Dover  wrote:

> though this looks suspiciously like a homework assignment, i'll bite.
>
> those regex patterns wouldn't solve his problem. he wants to pull
> repetitions from the string _before_ knowing a pattern. those patterns will
> match the entire source string
>
> without trying, i would think that you may try using a technique that reads
> a character, then looks for the next occurrence of that character. if you're
> lucky, then that character will be the beginning of the sequence. you'll
> just look at the substring from that first occurrence until the next, then
> search the string for that substring.
>
> if unlucky, you'll move to the next string, _append it_ to the previous,
> repeat the process, and so on. at some point, you'll have the pattern built
> in memory and will be searching the source string using your built "pattern
> string". at some point, something will have to match.
>
> the trick is in recursion. also, i'm assuming your real examples are more
> complicated than what you have above. in the two listed, you already know
> that a zero indicates that the pattern is beginning, so you just look for,
> and note the index of, zeroes.
>
> i've thumbed through a free book online that deals with text parsing. it's
> very technical, but interesting at the same time. maybe you can find it.
>
> - isaac
>
>
> On Wed, Jul 8, 2009 at 11:32 PM, WenDong Zhang  wrote:
>
>> yes
>> (\d+?)\1+  works fine
>>
>> On Thu, Jul 9, 2009 at 6:00 AM, Per Jessen  wrote:
>>
>> > Rob Gould wrote:
>> >
>> > > Can anyone tell me if there's a PHP library out there that will help
>> > > me determine "pattern sequences" from a string?
>> > >
>> > >
>> > > Example input:
>> > >
>> > > 032258064516129032258064516129032258064516129032258064516129
>> > > Sequence = 032258064516129
>> > >
>> > >
>> > > 037037037037037037037037037037037037037037037037037037037037
>> > > Sequence = 037
>> > >
>> > >
>> > > I know regex can help you find a pattern when you know what the
>> > > pattern is already, but this is different.
>> >
>> > Nah, it's the same thing.
>> >
>> > A suitable regex might look something like this:
>> >
>> > /([0-9]+)\1+/
>> >
>> > Not tested, probably won't work on the first try.  You may need
>> > greediness adjustments.
>> >
>> >
>> > /Per
>> >
>> >
>> > --
>> > Per Jessen, Zürich (14.1°C)
>> >
>> >
>> > --
>> > PHP General Mailing List (http://www.php.net/)
>> > To unsubscribe, visit: http://www.php.net/unsub.php
>> >
>> >
>>
>>
>> --
>> Best Regards!
>> Wen Dong
>>
>
>


Re: [PHP] PHP script for detecting pattern sequences?

2009-07-08 Thread WenDong Zhang
yes
(\d+?)\1+  works fine

On Thu, Jul 9, 2009 at 6:00 AM, Per Jessen  wrote:

> Rob Gould wrote:
>
> > Can anyone tell me if there's a PHP library out there that will help
> > me determine "pattern sequences" from a string?
> >
> >
> > Example input:
> >
> > 032258064516129032258064516129032258064516129032258064516129
> > Sequence = 032258064516129
> >
> >
> > 037037037037037037037037037037037037037037037037037037037037
> > Sequence = 037
> >
> >
> > I know regex can help you find a pattern when you know what the
> > pattern is already, but this is different.
>
> Nah, it's the same thing.
>
> A suitable regex might look something like this:
>
> /([0-9]+)\1+/
>
> Not tested, probably won't work on the first try.  You may need
> greediness adjustments.
>
>
> /Per
>
>
> --
> Per Jessen, Zürich (14.1°C)
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Best Regards!
Wen Dong


Re: [PHP] PHP script for detecting pattern sequences?

2009-07-08 Thread Per Jessen
Rob Gould wrote:

> Can anyone tell me if there's a PHP library out there that will help
> me determine "pattern sequences" from a string?
> 
> 
> Example input:
> 
> 032258064516129032258064516129032258064516129032258064516129
> Sequence = 032258064516129
> 
> 
> 037037037037037037037037037037037037037037037037037037037037
> Sequence = 037
> 
> 
> I know regex can help you find a pattern when you know what the
> pattern is already, but this is different.

Nah, it's the same thing. 

A suitable regex might look something like this:

/([0-9]+)\1+/

Not tested, probably won't work on the first try.  You may need
greediness adjustments. 


/Per


-- 
Per Jessen, Zürich (14.1°C)


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



Re: [PHP] PHP script lag (5 secs) when declaring mime type.

2009-03-05 Thread Andrew Ballard
On Thu, Mar 5, 2009 at 1:26 PM, Jsbeginner  wrote:
> Thankyou Andrew Ballard and 9Tel ,


You're welcome. However, you forgot to reply to the list.


> You both suggest that it's not necessory to set the Content-Length except
> for images etc ... well the problem is that I also need to use this script
> for showing images as well as css and javascript.


As I understand, there is no point in using gzip to serve images since
they are usually already compressed and/or not very well suited to
textual compression. In fact, I suspect that if you serve a document
with a Content-Type of image/gif, image/jpeg, image/png, etc., either
PHP or Apache will detect that and bypass the gzip handler. (That's
just a guess, though. I don't have any way at present to test that
theory.)


> It's actually part of the dotclear blog system, it's plugin system uses a
> very similar code but fetching the mime type automaticaly.
> And it's not part of one plugin but used for all the plugins so if any
> plugins are installed on any dotclear installation on the server there will
> be a lag.
>
> Also I don't see how it would be possible to check file size after gzip ...
> doesn't PHP take the file and then pass it through gzip changing the size on
> the way ?


Based on Nisse's response, I think you're better off leaving the
Content-Length header out entirely (as we already suggested).


> I guess I will have to send an e-mail to the dotclear team to ask their
> advice.
>
> Thankyou.
>
> Andrew Ballard a écrit :
>
> On Thu, Mar 5, 2009 at 12:34 PM, Jsbeginner 
> wrote:
>
>
> Thankyou,
>
> I took "application/x-javascript" directly from the apache setup for my
> domain so this should be correct.
>
> However I've just deactivated gzip (zlib.output_compression OFF in php.ini)
> and that stopped the problem.
> I've given you a simplified version of the script that has the exact same
> problem (the original one gets the mime type automaticaly and has the same
> problem with any files that are gziped (css, html, javascript etc... but not
> images.).
>
> So the problem seems to have someting to do with this line :
>
>
>
> header('Content-Length: '.filesize('test.js'));
>
>
> and with gzip ...
>
> I would like to be able to activate gzip again but I need to work out why
> I'm getting this bug first.
>
> Apache isn't installed with mod_deflate, should I look into doing this
> instead of turning zlib.output_compression on again ?
>
> Is there maybe a bug with PHP 5.2.9 that's causing this problem?
>
> Thankyou :)
>
> haliphax a écrit :
>
>
> If you use gzip'd output, does PHP automatically generate a
> Content-Length header? It seems to me that the value for
> Content-Length should be the compressed size, not the uncompressed
> size that you are sending. Besides - do you really need to send
> Content-Length? I don't usually see it sent, and the only time I've
> seen it make a difference is if I'm sending the file as an attachment
> (prompting the browser to save the file rather than displaying it). If
> removing the line eliminates the problem, I'd just remove the line and
> be done with it.
>
> Andrew
>
>
>

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



Re: [PHP] PHP script lag (5 secs) when declaring mime type.

2009-03-05 Thread Andrew Ballard
On Thu, Mar 5, 2009 at 12:34 PM, Jsbeginner  wrote:
> Thankyou,
>
> I took "application/x-javascript" directly from the apache setup for my
> domain so this should be correct.
>
> However I've just deactivated gzip (zlib.output_compression OFF in php.ini)
> and that stopped the problem.
> I've given you a simplified version of the script that has the exact same
> problem (the original one gets the mime type automaticaly and has the same
> problem with any files that are gziped (css, html, javascript etc... but not
> images.).
>
> So the problem seems to have someting to do with this line :
>
>> header('Content-Length: '.filesize('test.js'));
>
> and with gzip ...
>
> I would like to be able to activate gzip again but I need to work out why
> I'm getting this bug first.
>
> Apache isn't installed with mod_deflate, should I look into doing this
> instead of turning zlib.output_compression on again ?
>
> Is there maybe a bug with PHP 5.2.9 that's causing this problem?
>
> Thankyou :)
>
> haliphax a écrit :

If you use gzip'd output, does PHP automatically generate a
Content-Length header? It seems to me that the value for
Content-Length should be the compressed size, not the uncompressed
size that you are sending. Besides - do you really need to send
Content-Length? I don't usually see it sent, and the only time I've
seen it make a difference is if I'm sending the file as an attachment
(prompting the browser to save the file rather than displaying it). If
removing the line eliminates the problem, I'd just remove the line and
be done with it.

Andrew

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



Re: [PHP] PHP script lag (5 secs) when declaring mime type.

2009-03-05 Thread 9el
On Thu, Mar 5, 2009 at 11:34 PM, Jsbeginner wrote:

> Thankyou,
>
> I took "application/x-javascript" directly from the apache setup for my
> domain so this should be correct.
>
> However I've just deactivated gzip (zlib.output_compression OFF in php.ini)
> and that stopped the problem.
> I've given you a simplified version of the script that has the exact same
> problem (the original one gets the mime type automaticaly and has the same
> problem with any files that are gziped (css, html, javascript etc... but not
> images.).
>
> So the problem seems to have someting to do with this line :
>
>  header('Content-Length: '.filesize('test.js'));
>>
> and with gzip ...


I think content-length is not a thing you have to mention.  Only I have seen
its required for image type data yet.

>
>
> I would like to be able to activate gzip again but I need to work out why
> I'm getting this bug first.
>
> Apache isn't installed with mod_deflate, should I look into doing this
> instead of turning zlib.output_compression on again ?
>
> Is there maybe a bug with PHP 5.2.9 that's causing this problem?
>
> Thankyou :)
>
> haliphax a écrit :
>
>  On Thu, Mar 5, 2009 at 10:27 AM, Jsbeginner 
>> wrote:
>>
>>
>>> Hello, Just to say that I've got a bit further in my search :
>>>
>>> >> header('Content-Type: application/x-javascript');
>>> //header('Content-Length: '.filesize('test.js'));
>>> readfile('test.js');
>>> ?>
>>>
>>> (Content-Length line removed) Has no lag...
>>>
>>> My guess is there is a problem with gzip or something that corrupts the
>>> content-length.
>>>
>>> So I'm still not sure if this is a PHP problem or an apache problem but
>>> any
>>> help would be great :)
>>>
>>> Thankyou
>>>
>>>
>>> Jsbeginner a écrit :
>>>
>>>
 Hello,

 I don't know for sure is this problem is only related to PHP so I hope
 I've posted in the right list.

 My problem is that with certain headers my script takes about 5 seconds
 before sending the page, no matter how small the file I try to load...
 My server :
 Centos
 Apache 2.2
 PHP 5.2.9

 Here's my code :

 >>> header('Content-Type: application/x-javascript');
 header('Content-Length: '.filesize('test.js'));
 readfile('test.js');
 ?>

 test.js is only a few lines long, and if I remove the header content
 type
 the file loads instantaniously do it's not a problem with readfile.
 I thought about zlib gzip taking maybe a long time to load but I've
 changed the compression level from 6 to 1 and the file still has a the
 same
 lag.

 My server responds very fast for eveything else except this script. Do
 you
 have an idea what might be causing this lag ?

 Thanks in advance :)


>>>
>> Well, have you tried using Content-Type: "text/javascript" as
>> suggested? Is "application/x-javascript" absolutely necessary for
>> whatever application is reading your script's output? As it has
>> already been mentioned, Apache may be looking for your content type in
>> some sort of lookup table, not finding it, and taking its sweet time
>> returning control back to PHP while it grabs at straws to match.
>>
>>
>>
>>
>
>


Re: [PHP] PHP script lag (5 secs) when declaring mime type.

2009-03-05 Thread Jsbeginner

Thankyou,

I took "application/x-javascript" directly from the apache setup for my 
domain so this should be correct.


However I've just deactivated gzip (zlib.output_compression OFF in 
php.ini) and that stopped the problem.
I've given you a simplified version of the script that has the exact 
same problem (the original one gets the mime type automaticaly and has 
the same problem with any files that are gziped (css, html, javascript 
etc... but not images.).


So the problem seems to have someting to do with this line :


header('Content-Length: '.filesize('test.js'));

and with gzip ...

I would like to be able to activate gzip again but I need to work out 
why I'm getting this bug first.


Apache isn't installed with mod_deflate, should I look into doing this 
instead of turning zlib.output_compression on again ?


Is there maybe a bug with PHP 5.2.9 that's causing this problem?

Thankyou :)

haliphax a écrit :

On Thu, Mar 5, 2009 at 10:27 AM, Jsbeginner  wrote:
  

Hello, Just to say that I've got a bit further in my search :



(Content-Length line removed) Has no lag...

My guess is there is a problem with gzip or something that corrupts the
content-length.

So I'm still not sure if this is a PHP problem or an apache problem but any
help would be great :)

Thankyou


Jsbeginner a écrit :


Hello,

I don't know for sure is this problem is only related to PHP so I hope
I've posted in the right list.

My problem is that with certain headers my script takes about 5 seconds
before sending the page, no matter how small the file I try to load...
My server :
Centos
Apache 2.2
PHP 5.2.9

Here's my code :



test.js is only a few lines long, and if I remove the header content type
the file loads instantaniously do it's not a problem with readfile.
I thought about zlib gzip taking maybe a long time to load but I've
changed the compression level from 6 to 1 and the file still has a the same
lag.

My server responds very fast for eveything else except this script. Do you
have an idea what might be causing this lag ?

Thanks in advance :)
  


Well, have you tried using Content-Type: "text/javascript" as
suggested? Is "application/x-javascript" absolutely necessary for
whatever application is reading your script's output? As it has
already been mentioned, Apache may be looking for your content type in
some sort of lookup table, not finding it, and taking its sweet time
returning control back to PHP while it grabs at straws to match.


  




Re: [PHP] PHP script lag (5 secs) when declaring mime type.

2009-03-05 Thread haliphax
On Thu, Mar 5, 2009 at 10:27 AM, Jsbeginner  wrote:
> Hello, Just to say that I've got a bit further in my search :
>
>  header('Content-Type: application/x-javascript');
> //header('Content-Length: '.filesize('test.js'));
> readfile('test.js');
> ?>
>
> (Content-Length line removed) Has no lag...
>
> My guess is there is a problem with gzip or something that corrupts the
> content-length.
>
> So I'm still not sure if this is a PHP problem or an apache problem but any
> help would be great :)
>
> Thankyou
>
>
> Jsbeginner a écrit :
>>
>> Hello,
>>
>> I don't know for sure is this problem is only related to PHP so I hope
>> I've posted in the right list.
>>
>> My problem is that with certain headers my script takes about 5 seconds
>> before sending the page, no matter how small the file I try to load...
>> My server :
>> Centos
>> Apache 2.2
>> PHP 5.2.9
>>
>> Here's my code :
>>
>> > header('Content-Type: application/x-javascript');
>> header('Content-Length: '.filesize('test.js'));
>> readfile('test.js');
>> ?>
>>
>> test.js is only a few lines long, and if I remove the header content type
>> the file loads instantaniously do it's not a problem with readfile.
>> I thought about zlib gzip taking maybe a long time to load but I've
>> changed the compression level from 6 to 1 and the file still has a the same
>> lag.
>>
>> My server responds very fast for eveything else except this script. Do you
>> have an idea what might be causing this lag ?
>>
>> Thanks in advance :)

Well, have you tried using Content-Type: "text/javascript" as
suggested? Is "application/x-javascript" absolutely necessary for
whatever application is reading your script's output? As it has
already been mentioned, Apache may be looking for your content type in
some sort of lookup table, not finding it, and taking its sweet time
returning control back to PHP while it grabs at straws to match.


-- 
// Todd

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



Re: [PHP] PHP script lag (5 secs) when declaring mime type.

2009-03-05 Thread Jsbeginner

Hello, Just to say that I've got a bit further in my search :



(Content-Length line removed) Has no lag...

My guess is there is a problem with gzip or something that corrupts the 
content-length.


So I'm still not sure if this is a PHP problem or an apache problem but 
any help would be great :)


Thankyou


Jsbeginner a écrit :

Hello,

I don't know for sure is this problem is only related to PHP so I hope 
I've posted in the right list.


My problem is that with certain headers my script takes about 5 
seconds before sending the page, no matter how small the file I try to 
load...

My server :
Centos
Apache 2.2
PHP 5.2.9

Here's my code :



test.js is only a few lines long, and if I remove the header content 
type the file loads instantaniously do it's not a problem with readfile.
I thought about zlib gzip taking maybe a long time to load but I've 
changed the compression level from 6 to 1 and the file still has a the 
same lag.


My server responds very fast for eveything else except this script. Do 
you have an idea what might be causing this lag ?


Thanks in advance :)






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



Re: [PHP] PHP script lag (5 secs) when declaring mime type.

2009-03-05 Thread Jochem Maas
Jsbeginner schreef:
> Hello,
> 
> I don't know for sure is this problem is only related to PHP so I hope
> I've posted in the right list.
> 
> My problem is that with certain headers my script takes about 5 seconds
> before sending the page, no matter how small the file I try to load...
> My server :
> Centos
> Apache 2.2
> PHP 5.2.9
> 
> Here's my code :
> 
>  header('Content-Type: application/x-javascript');
> header('Content-Length: '.filesize('test.js'));
> readfile('test.js');
> ?>
> 
> test.js is only a few lines long, and if I remove the header content
> type the file loads instantaniously do it's not a problem with readfile.
> I thought about zlib gzip taking maybe a long time to load but I've
> changed the compression level from 6 to 1 and the file still has a the
> same lag.
> 
> My server responds very fast for eveything else except this script. Do
> you have an idea what might be causing this lag ?

something to do with apache, usually we we see this it's something to do with 
DNS
lookups ... unlikely in your case.

I figure it's something to do with apaches' content negotiation, possibly it 
looks up
your content-type for some reason but ends up not recognizing it (and tries 
alsort of
stuff before giving up and just sending the output)

http://httpd.apache.org/docs/2.0/content-negotiation.html

question is do you really need "application/x-javascript"?
won't "text/javascript" do just fine? or does that have the same problem?
... actually does the problem occur with any value for 'Content-Type'?

> 
> Thanks in advance :)
> 
> 


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



Re: [PHP] PHP script gives no output or error message

2008-12-27 Thread John Musbach
On Sat, Dec 27, 2008 at 3:32 PM, John Musbach  wrote:
>
> Thanks, turns out there were multiple problems with my code. My final
> working code is:
>
> 
>
> for anyone who may be trying to accomplish the same thing as me. In
> addition I edited index.php in the themes folder and added a php
> clause such that in the event the user is anonymous they are
> redirected to the autologin.php script and I also edited the
> register.php themes script to omit the UserCP password field and
> password confirmation since everyone in this setup is assigned one
> long random password (the thought being that the kerberos
> username/password is enough to worry about, there should be no need to
> worry about another username/password).

I almost forgot, I resolved the blank page issue by looking at the
.htaccess file FUDforum installed in its main public directory
...turns out the file contained a directive which suppressed all php
errors even when the value was specified differently in individual php
scripts, modifying that directive to show all php errors resolved that
issue.


--
Best Regards,

John Musbach

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



Re: [PHP] PHP script gives no output or error message

2008-12-27 Thread John Musbach
On Sat, Dec 27, 2008 at 1:13 PM, Daniel Brown  wrote:
>Good afternoon, John;
>
>There's a syntax error on line 19:
>
>> if(external_fud_login(fud_fetch_user($user)['id']))!=NULL) //User ID is 
>> valid and logged in
>
>It should be:
>if(external_fud_login(fud_fetch_user($user['id']))!=NULL)
> //User ID is valid and logged in

Thanks, turns out there were multiple problems with my code. My final
working code is:

id);
if(!empty($uid->id) && !empty($login)) //User ID is valid and logged in
{
//echo("Welcome, " . $user . ", please wait while you are
logged in...");
header( 'Location: https://blah.com/~jmusbach/FUDforum2/?S='.$login);

}
else //User ID is invalid, register and log in
{
//echo("Welcome, " . $user . ", please wait while you are registered
and logged in...");
$vals['login']=$user;
$vals['passwd']="password";
$vals['email']=$email;
$vals['name']=$realname;
$uid=fud_add_user($vals,$error);
$login=external_fud_login($uid);

if($uid!=0 and empty($error))
{
  header('Location: https://blah.com/~jmusbach/FUDforum2/?S='.$login);
}
else
{
  echo($error);
  die();
}

}



?>

for anyone who may be trying to accomplish the same thing as me. In
addition I edited index.php in the themes folder and added a php
clause such that in the event the user is anonymous they are
redirected to the autologin.php script and I also edited the
register.php themes script to omit the UserCP password field and
password confirmation since everyone in this setup is assigned one
long random password (the thought being that the kerberos
username/password is enough to worry about, there should be no need to
worry about another username/password).

-- 
Best Regards,

John Musbach

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



Re: [PHP] PHP script gives no output or error message

2008-12-27 Thread Daniel Brown
Good afternoon, John;

On Sat, Dec 27, 2008 at 03:28, John Musbach  wrote:
[snip!]

There's a syntax error on line 19:

> if(external_fud_login(fud_fetch_user($user)['id']))!=NULL) //User ID is valid 
> and logged in

It should be:
if(external_fud_login(fud_fetch_user($user['id']))!=NULL)
//User ID is valid and logged in

-- 

daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!

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



Re: [PHP] PHP Script/Thread ID thingie

2008-08-19 Thread Jochem Maas

Herman Gomez schreef:

Jochem Maas wrote:

[EMAIL PROTECTED] schreef:
I'm logging things with error_log, and would like to be able to sort 
out one script run from another.


So I'm looking for some kind of "script id" or "thread id" or "PHP 
script run execution ID" type of function.


getmypid() just returns the same apache child process ID all the 
time, so that's not what I want.














Following the wrapper idea, you can use the session ID. It's unique per 
user, no matter if they share the thread some times.


d'oh ... looking back at the code I was thinking of I actually used the session 
ID!



Regards,
Herman




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



Re: [PHP] PHP Script/Thread ID thingie

2008-08-19 Thread Herman Gomez

Jochem Maas wrote:

[EMAIL PROTECTED] schreef:
I'm logging things with error_log, and would like to be able to sort 
out one script run from another.


So I'm looking for some kind of "script id" or "thread id" or "PHP 
script run execution ID" type of function.


getmypid() just returns the same apache child process ID all the time, 
so that's not what I want.


zend_thread_id() looks useful, but I suspect it's not quite what I'm 
looking for.  But I'd have to re-compile with ZTS and --debug-mode and 
I don't think the function I'm looking for should require that...


Perhaps I've just missed the right function name?

Or perhaps this should be a "Feature Request"?


might very well be. I've had thew same annoyance more than once ... my 
'solution' was to
use a wrapper for error_log() (you do that anyway right ;-) and have it 
prepend a per-request 'unique'
string to each log message (some timestamp/scriptname/random-value 
mashup) and then output that same
per-request 'unique' string at the bottom of each page (so that you can 
then use that value to

grep in the error log) ... not very satisfactory, but it works.

BTW, hi!








Following the wrapper idea, you can use the session ID. It's unique per 
user, no matter if they share the thread some times.


Regards,
Herman

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



Re: [PHP] PHP Script/Thread ID thingie

2008-08-19 Thread Jochem Maas

[EMAIL PROTECTED] schreef:

I'm logging things with error_log, and would like to be able to sort out one 
script run from another.

So I'm looking for some kind of "script id" or "thread id" or "PHP script run 
execution ID" type of function.

getmypid() just returns the same apache child process ID all the time, so 
that's not what I want.

zend_thread_id() looks useful, but I suspect it's not quite what I'm looking 
for.  But I'd have to re-compile with ZTS and --debug-mode and I don't think 
the function I'm looking for should require that...

Perhaps I've just missed the right function name?

Or perhaps this should be a "Feature Request"?


might very well be. I've had thew same annoyance more than once ... my 
'solution' was to
use a wrapper for error_log() (you do that anyway right ;-) and have it prepend 
a per-request 'unique'
string to each log message (some timestamp/scriptname/random-value mashup) and 
then output that same
per-request 'unique' string at the bottom of each page (so that you can then 
use that value to
grep in the error log) ... not very satisfactory, but it works.

BTW, hi!







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



Re: [PHP] PHP Script/Thread ID thingie

2008-08-15 Thread Stut

On 15 Aug 2008, at 23:30, Richard Lynch wrote:

On Fri, August 15, 2008 10:52 am, Stut wrote:

On 15 Aug 2008, at 16:37, [EMAIL PROTECTED] wrote:

I'm logging things with error_log, and would like to be able to sort
out one script run from another.

So I'm looking for some kind of "script id" or "thread id" or "PHP
script run execution ID" type of function.

getmypid() just returns the same apache child process ID all the
time, so that's not what I want.

zend_thread_id() looks useful, but I suspect it's not quite what I'm
looking for.  But I'd have to re-compile with ZTS and --debug-mode
and I don't think the function I'm looking for should require
that...

Perhaps I've just missed the right function name?

Or perhaps this should be a "Feature Request"?


Don't think there is such a thing, but you could generate one by
combining the pid, timestamp and the script filename, maybe into an
md5 hash value or similar. Thinking about it, "ip.pid" would be
enough, i.e. 127.0.0.1.12345.


The IP and pid will not actually change...

It's just me surfing to my own app (or one I inherited) on my own
desktop.

Apache isn't getting nearly exercised enough to need a second child,
so the pid is the same all the time...

Guess I'll have to create one as Eric Butera suggested...

Seems kind of odd that there isn't some kind of
script/thread/M_INIT/R_INIT id hanging around and exposed that
developers could use.
[shrug]


I don't find that odd since there's on external context to such an ID  
other than that which you create within the script so you can just use  
something randomly unique.


-Stut

--
http://stut.net/

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



Re: [PHP] PHP Script/Thread ID thingie

2008-08-15 Thread Richard Lynch
On Fri, August 15, 2008 10:52 am, Stut wrote:
> On 15 Aug 2008, at 16:37, [EMAIL PROTECTED] wrote:
>> I'm logging things with error_log, and would like to be able to sort
>> out one script run from another.
>>
>> So I'm looking for some kind of "script id" or "thread id" or "PHP
>> script run execution ID" type of function.
>>
>> getmypid() just returns the same apache child process ID all the
>> time, so that's not what I want.
>>
>> zend_thread_id() looks useful, but I suspect it's not quite what I'm
>> looking for.  But I'd have to re-compile with ZTS and --debug-mode
>> and I don't think the function I'm looking for should require
>> that...
>>
>> Perhaps I've just missed the right function name?
>>
>> Or perhaps this should be a "Feature Request"?
>
> Don't think there is such a thing, but you could generate one by
> combining the pid, timestamp and the script filename, maybe into an
> md5 hash value or similar. Thinking about it, "ip.pid" would be
> enough, i.e. 127.0.0.1.12345.

The IP and pid will not actually change...

It's just me surfing to my own app (or one I inherited) on my own
desktop.

Apache isn't getting nearly exercised enough to need a second child,
so the pid is the same all the time...

Guess I'll have to create one as Eric Butera suggested...

Seems kind of odd that there isn't some kind of
script/thread/M_INIT/R_INIT id hanging around and exposed that
developers could use.
[shrug]

-- 
Some people ask for gifts here.
I just want you to buy an Indie CD for yourself:
http://cdbaby.com/search/from/lynch



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



Re: [PHP] PHP Script/Thread ID thingie

2008-08-15 Thread Eric Butera
On Fri, Aug 15, 2008 at 11:37 AM,  <[EMAIL PROTECTED]> wrote:
>
> I'm logging things with error_log, and would like to be able to sort out one 
> script run from another.
>
> So I'm looking for some kind of "script id" or "thread id" or "PHP script run 
> execution ID" type of function.
>
> getmypid() just returns the same apache child process ID all the time, so 
> that's not what I want.
>
> zend_thread_id() looks useful, but I suspect it's not quite what I'm looking 
> for.  But I'd have to re-compile with ZTS and --debug-mode and I don't think 
> the function I'm looking for should require that...
>
> Perhaps I've just missed the right function name?
>
> Or perhaps this should be a "Feature Request"?


I suppose if nobody else has better ideas you can fake it with setting
some sort of unique value and combining that with __FILE__ for your
instance run.



Not very glamorous though. ;)

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



Re: [PHP] PHP Script/Thread ID thingie

2008-08-15 Thread Stut

On 15 Aug 2008, at 16:37, [EMAIL PROTECTED] wrote:
I'm logging things with error_log, and would like to be able to sort  
out one script run from another.


So I'm looking for some kind of "script id" or "thread id" or "PHP  
script run execution ID" type of function.


getmypid() just returns the same apache child process ID all the  
time, so that's not what I want.


zend_thread_id() looks useful, but I suspect it's not quite what I'm  
looking for.  But I'd have to re-compile with ZTS and --debug-mode  
and I don't think the function I'm looking for should require that...


Perhaps I've just missed the right function name?

Or perhaps this should be a "Feature Request"?


Don't think there is such a thing, but you could generate one by  
combining the pid, timestamp and the script filename, maybe into an  
md5 hash value or similar. Thinking about it, "ip.pid" would be  
enough, i.e. 127.0.0.1.12345.


-Stut

--
http://stut.net/

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



Re: [PHP] Php script for mail in a xhtml page

2007-09-10 Thread brian

Chris wrote:

brian wrote:


- You can do without the "echo" by using, eg. 



Yet later in another thread you complain about short_tags being an 
option.. can't have it both ways.


Oh, is that so? Let's see what i wrote ...

-- snip --
... Better yet, PHP should do away with  altogether but allow
, which is *very* helpful (to those of us who choose to use it).
-- snip --


Leave it as 

it's more portable - it will work on every single php server and you 
won't have any issues moving your code around.




-- snip --
I do agree that developing with short_open_tags = on is a Bad Idea if 
the app will not be under one's control.

-- snip --

But thanks. I know you were really trying.

brian

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



Re: [PHP] Php script for mail in a xhtml page

2007-09-09 Thread Chris

brian wrote:

Mauro Sacchetto wrote:

I've to implement a php script in a web page to send mail.
If I use a .html form and a separate .php script, all works fine.
In the contrary, if I try to put the script into the .html file,
I've some troubles... Here's the code:

...

When I try to open the page, I receive this error:

Parse error: syntax error, unexpected T_STRING in 
/var/www/netsons.org/samiel/form2.php on line 79


Do u see my error?


{Copies, pastes into editor that will number the lines ...}

Well, looking in the vicinity of line 79, i'd say the problem lies with 
your reversed PHP tags:


 echo $name. 

You've got another right below that:

?> echo $message;

Some other points:

- You can do without the "echo" by using, eg. 


Yet later in another thread you complain about short_tags being an 
option.. can't have it both ways.


Leave it as 

it's more portable - it will work on every single php server and you 
won't have any issues moving your code around.


--
Postgresql & php tutorials
http://www.designmagick.com/

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



Re: [PHP] Php script for mail in a xhtml page

2007-09-07 Thread brian

Mauro Sacchetto wrote:

I've to implement a php script in a web page to send mail.
If I use a .html form and a separate .php script, all works fine.
In the contrary, if I try to put the script into the .html file,
I've some troubles... Here's the code:

...

When I try to open the page, I receive this error:

Parse error: syntax error, unexpected T_STRING 
in /var/www/netsons.org/samiel/form2.php on line 79


Do u see my error?


{Copies, pastes into editor that will number the lines ...}

Well, looking in the vicinity of line 79, i'd say the problem lies with 
your reversed PHP tags:


 echo $name. 

You've got another right below that:

?> echo $message;

Some other points:

- You can do without the "echo" by using, eg. 

- Because this is an XHTML page, you should be closing your input tags 
and properly quoting the attributes: value="" />


- That your script's purpose is to send mail has nothing to do with how 
it displays in a browser.


Anyway, that should do it. Be sure to validate the page.

brian

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



Re: [PHP] Php script diagnostic app?

2007-06-25 Thread William Lovaton
If you have little knowledge about C you can use sysprof on a relatively
new Linux distribution and you can see on a live system where the CPU is
consumed the most.

[] http://www.daimi.au.dk/~sandmann/sysprof/
[] http://live.gnome.org/Sysprof

With a little help of Google you can map C functions to the PHP
equivalents and this way you can get a bit more of understanding about
what is going on in your code.

Finally, xdebug is real nice too.


-William


On Sun, 2007-06-17 at 13:35 -0400, MIKE YRABEDRA wrote:
> 
> I was wondering if there was some kind of application that would process a
> php script, logging any functions (or classes) it encounters along the way.
> Logging times and memory use.
> 
> I am trying to figure out what in a script slows it down so much.
> 
> Any ideas?
> 
> 
> -- 
> Mike Yrabedra B^)>
> 

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



Re: [PHP] Php script diagnostic app?

2007-06-18 Thread Guillaume Theoret

Thanks a lot for that post Paul.

It brings up a question though. You said to never ever use that on a
production server (an important disclaimer!) so I was wondering what
people here used to log and simulate loads. I've used OpenSTA (
http://opensta.org/ ) and I was pleased with the results but it only
works with windows. What do you guys generally use under linux? Just
squid? Something else?

I suppose I can just set up a windows box if I have to since OpenSTA
acts as a transparent gateway but if there's a good linux solution out
there for recording usage and playing it back concurrently I'd like to
hear about it. With OpenSTA to create a test script it's as easy as
clicking the record button to create the script and stop when you're
done. Then you can go in and manually edit the script if you like and
you can play it back as many times as you'd like concurrently (thereby
simulating many users). Anyone know of anything like this?

Thanks

On 6/18/07, Paul Scott <[EMAIL PROTECTED]> wrote:


On Mon, 2007-06-18 at 06:39 +0200, Paul Scott wrote:
> If you would like a more detailed HOWTO, please let me know, and I will
> write up something for you.

http://fsiu.uwc.ac.za/index.php?module=blog&action=viewsingle&postid=gen9Srv59Nme5_9262_1182142431&userid=3897070607

--Paul


All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm


--
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 script diagnostic app?

2007-06-17 Thread Paul Scott

On Mon, 2007-06-18 at 06:39 +0200, Paul Scott wrote:
> If you would like a more detailed HOWTO, please let me know, and I will
> write up something for you.

http://fsiu.uwc.ac.za/index.php?module=blog&action=viewsingle&postid=gen9Srv59Nme5_9262_1182142431&userid=3897070607

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm 

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

Re: [PHP] Php script diagnostic app?

2007-06-17 Thread Paul Scott

On Sun, 2007-06-17 at 13:53 -0400, Robert Cummings wrote:
> I believe there are profiling tools... probably from Zend. How big is

I prefer using XDEBUG, which is totally free. You can install it from
the pecl repositories: pecl install xdebug

Then, you simply install it as an extension on your development machine,
and execute your scripts. A really nice feature of xdebug is that not
only does it give you detailed stack traces and things when stuff goes
wrong, but you can also do really excellent (and graphical) profiling in
combination with cachegrind (I use KCacheGrind on Ubuntu), which uses
GraphViz to make very interesting graphs of what your code is doing.

If you would like a more detailed HOWTO, please let me know, and I will
write up something for you.

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm 

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

Re: [PHP] Php script diagnostic app?

2007-06-17 Thread Daniel Brown

On 6/17/07, Robert Cummings <[EMAIL PROTECTED]> wrote:

On Sun, 2007-06-17 at 13:35 -0400, MIKE YRABEDRA wrote:
>
> I was wondering if there was some kind of application that would process a
> php script, logging any functions (or classes) it encounters along the way.
> Logging times and memory use.
>
> I am trying to figure out what in a script slows it down so much.
>
> Any ideas?

I believe there are profiling tools... probably from Zend. How big is
your script? You might get away with using the microtime() function to
locate slow areas of code. Generally speaking I use it to binary
partition the code with echos of the current microtime() and narrow down
what I want to know.

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

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




   You could check out xdebug, which is a real-time processor.  I use
it on two of my servers, and I'm actually pretty pleased with it.  If
you have a bug in your code that's multiple-functions- and
several-include-files-deep, it does pretty well about telling which
function (called by which function, etc.) in which file (included by
which file, etc.) caused the exception.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Php script diagnostic app?

2007-06-17 Thread Robert Cummings
On Sun, 2007-06-17 at 13:35 -0400, MIKE YRABEDRA wrote:
> 
> I was wondering if there was some kind of application that would process a
> php script, logging any functions (or classes) it encounters along the way.
> Logging times and memory use.
> 
> I am trying to figure out what in a script slows it down so much.
> 
> Any ideas?

I believe there are profiling tools... probably from Zend. How big is
your script? You might get away with using the microtime() function to
locate slow areas of code. Generally speaking I use it to binary
partition the code with echos of the current microtime() and narrow down
what I want to know.

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

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



Re: [PHP] php script from bat file

2007-06-12 Thread Richard Lynch
php.exe expects a PHP script as an argument, usually.

You can run it interactively with -a or use -i to get phpinfo output
and so on, but php.exe with nothing at all will run and not do much of
anything.

On Tue, June 12, 2007 11:30 am, Bosky, Dave wrote:
> What's the syntax I need to use to execute a PHP script from a batch
> file?
>
>
>
> PHP is installed in 'C:\PHP' and the script I want to run is in
> 'C:\Inetpub\scripts\run.php'.
>
>
>
> I've created a Windows batch file which executes from the 'C:\PHP'
> directory and contains a single line 'php.exe
> C:\Inetpub\scripts\run.php'.
>
>
>
> It seems to run ok but nothing happens. Any ideas?
>
>
>
> Thanks,
>
> Dave
>
>
> **
> HTC Disclaimer:  The information contained in this message may be
> privileged and confidential and protected from disclosure. If the
> reader of this message is not the intended recipient, or an employee
> or agent responsible for delivering this message to the intended
> recipient, you are hereby notified that any dissemination,
> distribution or copying of this communication is strictly prohibited.
> If you have received this communication in error, please notify us
> immediately by replying to the message and deleting it from your
> computer.  Thank you.
> **
>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] php script from bat file

2007-06-12 Thread Tijnema

On 6/12/07, Bosky, Dave <[EMAIL PROTECTED]> wrote:

What's the syntax I need to use to execute a PHP script from a batch
file?



PHP is installed in 'C:\PHP' and the script I want to run is in
'C:\Inetpub\scripts\run.php'.



I've created a Windows batch file which executes from the 'C:\PHP'
directory and contains a single line 'php.exe
C:\Inetpub\scripts\run.php'.



It seems to run ok but nothing happens. Any ideas?



Thanks,

Dave



Try using the full path to the php.exe binary, I don't have PHP on
windows, but I guess it is
c:\PHP\bin\php.exe
in your example, so that would become
C:\PHP\bin\php.exe C:\Inetpub\scripts\run.php

Tijnema

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



RE: [PHP] php script from bat file

2007-06-12 Thread Jay Blanchard
[snip]
What's the syntax I need to use to execute a PHP script from a batch
file?

PHP is installed in 'C:\PHP' and the script I want to run is in
'C:\Inetpub\scripts\run.php'.

I've created a Windows batch file which executes from the 'C:\PHP'
directory and contains a single line 'php.exe
C:\Inetpub\scripts\run.php'.

It seems to run ok but nothing happens. Any ideas?
[/snip]

Is php.exe in your path? 

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



Re: [PHP] php script fails when run from cron

2006-05-04 Thread blackwater dev

I finally got it working and Chris was correct.  It appears that cron was
using the wrong php.  Pumping the errors of even logging them wouldn't have
helped as I was tweaking the ini for the php I thought it was using.  When I
explicitly tell it which one to use, it seems to work fine.

Thanks!

On 5/4/06, Jay Blanchard <[EMAIL PROTECTED]> wrote:


[snip]
The code then goes on to move some data from a remote SQL Server db to
the
local mysql.  When finished, the log stops at "got two classes".  I am
trying to debug now to see which of the two classes it seems to be
failing
on.  I don't have anything in the php error log.  The MSSQL connection
uses
freetds so I am not sure if it is something there but again this script
runs
fine with just php myfile.php.
[/snip]

Are you logging errors? If so you will likely locate the cause there. If
I were to hazard a guess at would be because include files are not
getting included as I have seen that behavior before.



RE: [PHP] php script fails when run from cron

2006-05-04 Thread Jay Blanchard
[snip]
The code then goes on to move some data from a remote SQL Server db to
the
local mysql.  When finished, the log stops at "got two classes".  I am
trying to debug now to see which of the two classes it seems to be
failing
on.  I don't have anything in the php error log.  The MSSQL connection
uses
freetds so I am not sure if it is something there but again this script
runs
fine with just php myfile.php.
[/snip]

Are you logging errors? If so you will likely locate the cause there. If
I were to hazard a guess at would be because include files are not
getting included as I have seen that behavior before.

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



Re: [PHP] php script fails when run from cron

2006-05-04 Thread Richard Lynch
It's remotely possible that your database classes are trying to create
temp files or cache files or something in the "current working
directory" which for cron would be...  The home directory of the user
running it???

I don't even know what it would be, but I know it can be problematic.

The cron job IS running as the same user as when you do it on
command-line right???

I mean, maybe freetds refuses to connect as 'root' user, and you put
the cron in as 'root'?

It's going to boil down to user/path/permissions, almost for sure.

On Wed, May 3, 2006 9:27 pm, blackwater dev wrote:
> I have a script which runs fine from the command line but when I try
> to run
> it via cron, it seems to fail when the db class is instatiated, here
> is some
> code:
>
> $yesterday  = date("Y-m-d",mktime(0, 0, 0, date("m")  , date("d")-1,
> date("Y")));
>  $file=fopen("/usr/local/apache2/htdocs/core/logs/import.log","a");
>  fwrite($file,"-DATE:".date("Y-m-d")."-\n");
>  fwrite($file,"Starting:".date("H:i:s")."\n");
>  include("/usr/local/apache2/htdocs/includes/lib/ms_db.class.php");
>  include("/usr/local/apache2/htdocs/includes/lib/database.php");
>  fwrite($file,"got two classes:".date("H:i:s")."\n");
>   $ms_sql= new ms_db();
>   $my_sql=new Database();
>
>  fwrite($file,"got 1:".date("H:i:s")."\n");
>
>
> The code then goes on to move some data from a remote SQL Server db to
> the
> local mysql.  When finished, the log stops at "got two classes".  I am
> trying to debug now to see which of the two classes it seems to be
> failing
> on.  I don't have anything in the php error log.  The MSSQL connection
> uses
> freetds so I am not sure if it is something there but again this
> script runs
> fine with just php myfile.php.
>
> Any ideas?
>
> Thanks!
>


-- 
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 script fails when run from cron

2006-05-03 Thread Chris

blackwater dev wrote:

Chris,

The double php thing is very likely as it is a box from my host and I 
installed php5 so I think php4 is on there somewhere as well without 
mssql support.


I am simply running it like
15 21 * * * php /usr/local/apache2/htdocs/import.php

How can I tell it which one to use?  I just have php5  loaded as a .so 
module in apache.


Always CC the list :)

Use the full path:

/path/to/right/php /usr/local/

if you do:

whereis php

it will show all versions (and directories like /usr/lib/php for 
example) which are in your path.


php -v

will help tell you which one is the right one.. if not:

php -i

and go through the output.


On 5/3/06, *Chris* < [EMAIL PROTECTED] > wrote:

blackwater dev wrote:
 > I have a script which runs fine from the command line but when I
try to run
 > it via cron, it seems to fail when the db class is instatiated,
here is
 > some
 > code:
 >
 > $yesterday  = date("Y-m-d",mktime(0, 0, 0, date("m")  , date("d")-1,
 > date("Y")));
 > $file=fopen("/usr/local/apache2/htdocs/core/logs/import.log","a");
 > fwrite($file,"-DATE:".date("Y-m-d")."-\n");
 > fwrite($file,"Starting:".date("H:i:s")."\n");
 > include("/usr/local/apache2/htdocs/includes/lib/ms_db.class.php");
 > include("/usr/local/apache2/htdocs/includes/lib/database.php");
 > fwrite($file,"got two classes:".date("H:i:s")."\n");
 >  $ms_sql= new ms_db();
 >  $my_sql=new Database();
 >
 > fwrite($file,"got 1:".date("H:i:s")."\n");
 >
 >
 > The code then goes on to move some data from a remote SQL Server
db to the
 > local mysql.  When finished, the log stops at "got two
classes".  I am
 > trying to debug now to see which of the two classes it seems to
be failing
 > on.  I don't have anything in the php error log.  The MSSQL
connection uses
 > freetds so I am not sure if it is something there but again this
script
 > runs
 > fine with just php myfile.php.

Do you have multiple php versions installed (one has freetds support,
one doesn't) ?

How are you running it from cron?

Maybe the cron job is picking up a different php?

Turn up error_reporting and see what messages you get..

--
Postgresql & php tutorials
http://www.designmagick.com/





--
Postgresql & php tutorials
http://www.designmagick.com/

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



Re: [PHP] php script fails when run from cron

2006-05-03 Thread Chris

blackwater dev wrote:

I have a script which runs fine from the command line but when I try to run
it via cron, it seems to fail when the db class is instatiated, here is 
some

code:

$yesterday  = date("Y-m-d",mktime(0, 0, 0, date("m")  , date("d")-1,
date("Y")));
$file=fopen("/usr/local/apache2/htdocs/core/logs/import.log","a");
fwrite($file,"-DATE:".date("Y-m-d")."-\n");
fwrite($file,"Starting:".date("H:i:s")."\n");
include("/usr/local/apache2/htdocs/includes/lib/ms_db.class.php");
include("/usr/local/apache2/htdocs/includes/lib/database.php");
fwrite($file,"got two classes:".date("H:i:s")."\n");
 $ms_sql= new ms_db();
 $my_sql=new Database();

fwrite($file,"got 1:".date("H:i:s")."\n");


The code then goes on to move some data from a remote SQL Server db to the
local mysql.  When finished, the log stops at "got two classes".  I am
trying to debug now to see which of the two classes it seems to be failing
on.  I don't have anything in the php error log.  The MSSQL connection uses
freetds so I am not sure if it is something there but again this script 
runs

fine with just php myfile.php.


Do you have multiple php versions installed (one has freetds support, 
one doesn't) ?


How are you running it from cron?

Maybe the cron job is picking up a different php?

Turn up error_reporting and see what messages you get..

--
Postgresql & php tutorials
http://www.designmagick.com/

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



Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-26 Thread Robert Cummings
On Wed, 2006-04-26 at 16:07, Jochem Maas wrote:
> Richard Lynch wrote:
> 
> ...
> 
> > A general Google for search terms likely to contain what you need. 
> > This often requires several tries and some finesse on input for terms
> > as common as "phpBB" and "forum" but an attempt must be made, even if
> > you're sure it will be fruitless...  Cuz Google is goddamned smart
> > sometimes. :-)
> 
> in the immortal words of the guy that got the whole php ball rolling:
>   "of course you should be using Yahoo!"

Words only last as long as the medium upon which they are encoded... and
that includes brains -- unless of course there is an afterlife, but
arguing unprovable ideas is as futile as me saying that I can fly, but
only when nothing is looking *haha*. Undoubtedly "immortal" is an
exaggeration. Additionally, one's ability to create and advance software
does not necessarily lend to ones advertising credibility -- especially
when one is affiliated with said product/service/company. You are
however quite welcome to grovel before anyone you please, whether they
want you to or not.

> > If we tried to answer all the questions for all the monstrosities of
> > software written in PHP (e.g. phpBB), we'd be in real trouble...
> > 
> > This list gets enough traffic as it is -- and some of that is
> > admittedly my fault :-)
> 
> only some heh? ;-)

Ahh but it's good traffic :)

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

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



Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-26 Thread Jochem Maas

Richard Lynch wrote:

...

A general Google for search terms likely to contain what you need. 
This often requires several tries and some finesse on input for terms

as common as "phpBB" and "forum" but an attempt must be made, even if
you're sure it will be fruitless...  Cuz Google is goddamned smart
sometimes. :-)


in the immortal words of the guy that got the whole php ball rolling:
"of course you should be using Yahoo!"



If we tried to answer all the questions for all the monstrosities of
software written in PHP (e.g. phpBB), we'd be in real trouble...

This list gets enough traffic as it is -- and some of that is
admittedly my fault :-)


only some heh? ;-)





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



Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-24 Thread Richard Lynch
On Sat, April 22, 2006 1:51 pm, Gerr D wrote:
> Richard,
>
> On 4/20/06, Richard Lynch <[EMAIL PROTECTED]> wrote:
>
>> Or perhaps you believe you have already completely mined out those
>> resources, and PHP-General was your last resort.
>>
>> Which is fine, but that should have been in your original post.
>
> Are you implying this list is intended to be a "last resort" resource?
> That seems a shame, considering the talent I've seen here.

I think this list should be a "last resort" for a phpBB question about
how to link phpBB authentication with another authentication system,
after:

Search phpBB sites for plug-ins and add-ons that expose an API to tie
phpBB authentication to any authentication

Research other common authentication packages for phpBB support, so
see if their code can be adapted for your own use.

Search phpBB forums / mailing lists and any support channels

A general Google for search terms likely to contain what you need. 
This often requires several tries and some finesse on input for terms
as common as "phpBB" and "forum" but an attempt must be made, even if
you're sure it will be fruitless...  Cuz Google is goddamned smart
sometimes. :-)

If we tried to answer all the questions for all the monstrosities of
software written in PHP (e.g. phpBB), we'd be in real trouble...

This list gets enough traffic as it is -- and some of that is
admittedly my fault :-)

-- 
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 Script to open phpBB2 accounts

2006-04-23 Thread Weber Sites LTD
I'm happy to say that the sites now work both ways.
A user opens an account on WeberDev and an account
Will be opened on WeberForums and vice versa.

A password or email update on one site will trigger
An update on the other.

The code for the accounts on phpBB2 are at :
http://www.weberdev.com/get_example-4383.html

Thanks
berber 

-Original Message-
From: Gerr D [mailto:[EMAIL PROTECTED] 
Sent: Saturday, April 22, 2006 8:51 PM
To: [EMAIL PROTECTED]
Cc: Weber Sites LTD; php-general@lists.php.net
Subject: Re: [PHP] PHP Script to open phpBB2 accounts

Richard,

On 4/20/06, Richard Lynch <[EMAIL PROTECTED]> wrote:

> Or perhaps you believe you have already completely mined out those 
> resources, and PHP-General was your last resort.
>
> Which is fine, but that should have been in your original post.

Are you implying this list is intended to be a "last resort" resource?
That seems a shame, considering the talent I've seen here.

> You cannot possibly be the first (or last) developer to want this 
> feature...

I would like it too. ;)

> I'm guessing that a lot of the noise here is that most posters firmly 
> believe that your phpBB solution is "out there" and you just need to 
> find it, somewhere in phpBB sites.

I'm guessing that most posters indeed believe that, because if you think
about it, it's logical and as such, someone would have already created a
solution. Yet believing that and sending someone off to go look "somewhere"
demonstrates that nobody has actually "seen" the solution... Otherwise why
not share it?

Gerry

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



Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-22 Thread Gerr D
Richard,

On 4/20/06, Richard Lynch <[EMAIL PROTECTED]> wrote:

> Or perhaps you believe you have already completely mined out those
> resources, and PHP-General was your last resort.
>
> Which is fine, but that should have been in your original post.

Are you implying this list is intended to be a "last resort" resource?
That seems a shame, considering the talent I've seen here.

> You cannot possibly be the first (or last) developer to want this
> feature...

I would like it too. ;)

> I'm guessing that a lot of the noise here is that most posters firmly
> believe that your phpBB solution is "out there" and you just need to
> find it, somewhere in phpBB sites.

I'm guessing that most posters indeed believe that, because if you
think about it, it's logical and as such, someone would have already
created a solution. Yet believing that and sending someone off to go
look "somewhere" demonstrates that nobody has actually "seen" the
solution... Otherwise why not share it?

Gerry

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



RE: [PHP] PHP Script to open phpBB2 accounts

2006-04-21 Thread Weber Sites LTD
No words... Just :) 

-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 21, 2006 2:48 AM
To: John Nichel
Cc: php-general@lists.php.net
Subject: Re: [PHP] PHP Script to open phpBB2 accounts

[some SERIOUS text-deleting happened here...]

On Thu, April 20, 2006 8:08 am, John Nichel wrote:
> Weber Sites LTD wrote:
>> I have been on this list since 1998. Looking at some of the

> '98
> you
> say?  Well, I don't remember you, but one would think being a part of

I do.

He posted an answer link for almost every question to weberdev almost as
often as Manuel posted an answer link to phpclasses.

:-) :-) :-)

Honestly, I think they're both fine sites that fulfill a need, and they both
backed off on the self-promotion posting as the sites matured, and that's a
fine thing.

And we ALL tend to get a bit trigger-happy on the RTFM and so forth,
especially after a nice big fire-storm like we've just had.  That's just how
it goes. Human nature. [shrug]

Disclaimer:
This post was just good-natured "ribbing"

I believe *I* may actually hold the Title to "Most OT/Bad Posts to
PHP-General" to this day. :-)

H.  Wonder if I could wrangle that into an all-expenses-covered Topic at
some PHP Conference.  Yeah, right. :-v

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



RE: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread Richard Lynch
On Thu, April 20, 2006 10:51 am, Weber Sites LTD wrote:
> As I said, I could but then I would be bypassing all of the phpBB
> logic
> And chances are that I may miss something.

Okay, try THIS tack:

Why don't you search the phpBB plug-ins pages/archives/solutions for
what you want?

That's your most likely source.

In fact, if it's not there, odds are really good nobody has what you
want ready for off-the-shelf use.

Or perhaps you believe you have already completely mined out those
resources, and PHP-General was your last resort.

Which is fine, but that should have been in your original post.

That probably would have avoided most of this thread...

You cannot possibly be the first (or last) developer to want this
feature...

I'm guessing that a lot of the noise here is that most posters firmly
believe that your phpBB solution is "out there" and you just need to
find it, somewhere in phpBB sites.

-- 
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 Script to open phpBB2 accounts

2006-04-20 Thread Richard Lynch
On Thu, April 20, 2006 9:25 am, Weber Sites LTD wrote:
> Notice that instead of helping, you too, are telling me
> to go look for a PHP script somewhere else than the
> PHP mailing list where so many php people that may
> Have used php to write this script are reading. Why
> Is that?

Because he honestly believe, as I do, that your odds of finding what
you want quickly and easily are approximately 1,254 times better on a
phpBB-specific forum than in this "General" list?

Try to take this viewpoint:
We are actually trying to help you.
You keep refusing to believe the answer everybody gives you.
Maybe, just maybe, they're right and you're wrong.
So...
Have you actively searched for what you want in the phpBB community?
Just try it.
Please.
Thanks.

-- 
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 Script to open phpBB2 accounts

2006-04-20 Thread Richard Lynch
[some SERIOUS text-deleting happened here...]

On Thu, April 20, 2006 8:08 am, John Nichel wrote:
> Weber Sites LTD wrote:
>> I have been on this list since 1998. Looking at some of the

> '98
> you
> say?  Well, I don't remember you, but one would think being a part of

I do.

He posted an answer link for almost every question to weberdev almost
as often as Manuel posted an answer link to phpclasses.

:-) :-) :-)

Honestly, I think they're both fine sites that fulfill a need, and
they both backed off on the self-promotion posting as the sites
matured, and that's a fine thing.

And we ALL tend to get a bit trigger-happy on the RTFM and so forth,
especially after a nice big fire-storm like we've just had.  That's
just how it goes. Human nature. [shrug]

Disclaimer:
This post was just good-natured "ribbing"

I believe *I* may actually hold the Title to "Most OT/Bad Posts to
PHP-General" to this day. :-)

H.  Wonder if I could wrangle that into an all-expenses-covered
Topic at some PHP Conference.  Yeah, right. :-v

-- 
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 Script to open phpBB2 accounts

2006-04-20 Thread Jochem Maas

[EMAIL PROTECTED] wrote:

The idea of creating a phpBB user when a weberdev one is created has merit, but 
I'm not sure I saw anyone recommend doing the opposite?

Since you have a fair idea of how weberdev creates users (since you created it) 
why not insert some PHP code into phpBB to create a weberdev account when 
someone creates a phpBB account?

Or is that not possible.


having read the whole thread I like to say:

1. we should be paying John Nichel for his comic input (aside from the fact 
that he
has lots of tips/advice/etc as well) - the man makes me laugh again and again
- and in this hectic world we work in that's a good thing.

2. for someone who has been on the list since 1998, taking a knife to phpBB
and integrating a 2-way synchronization wotsit between your user data and 
phpBB's
should be a piece of cake - maybe a big piece but cake none the less.

3. I do know of weberdev because it's often in the list of results when I 
search for
php related stuff - BUT I have also got to know that it's mainly full of 
beginner level
code/tips/etc, that's great for many people starting out in php but those of us 
on this
list who regularly post help/answers (& jokes ;-) it's not the kind of resource 
that of
any use - personally I aspire to write code on the level of people like Derick 
R., Chris S.,
Ilia A et al (to name a few) and not at the level of some kid who can barely 
find his way
to a search engine (that's not directed at you Berber, although there is one 
Indian chap
who is free to feel he is being implied ;-).

4. there is no spoon.



-TG

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



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



RE: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread Weber Sites LTD
It's possible and I may do that however, weberdev, by far
Has much more traffic so it's the side that I want to start
With.

Thanks
berber 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 20, 2006 6:25 PM
To: php-general@lists.php.net
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] PHP Script to open phpBB2 accounts

The idea of creating a phpBB user when a weberdev one is created has merit,
but I'm not sure I saw anyone recommend doing the opposite?

Since you have a fair idea of how weberdev creates users (since you created
it) why not insert some PHP code into phpBB to create a weberdev account
when someone creates a phpBB account?

Or is that not possible.

-TG

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

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

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



RE: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread tg-php
The idea of creating a phpBB user when a weberdev one is created has merit, but 
I'm not sure I saw anyone recommend doing the opposite?

Since you have a fair idea of how weberdev creates users (since you created it) 
why not insert some PHP code into phpBB to create a weberdev account when 
someone creates a phpBB account?

Or is that not possible.

-TG

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

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



RE: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread Jeremy Schreckhise
What's there to miss.  The create user logic is centralized and fairly easy
to follow.  If this is too hard for your current situation, you might just
want to pass your user information to the phpBB .php file that processes
user input.  Just another option.  

(I know these aren't the programs, nor the vars I'm just using this
as an example)
phpBB_create.php?user=webdevuser&pass=webdevuserpass

Of course you would do this programmatically with variables from your webdev
form.


Jeremy Schreckhise, M.B.A.


-Original Message-
From: Weber Sites LTD [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 20, 2006 10:51 AM
To: 'Jeremy Schreckhise'; 'John Nichel'; php-general@lists.php.net
Subject: RE: [PHP] PHP Script to open phpBB2 accounts

As I said, I could but then I would be bypassing all of the phpBB logic And
chances are that I may miss something. 

-Original Message-
From: Jeremy Schreckhise [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 20, 2006 4:34 PM
To: 'John Nichel'; php-general@lists.php.net
Subject: RE: [PHP] PHP Script to open phpBB2 accounts

Why couldn't you use your login (weberdev).  I.E. when a user creates an
account you also push this data onto the phpBB2 db.  Find where phpBB is
creating a user, analyze the encryption method use, modify your login to
create both entries.


Jeremy Schreckhise 

-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 20, 2006 9:11 AM
To: php-general@lists.php.net
Subject: Re: [PHP] PHP Script to open phpBB2 accounts

Weber Sites LTD wrote:
> Yes, both sites are on the same server but weberdev was built by me 
> And weberforums is phpBB2. No sense in writing my own forums application.
> 
> WeberDev is the main site and has it's own user base and phpBB2 is 
> Pretty complex and I didn't have the time to create a single logon. It 
> Will not be trivial and will need to be maintained with every phpBB2 
> Upgrade.
> 
> All I want is to open a phpBB account when someone opens one On 
> WeberDev.
> 
> I don't agree that php-general is the wrong place. I looked in the 
> phpBB forums for this and found something that doesn't currently Work.
> On this list there are many php developers that use phpBB So why not 
> ask them if anyone already did what I did.

Just looked?  You could have asked.  Wrong/right isn't the proper term. 
  phpBB forums are the *best* place to find answers about phpBB.

> It's not like I'm asking anyone to do the work for me. I devoted Years 
> of my time on WeberDev for the PHP community (it's my Hobby and not my 
> main workplace) and all I asked was to know If someone has created a 
> specific PHP script. Btw, I got several Off line emails asking me to 
> share the solution if I get it.
> 
> Anyway, instead of all of these emails, I'll try to do it myself And 
> hope someone contacts me soon.
> 

The solution is really quite simple.  You have two choices to maintain the
phpBB code base.  1)  Rewrite your login to use the phpBB user accounts, or
2)  keep both sets of user tables, and write a few functions to call both
the phpBB and your user handling code when they're needed.

--
John C. Nichel IV (is going to start plonking top posters) Programmer/System
Admin (ÜberGeek) Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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

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

--
PHP 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 Script to open phpBB2 accounts

2006-04-20 Thread Weber Sites LTD
As I said, I could but then I would be bypassing all of the phpBB logic
And chances are that I may miss something. 

-Original Message-
From: Jeremy Schreckhise [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 20, 2006 4:34 PM
To: 'John Nichel'; php-general@lists.php.net
Subject: RE: [PHP] PHP Script to open phpBB2 accounts

Why couldn't you use your login (weberdev).  I.E. when a user creates an
account you also push this data onto the phpBB2 db.  Find where phpBB is
creating a user, analyze the encryption method use, modify your login to
create both entries.


Jeremy Schreckhise 

-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 20, 2006 9:11 AM
To: php-general@lists.php.net
Subject: Re: [PHP] PHP Script to open phpBB2 accounts

Weber Sites LTD wrote:
> Yes, both sites are on the same server but weberdev was built by me 
> And weberforums is phpBB2. No sense in writing my own forums application.
> 
> WeberDev is the main site and has it's own user base and phpBB2 is 
> Pretty complex and I didn't have the time to create a single logon. It 
> Will not be trivial and will need to be maintained with every phpBB2 
> Upgrade.
> 
> All I want is to open a phpBB account when someone opens one On 
> WeberDev.
> 
> I don't agree that php-general is the wrong place. I looked in the 
> phpBB forums for this and found something that doesn't currently Work.
> On this list there are many php developers that use phpBB So why not 
> ask them if anyone already did what I did.

Just looked?  You could have asked.  Wrong/right isn't the proper term. 
  phpBB forums are the *best* place to find answers about phpBB.

> It's not like I'm asking anyone to do the work for me. I devoted Years 
> of my time on WeberDev for the PHP community (it's my Hobby and not my 
> main workplace) and all I asked was to know If someone has created a 
> specific PHP script. Btw, I got several Off line emails asking me to 
> share the solution if I get it.
> 
> Anyway, instead of all of these emails, I'll try to do it myself And 
> hope someone contacts me soon.
> 

The solution is really quite simple.  You have two choices to maintain the
phpBB code base.  1)  Rewrite your login to use the phpBB user accounts, or
2)  keep both sets of user tables, and write a few functions to call both
the phpBB and your user handling code when they're needed.

--
John C. Nichel IV (is going to start plonking top posters) Programmer/System
Admin (ÜberGeek) Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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

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

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



Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread John Nichel

Jeremy Schreckhise wrote:

Wasn't trying to steal anyone's thunder.  Created the response, went to
work, then sent it later.  Your response adequate and complete.  Sorry to
intrude.
 


Guess I should have added a ;)

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
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 Script to open phpBB2 accounts

2006-04-20 Thread Jeremy Schreckhise
Wasn't trying to steal anyone's thunder.  Created the response, went to
work, then sent it later.  Your response adequate and complete.  Sorry to
intrude.
 

Jeremy Schreckhise, M.B.A.

-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 20, 2006 9:37 AM
Cc: php-general@lists.php.net
Subject: Re: [PHP] PHP Script to open phpBB2 accounts

Jeremy Schreckhise wrote:
> Why couldn't you use your login (weberdev).  I.E. when a user creates 
> an account you also push this data onto the phpBB2 db.  Find where 
> phpBB is creating a user, analyze the encryption method use, modify 
> your login to create both entries.


Gee, I wish I would have said that.


> The solution is really quite simple.  You have two choices to maintain 
> the phpBB code base.  1)  Rewrite your login to use the phpBB user 
> accounts, or
> 2)  keep both sets of user tables, and write a few functions to call 
> both the phpBB and your user handling code when they're needed.
> 

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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

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




RE: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread Weber Sites LTD
Hi

My 1st thought was to look at the mysql query log and see what it takes
To create a user. After looking at the set of queries I understood that I
Didn't want to go directly to the DB and bypass the phpBB logic.

I managed to find a script that uses the minimum phpBB internal
functions to create a user. After some more fixing it actually
Opens a user so if anyone needs it :

http://www.weberdev.com/get_example-4383.html

I'm still working on it but the current version works.

Thanks.

berber



-Original Message-
From: Wolf [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 20, 2006 4:00 PM
To: Weber Sites LTD
Cc: 'Stut'; php-general@lists.php.net
Subject: Re: [PHP] PHP Script to open phpBB2 accounts

OK, so maybe this just seems moot, but...

Weber Sites LTD wrote:
> Yes, both sites are on the same server but weberdev was built by me 
> And weberforums is phpBB2. No sense in writing my own forums application.
Same server means you can look at the database

> WeberDev is the main site and has it's own user base and phpBB2 is 
> Pretty complex and I didn't have the time to create a single logon. It 
> Will not be trivial and will need to be maintained with every phpBB2 
> Upgrade.

Yeah, I don't see a problem with that one..

> All I want is to open a phpBB account when someone opens one On 
> WeberDev.

So, when you open a weberDev account, have your creation script go through
and load the phpBB Database set and run through the same user login
information, dumping it into the phpBB database fields itself.

frankly put, the install MySQL schema has:
# -- Users
INSERT INTO phpbb_users (user_id, username, user_level, user_regdate,
user_password, user_email, user_icq, user_website, user_occ, user_from,
user_interests, user_sig, user_viewemail, user_style, user_aim, user_yim,
user_msnm, user_posts, user_attachsig, user_allowsmile, user_allowhtml,
user_allowbbcode, user_allow_pm, user_notify_pm, user_allow_viewonline,
user_rank, user_avatar, user_lang, user_timezone, user_dateformat,
user_actkey, user_newpasswd, user_notify, user_active) VALUES ( -1,
'Anonymous', 0, 0, '', '', '', '', '', '', '', '', 0, NULL, '', '', '', 0,
0, 1, 1, 1, 0, 1, 1, NULL, '', '', 0, '', '', '', 0, 0);

# -- username: adminpassword: admin (change this or remove it once
everything is working!)
INSERT INTO phpbb_users (user_id, username, user_level, user_regdate,
user_password, user_email, user_icq, user_website, user_occ, user_from,
user_interests, user_sig, user_viewemail, user_style, user_aim, user_yim,
user_msnm, user_posts, user_attachsig, user_allowsmile, user_allowhtml,
user_allowbbcode, user_allow_pm, user_notify_pm, user_popup_pm,
user_allow_viewonline, user_rank, user_avatar, user_lang, user_timezone,
user_dateformat, user_actkey, user_newpasswd, user_notify, user_active)
VALUES ( 2, 'Admin', 1, 0, '21232f297a57a5a743894a0e4a801fc3',
'[EMAIL PROTECTED]', '', '', '', '', '', '', 1, 1, '', '', '', 1, 0, 1,
0, 1, 1, 1, 1, 1, 1, '', 'english', 0, 'd M Y h:i a', '', '', 0, 1);

So, using that information, make your weberdev connect to the phpBB database
(you have all that information already as you had to set it up), and use 1
script to make them both.

Wolf

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



Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread John Nichel

Jeremy Schreckhise wrote:

Why couldn't you use your login (weberdev).  I.E. when a user creates an
account you also push this data onto the phpBB2 db.  Find where phpBB is
creating a user, analyze the encryption method use, modify your login to
create both entries.



Gee, I wish I would have said that.



The solution is really quite simple.  You have two choices to maintain the
phpBB code base.  1)  Rewrite your login to use the phpBB user accounts, or
2)  keep both sets of user tables, and write a few functions to call both
the phpBB and your user handling code when they're needed.



--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
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 Script to open phpBB2 accounts

2006-04-20 Thread Jeremy Schreckhise
Why couldn't you use your login (weberdev).  I.E. when a user creates an
account you also push this data onto the phpBB2 db.  Find where phpBB is
creating a user, analyze the encryption method use, modify your login to
create both entries.


Jeremy Schreckhise 

-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 20, 2006 9:11 AM
To: php-general@lists.php.net
Subject: Re: [PHP] PHP Script to open phpBB2 accounts

Weber Sites LTD wrote:
> Yes, both sites are on the same server but weberdev was built by me 
> And weberforums is phpBB2. No sense in writing my own forums application.
> 
> WeberDev is the main site and has it's own user base and phpBB2 is 
> Pretty complex and I didn't have the time to create a single logon. It 
> Will not be trivial and will need to be maintained with every phpBB2 
> Upgrade.
> 
> All I want is to open a phpBB account when someone opens one On 
> WeberDev.
> 
> I don't agree that php-general is the wrong place. I looked in the 
> phpBB forums for this and found something that doesn't currently Work. 
> On this list there are many php developers that use phpBB So why not 
> ask them if anyone already did what I did.

Just looked?  You could have asked.  Wrong/right isn't the proper term. 
  phpBB forums are the *best* place to find answers about phpBB.

> It's not like I'm asking anyone to do the work for me. I devoted Years 
> of my time on WeberDev for the PHP community (it's my Hobby and not my 
> main workplace) and all I asked was to know If someone has created a 
> specific PHP script. Btw, I got several Off line emails asking me to 
> share the solution if I get it.
> 
> Anyway, instead of all of these emails, I'll try to do it myself And 
> hope someone contacts me soon.
> 

The solution is really quite simple.  You have two choices to maintain the
phpBB code base.  1)  Rewrite your login to use the phpBB user accounts, or
2)  keep both sets of user tables, and write a few functions to call both
the phpBB and your user handling code when they're needed.

-- 
John C. Nichel IV (is going to start plonking top posters)
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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

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



Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread John Nichel

Weber Sites LTD wrote:

Yes, both sites are on the same server but weberdev was built by me
And weberforums is phpBB2. No sense in writing my own forums application.

WeberDev is the main site and has it's own user base and phpBB2 is 
Pretty complex and I didn't have the time to create a single logon. It
Will not be trivial and will need to be maintained with every phpBB2 
Upgrade.


All I want is to open a phpBB account when someone opens one
On WeberDev.

I don't agree that php-general is the wrong place. I looked in the
phpBB forums for this and found something that doesn't currently
Work. On this list there are many php developers that use phpBB
So why not ask them if anyone already did what I did.


Just looked?  You could have asked.  Wrong/right isn't the proper term. 
 phpBB forums are the *best* place to find answers about phpBB.



It's not like I'm asking anyone to do the work for me. I devoted
Years of my time on WeberDev for the PHP community (it's my
Hobby and not my main workplace) and all I asked was to know
If someone has created a specific PHP script. Btw, I got several
Off line emails asking me to share the solution if I get it.

Anyway, instead of all of these emails, I'll try to do it myself
And hope someone contacts me soon.



The solution is really quite simple.  You have two choices to maintain 
the phpBB code base.  1)  Rewrite your login to use the phpBB user 
accounts, or 2)  keep both sets of user tables, and write a few 
functions to call both the phpBB and your user handling code when 
they're needed.


--
John C. Nichel IV (is going to start plonking top posters)
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
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 Script to open phpBB2 accounts

2006-04-20 Thread Wolf
OK, so maybe this just seems moot, but...

Weber Sites LTD wrote:
> Yes, both sites are on the same server but weberdev was built by me
> And weberforums is phpBB2. No sense in writing my own forums application.
Same server means you can look at the database

> WeberDev is the main site and has it's own user base and phpBB2 is 
> Pretty complex and I didn't have the time to create a single logon. It
> Will not be trivial and will need to be maintained with every phpBB2 
> Upgrade.

Yeah, I don't see a problem with that one..

> All I want is to open a phpBB account when someone opens one
> On WeberDev.

So, when you open a weberDev account, have your creation script go
through and load the phpBB Database set and run through the same user
login information, dumping it into the phpBB database fields itself.

frankly put, the install MySQL schema has:
# -- Users
INSERT INTO phpbb_users (user_id, username, user_level, user_regdate,
user_password, user_email, user_icq, user_website, user_occ, user_from,
user_interests, user_sig, user_viewemail, user_style, user_aim,
user_yim, user_msnm, user_posts, user_attachsig, user_allowsmile,
user_allowhtml, user_allowbbcode, user_allow_pm, user_notify_pm,
user_allow_viewonline, user_rank, user_avatar, user_lang, user_timezone,
user_dateformat, user_actkey, user_newpasswd, user_notify, user_active)
VALUES ( -1, 'Anonymous', 0, 0, '', '', '', '', '', '', '', '', 0, NULL,
'', '', '', 0, 0, 1, 1, 1, 0, 1, 1, NULL, '', '', 0, '', '', '', 0, 0);

# -- username: adminpassword: admin (change this or remove it once
everything is working!)
INSERT INTO phpbb_users (user_id, username, user_level, user_regdate,
user_password, user_email, user_icq, user_website, user_occ, user_from,
user_interests, user_sig, user_viewemail, user_style, user_aim,
user_yim, user_msnm, user_posts, user_attachsig, user_allowsmile,
user_allowhtml, user_allowbbcode, user_allow_pm, user_notify_pm,
user_popup_pm, user_allow_viewonline, user_rank, user_avatar, user_lang,
user_timezone, user_dateformat, user_actkey, user_newpasswd,
user_notify, user_active) VALUES ( 2, 'Admin', 1, 0,
'21232f297a57a5a743894a0e4a801fc3', '[EMAIL PROTECTED]', '', '', '',
'', '', '', 1, 1, '', '', '', 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, '',
'english', 0, 'd M Y h:i a', '', '', 0, 1);

So, using that information, make your weberdev connect to the phpBB
database (you have all that information already as you had to set it
up), and use 1 script to make them both.

Wolf

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



Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread John Nichel

Weber Sites LTD wrote:

Notice that instead of helping, you too, are telling me
to go look for a PHP script somewhere else than the
PHP mailing list where so many php people that may
Have used php to write this script are reading. Why
Is that?


Actually, saying to go look at the phpBB site/forums *is* helping.  Just 
because phpBB is written in php does not mean the php-general mailing 
list is the best place to find an answer.  If you have a specific 
issue/question about a specific application, where do you think is the 
best place to find an answer?  A forum which deals with the app your 
question is about, or a *general* mailing list?  But I shouldn't have to 
explain that to a 'long time' vet such as yourself, should I?


It's not about being overly sensitive, it's about 
The kind of answers that create a negative atmosphere.

If it's just me thinking like that... Forget it. But the
Answers I saw here lately are plain rude.


This list rude?  This has to be the tamest list I've ever seen.  Hell, 
go try USENET.



Btw, http://www.weberdev.com does that ring a bell?
Has been online since April 1998 holding tons
Of php material for anyone looking for it.



Nope, no bells what-so-ever.  But that doesn't mean anything...sites 
like that are all over the place, and quite honestly, I haven't gone 
looking for help sites in years.


BTW, please fix your clock.

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
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 Script to open phpBB2 accounts

2006-04-20 Thread Weber Sites LTD
Yes, both sites are on the same server but weberdev was built by me
And weberforums is phpBB2. No sense in writing my own forums application.

WeberDev is the main site and has it's own user base and phpBB2 is 
Pretty complex and I didn't have the time to create a single logon. It
Will not be trivial and will need to be maintained with every phpBB2 
Upgrade.

All I want is to open a phpBB account when someone opens one
On WeberDev.

I don't agree that php-general is the wrong place. I looked in the
phpBB forums for this and found something that doesn't currently
Work. On this list there are many php developers that use phpBB
So why not ask them if anyone already did what I did.

It's not like I'm asking anyone to do the work for me. I devoted
Years of my time on WeberDev for the PHP community (it's my
Hobby and not my main workplace) and all I asked was to know
If someone has created a specific PHP script. Btw, I got several
Off line emails asking me to share the solution if I get it.

Anyway, instead of all of these emails, I'll try to do it myself
And hope someone contacts me soon.

Thanks
berber

-Original Message-
From: Stut [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 20, 2006 3:12 PM
To: Weber Sites LTD
Cc: php-general@lists.php.net
Subject: Re: [PHP] PHP Script to open phpBB2 accounts

Weber Sites LTD wrote:

>Not exactly, we are talking about two different sites with two 
>different Databases. Each site has it's own userbase and authentication 
>will Still be against the respected DB. I just want the account to be 
>ready For the user if he already opened it.
>  
>

Are both sites on the same host using the same database server? If so why
cause the extra work or duplicating the login details?

>Obviously I can reverse engineer the phpBB2 code but that would be A 
>hard and long task since it's allot of code in allot of files.
>If I don't have any other option I will probably do it but isn't the 
>idea To reuse code? If someone already wrote a script that does exactly 
>That, and is willing to share it, it will save me much time I can spend 
>doing other things on WeberDev.com. There are thousands of code 
>Examples on WeberDev, and they save allot of time to allot of people.
>I was hoping someone could save me the time...
>  
>

That's fair enough, and I agree that code reuse is good - I publish a fair
amount myself. However, the correct place to ask for a solution to a
phpBB-specific problem would be the phpBB community not the general PHP
community. Or am I still high on "session"?

>Btw, did you mean "four spring duck technique" or "four sprung duck 
>technique" ?
>  
>

Either should work.

-Stut

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



Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread Stut

Weber Sites LTD wrote:


Notice that instead of helping, you too, are telling me
to go look for a PHP script somewhere else than the
PHP mailing list where so many php people that may
Have used php to write this script are reading. Why
Is that?
 



I can't speak for John, but I pointed you at the phpBB community because 
this is a *general* PHP mailing list. You are looking for *specific* 
help with a *specific* product built using PHP. You wouldn't ask Tarmac 
for help adding a window to a shed built on a Tarmac base would you?


-Stut

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



RE: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread Weber Sites LTD
Notice that instead of helping, you too, are telling me
to go look for a PHP script somewhere else than the
PHP mailing list where so many php people that may
Have used php to write this script are reading. Why
Is that?

It's not about being overly sensitive, it's about 
The kind of answers that create a negative atmosphere.
If it's just me thinking like that... Forget it. But the
Answers I saw here lately are plain rude.

Btw, http://www.weberdev.com does that ring a bell?
Has been online since April 1998 holding tons
Of php material for anyone looking for it.


berber

 

-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 20, 2006 3:08 PM
To: php-general@lists.php.net
Subject: Re: [PHP] PHP Script to open phpBB2 accounts

Weber Sites LTD wrote:
> Google was the 1st place I looked.

Maybe the phpBB site/forums would have been a better choice.

> I have been on this list since 1998. Looking at some of the answers on 
> this list lately it must be a real disappointment for many people. 
> There are many people that like to help but then there are those that 
> just love to open the joke threads.

Oh good lawd.  Has everyone gotten overly sensitive these days?  '98 you
say?  Well, I don't remember you, but one would think being a part of a
mailing list that long would have given you tougher skin (not to mention
avoiding top posting (flame away boys)).

> If everything is on Google, what do we need this list for?
> If you don't have anything better to write, why don't you Save us all 
> the BW? I can find cool jokes on Google too...
> 

Your time on the soapbox is up.

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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

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



Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread Stut

Weber Sites LTD wrote:


Not exactly, we are talking about two different sites with two different
Databases. Each site has it's own userbase and authentication will
Still be against the respected DB. I just want the account to be ready
For the user if he already opened it.
 



Are both sites on the same host using the same database server? If so 
why cause the extra work or duplicating the login details?



Obviously I can reverse engineer the phpBB2 code but that would be
A hard and long task since it's allot of code in allot of files.
If I don't have any other option I will probably do it but isn't the idea
To reuse code? If someone already wrote a script that does exactly
That, and is willing to share it, it will save me much time I can spend
doing other things on WeberDev.com. There are thousands of code
Examples on WeberDev, and they save allot of time to allot of people.
I was hoping someone could save me the time...
 



That's fair enough, and I agree that code reuse is good - I publish a 
fair amount myself. However, the correct place to ask for a solution to 
a phpBB-specific problem would be the phpBB community not the general 
PHP community. Or am I still high on "session"?



Btw, did you mean "four spring duck technique" or "four sprung duck
technique" ?
 



Either should work.

-Stut

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



Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread John Nichel

Weber Sites LTD wrote:

Google was the 1st place I looked.


Maybe the phpBB site/forums would have been a better choice.

I have been on this list since 1998. Looking at some of the 
answers on this list lately it must be a real disappointment for 
many people. There are many people that like to help but then 
there are those that just love to open the joke threads.


Oh good lawd.  Has everyone gotten overly sensitive these days?  '98 you 
say?  Well, I don't remember you, but one would think being a part of a 
mailing list that long would have given you tougher skin (not to mention 
avoiding top posting (flame away boys)).



If everything is on Google, what do we need this list for?
If you don't have anything better to write, why don't you
Save us all the BW? I can find cool jokes on Google too...



Your time on the soapbox is up.

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
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 Script to open phpBB2 accounts

2006-04-20 Thread Weber Sites LTD
Not exactly, we are talking about two different sites with two different
Databases. Each site has it's own userbase and authentication will
Still be against the respected DB. I just want the account to be ready
For the user if he already opened it.

Obviously I can reverse engineer the phpBB2 code but that would be
A hard and long task since it's allot of code in allot of files.

If I don't have any other option I will probably do it but isn't the idea
To reuse code? If someone already wrote a script that does exactly
That, and is willing to share it, it will save me much time I can spend
doing other things on WeberDev.com. There are thousands of code
Examples on WeberDev, and they save allot of time to allot of people.
I was hoping someone could save me the time...

Btw, did you mean "four spring duck technique" or "four sprung duck
technique" ?

Thanks
berber
-Original Message-
From: Stut [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 20, 2006 2:09 PM
To: Weber Sites LTD
Cc: [EMAIL PROTECTED]; php-general@lists.php.net
Subject: Re: [PHP] PHP Script to open phpBB2 accounts

Weber Sites LTD wrote:

>When you go to http://www.weberdev.com you need to create an account 
>For some of the options. IF you go to http://www.weberforums.com you 
>Need to create a 2nd account cause there is no connection between The 
>two sites.
>
>I'm looking for a script (I found something on phpbb.com but it's not 
>Working very well) that will save the users the need to open two 
>Account.
>  
>

Maybe I'm just feeling grumpy this morning, but the solution here seems
obvious and your approach to finding a solution seems wrong.

My solution would be... All user registrations end up in the phpBB database.
All user logins authenticate against said database.

My method for working our how would be... the phpBB code, seeing as how it
does this already, is an ideal place to look for the code required to do
this is it not? Additionally, failing that, surely their support resources
are probably a better place to seek help for this 'problem' 
than here. I'm sure they get this question regularly.

Oh, and if you want jokes, try Googling for "four spring duck technique".
Gave me a chuckly this morning.

Yours grumpily,
-Stut

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



Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread Stut

Weber Sites LTD wrote:


When you go to http://www.weberdev.com you need to create an account
For some of the options. IF you go to http://www.weberforums.com you
Need to create a 2nd account cause there is no connection between
The two sites.

I'm looking for a script (I found something on phpbb.com but it's not
Working very well) that will save the users the need to open two
Account.
 



Maybe I'm just feeling grumpy this morning, but the solution here seems 
obvious and your approach to finding a solution seems wrong.


My solution would be... All user registrations end up in the phpBB 
database. All user logins authenticate against said database.


My method for working our how would be... the phpBB code, seeing as how 
it does this already, is an ideal place to look for the code required to 
do this is it not? Additionally, failing that, surely their support 
resources are probably a better place to seek help for this 'problem' 
than here. I'm sure they get this question regularly.


Oh, and if you want jokes, try Googling for "four spring duck 
technique". Gave me a chuckly this morning.


Yours grumpily,
-Stut

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



RE: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread Weber Sites LTD
Google was the 1st place I looked.

I have been on this list since 1998. Looking at some of the 
answers on this list lately it must be a real disappointment for 
many people. There are many people that like to help but then 
there are those that just love to open the joke threads.

If everything is on Google, what do we need this list for?
If you don't have anything better to write, why don't you
Save us all the BW? I can find cool jokes on Google too...

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 19, 2006 9:39 PM
To: Weber Sites LTD; php-general@lists.php.net
Subject: RE: [PHP] PHP Script to open phpBB2 accounts

[snip]
I'm looking for a ready made php script that can open phpBB 2.0.20 accounts
By sending username, email and password.
{/snip]

I am looking for a good hearted woman who likes to dance. I used Google.

--
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 Script to open phpBB2 accounts

2006-04-20 Thread Weber Sites LTD
When you go to http://www.weberdev.com you need to create an account
For some of the options. IF you go to http://www.weberforums.com you
Need to create a 2nd account cause there is no connection between
The two sites.

I'm looking for a script (I found something on phpbb.com but it's not
Working very well) that will save the users the need to open two
Account.

Thanks. 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 19, 2006 9:41 PM
To: php-general@lists.php.net
Subject: Re: [PHP] PHP Script to open phpBB2 accounts

For the purpose of creating phpBB accounts?  As in, automated creation of
mass amounts of phpBB accounts maybe for the purpose of spamming phpBB's?

Just curious. Please clarify the need to automate creation of phpBB accounts
if that's what you're asking for.

-TG

= = = Original message = = =

I'm looking for a ready made php script that can open phpBB 2.0.20 accounts
By sending username, email and password.

NE!?

Thanks

berber


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

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

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



RE: [PHP] PHP Script to open phpBB2 accounts

2006-04-19 Thread Jay Blanchard
[snip]
How's it working for you?  I'm still waiting on the top 10 to finish the
questionnaire...
[/snip]
It is a little hit and miss, but that is the breaks.

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



Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-19 Thread Wolf
How's it working for you?  I'm still waiting on the top 10 to finish the
questionnaire...

Jay Blanchard wrote:
> [snip]
> I'm looking for a ready made php script that can open phpBB 2.0.20
> accounts
> By sending username, email and password.
> {/snip]
> 
> I am looking for a good hearted woman who likes to dance. I used Google.
> 

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



Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-19 Thread tg-php
Stut... how many of those have asked for your credit card number?

-TG

= = = Original message = = =

Jay Blanchard wrote:
> [snip]
> I'm looking for a ready made php script that can open phpBB 2.0.20
> accounts
> By sending username, email and password.
> /snip]
> 
> I am looking for a good hearted woman who likes to dance. I used Google.

How's that working out for ya? I'm on date 3 of the 3,130,000 results.

-Stut

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



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

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



Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-19 Thread Stut

Jay Blanchard wrote:

[snip]
I'm looking for a ready made php script that can open phpBB 2.0.20
accounts
By sending username, email and password.
{/snip]

I am looking for a good hearted woman who likes to dance. I used Google.


How's that working out for ya? I'm on date 3 of the 3,130,000 results.

-Stut

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



Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-19 Thread tg-php
For the purpose of creating phpBB accounts?  As in, automated creation of mass 
amounts of phpBB accounts maybe for the purpose of spamming phpBB's?

Just curious. Please clarify the need to automate creation of phpBB accounts if 
that's what you're asking for.

-TG

= = = Original message = = =

I'm looking for a ready made php script that can open phpBB 2.0.20 accounts
By sending username, email and password.

NE!?

Thanks

berber


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

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



RE: [PHP] PHP Script to open phpBB2 accounts

2006-04-19 Thread Jay Blanchard
[snip]
I'm looking for a ready made php script that can open phpBB 2.0.20
accounts
By sending username, email and password.
{/snip]

I am looking for a good hearted woman who likes to dance. I used Google.

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



RE: [PHP] PHP Script not sending email in WinME and PWS

2006-04-19 Thread Jay Blanchard
[snip]
...way too much crud...
[/snip]

A. I could never find a question.
2. That is way too much stuff to post through a mailing list. No one
will go through it.

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



RE: [PHP] Php Script Stumped!

2006-04-06 Thread Jim Moseby
> Hi.

Hi!

> doing this script for an assignment, and got it basically working.
> the only problems are:
>

Assignment, eh?  Generally, folks on the PHP list will not do your homework
for you.  But I'll offer some light nudges in the right direction for you.

> 
> 1. wen i load the user form, the focus goes to the login 
> button, and not the 
> first form field.
> did try putting one it, did not like it.
> so how do i do this?
> is there a basic dom example, how to set focus on a form 
> field, when the 
> form loads?

Not a PHP issue.  Hint: google "body onload"  Generally, you will give your
form a name and specify that name and the field name you want to have focus
in the  tag. using the "onload" directive.

> 2. got a user name and password.
> and enter username and password, and when the php script 
> loads, it shows the 
> user name and the password.
> want to hide this, and only have the message, now how do i 
> accomplish this?
> tried things on the web and tried on google, but could not 
> find any thing 
> for this.

PHP doesn't automatically display anything you don't ask it to display.
(Other than these occaisional 'error messages' some claim to see ;-) In your
code snippet, I happened to notice that you explicitly echo the username and
password.  I would say the fix for this is "don't do that".

> 3. and got to provide the time, but how do i format it say 
> for australian 
> east standard time?
> just got the standard time, and jaws reads it out, as one 
> line of text.

You can format dates and times any way you see fit. You can set timezones
how ever you want.  How? http://php.net/date would be a good place to start.
:-)

Happy coding!

JM

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



Re: [PHP] Php Script Stumped!

2006-04-06 Thread Brad Bonkoski

1. Look at this: http://javascript.internet.com/forms/form-focus.html

2. See Below

3. Take a look at this function: 
http://www.php.net/manual/en/function.date.php


-B

marvin hunkin wrote:


Hi.
doing this script for an assignment, and got it basically working.
the only problems are:


1. wen i load the user form, the focus goes to the login button, and 
not the first form field.

did try putting one it, did not like it.
so how do i do this?
is there a basic dom example, how to set focus on a form field, when 
the form loads?

2. got a user name and password.
and enter username and password, and when the php script loads, it 
shows the user name and the password.
want to hide this, and only have the message, now how do i accomplish 
this?
tried things on the web and tried on google, but could not find any 
thing for this.
3. and got to provide the time, but how do i format it say for 
australian east standard time?

just got the standard time, and jaws reads it out, as one line of text.
will paste the user form and php code.
if any one can offer code snippets, or point me to links, and 
examples, let me know.
sorry about this, but these are stumping me and banging my head up 
against the brick wall, so, would ask.

cheers Marvin.




User Form:



User Login Form



User Name:   
Password:   


I would make this: Password: name="password">
 -use the password 
input type^



 





Php Script:



Just say:
   $user = $_POST['username'];
   $pass = $_POST['password'];
echo "$user has successfully logged into the Tafe network. \n";
/* This will STORE your username/password instead of printing them out 
to the screen */
(Of course there are security considerations sending a clear text 
password accross page loads, but it may be outside the scope of the 
assignemnt)


echo "Marvin Hunkin has successfully logged into the Tafe network. 
\n";

echo "Please Wait ... Loading Your Personal Settings ... \n";
echo time();
?>but



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



Re: [PHP] php script running as a cgi

2006-01-16 Thread John Nichel

Weber Sites LTD wrote:

When running scripts in CGI mode you do not run them via your web server.
Why do you expect to find variables that come from the web?

I must be missing something.


You are.  I think you're confusing CGI with CLI.

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
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 script running as a cgi

2006-01-16 Thread Weber Sites LTD
When running scripts in CGI mode you do not run them via your web server.
Why do you expect to find variables that come from the web?

I must be missing something.

Sincerely 
 
berber 
 
Visit the Weber Sites Today, 
To see where PHP might take you tomorrow. 
PHP code examples : http://www.weberdev.com 
PHP Web Logs : http://www.weberblog.com/ 
PHP & MySQL Forums : http://www.weberforums.com/ 
Learn PHP Playing Trivia http://www.webertrivia.com 
Web Development Index http://www.weberindex.com 
Web Templates http://www.webertemplates.com
Search for PHP Code from your browser http://toolbar.weberdev.com 

 

-Original Message-
From: zedleon [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 16, 2006 5:33 PM
To: php-general@lists.php.net
Subject: [PHP] php script running as a cgi

I am running a php script as a cgi so to be able to run under my user name.
The script seems to be working except for one major problem.
the cgi script is not finding the variables passed by the html form...

Any suggestions on how to make this work?

Any help is greatly appreciated -

zed

--
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 script running as a cgi

2006-01-16 Thread David Grant
Hi,

zedleon wrote:
> I am running a php script as a cgi so to be able to run under my user name.
> The script seems to be working except for one major problem.
> the cgi script is not finding the variables passed by the html form...

How are you attempting to access them?

David
-- 
David Grant
http://www.grant.org.uk/

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



Re: [PHP] PHP script for removing/forwarding suspected spam from pop3 mailbox

2005-08-12 Thread Stephen Allen
On Thu, Aug 11, 2005 at 02:39:57PM +0100 or thereabouts, I. Gray wrote:
> Hi.
> 
> I'd like to find or write a script that I can run every so often (hourly 
> for example) from cron that will check my pop3 mailboxes for any emails 
> with SPAM in the subject line and either delete them or forward 
> them to another email address.  The best way would be to bundle all the 
> emails together and forward these as attachments to another email 
> address that I would use as spam.

Why use PHP for this, I would use procmail and filter at the tail of the
SpamAssassin rule.



signature.asc
Description: Digital signature


Re: [PHP] php script calling another one (on different machine), session variables

2005-08-01 Thread James

Thanks Rory:

I tried using fopen() and CURL and they both worked like a  charm!
No need to juggle redirects and session variables.


-James



At 9:21 PM +0200 8/1/05, Rory Browne wrote:

On 8/1/05, Jochem Maas <[EMAIL PROTECTED]> wrote:

 Rory Browne wrote:
 > On 8/1/05, James <[EMAIL PROTECTED]> wrote:

 ...

 >
 > Do the two machines share a common domain name? are your machines for
 > example boxa.commondomain.com and boxb.commondomain.com if so then you
 > can have the cookies(which hold the session tracking number) operate
 > at the commondomain.com level. All you have to do then is configure
 > one machine to get session files from the other.
 >
 > Otherwise you can use session.use_trans_sid and add the SID to the url
 > when you header("Location")
 >
 > In windows you could do this by setting up a share containing the
 > session files, and modding your php.ini file to reflect that the
 > session info is stored in this file.
 >
 > If you don't have admin access to your boxes, then you could write a
 > session handler on one of the systems to dl the necessary sesssion
 > info on demand. For more info see

 purely out of interest, see what? :-)


Sorry - but I thought someone of your experience Jochem would know :)

See: http://www.php.net/manual/en/function.session-set-save-handler.php




 >
 > Having that said, it seems to be a fairly common requirement - so
 > there may be a cleaner solution to the one I have outlined here. I've
 > just never needed it  - so therefore I've never come across it.
 >
 >
 >>
 >>--
 >>-James
 >>
 >>--
 >>PHP General Mailing List (http://www.php.net/)
 >>To unsubscribe, visit: http://www.php.net/unsub.php
 >>
 >>
 >
 >





--
-James

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



Re: [PHP] php script calling another one (on different machine), session variables

2005-08-01 Thread Jochem Maas

Rory Browne wrote:

...



If you don't have admin access to your boxes, then you could write a
session handler on one of the systems to dl the necessary sesssion
info on demand. For more info see


purely out of interest, see what? :-)



Sorry - but I thought someone of your experience Jochem would know :)


experience? me? only the bad kind ;-)



See: http://www.php.net/manual/en/function.session-set-save-handler.php


ah, righty ho. that does look familiar - I just assumed that you were pointing
to some resource/article elsewhere than php.net - didn't cross my mind that you 
might
just have been pointing to OP to the most natural place to start reading about 
sessions
(or anything php for that matter) - which is why I asked, you never you when 
you can learn
something new! :-)

that said I have always been satisfied with the default session handler (and 
given that
(nearly) all my work is published either on my 'own' server (not really mine 
but I have
full control and there are no 'anon' 3rd party running stuff) or on dedicated 
servers belonging
to clients I don't have to worry about all the potential security risks 
involved with (badly setup?)
shared hosting environments. for that reason (and lack of time) I have never 
really dived deep
into to the possibilities of custom session handlers (I have used some 3rd 
party code once that
used a mysql DB to store the session data which was a quite simple affair - 
such a setup would
allow sharing of sessions accross various boxes asumming a shared base 
domain)

rgds,
jochem







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



Re: [PHP] php script calling another one (on different machine), session variables

2005-08-01 Thread Rory Browne
On 8/1/05, Jochem Maas <[EMAIL PROTECTED]> wrote:
> Rory Browne wrote:
> > On 8/1/05, James <[EMAIL PROTECTED]> wrote:
> 
> ...
> 
> >
> > Do the two machines share a common domain name? are your machines for
> > example boxa.commondomain.com and boxb.commondomain.com if so then you
> > can have the cookies(which hold the session tracking number) operate
> > at the commondomain.com level. All you have to do then is configure
> > one machine to get session files from the other.
> >
> > Otherwise you can use session.use_trans_sid and add the SID to the url
> > when you header("Location")
> >
> > In windows you could do this by setting up a share containing the
> > session files, and modding your php.ini file to reflect that the
> > session info is stored in this file.
> >
> > If you don't have admin access to your boxes, then you could write a
> > session handler on one of the systems to dl the necessary sesssion
> > info on demand. For more info see
> 
> purely out of interest, see what? :-)

Sorry - but I thought someone of your experience Jochem would know :)

See: http://www.php.net/manual/en/function.session-set-save-handler.php


> 
> >
> > Having that said, it seems to be a fairly common requirement - so
> > there may be a cleaner solution to the one I have outlined here. I've
> > just never needed it  - so therefore I've never come across it.
> >
> >
> >>
> >>--
> >>-James
> >>
> >>--
> >>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



  1   2   >