php-general Digest 22 Aug 2006 00:17:06 -0000 Issue 4306

Topics (messages 240943 through 240974):

setting a session with a text link?
        240943 by: Ross
        240949 by: Ivo F.A.C. Fokkema
        240952 by: Richard Lynch
        240955 by: Ross
        240956 by: Richard Lynch

Re: stupid compile problem... additional ini files not found
        240944 by: John Nichel
        240945 by: Jochem Maas
        240953 by: Richard Lynch
        240965 by: Jochem Maas

Re: Recommendations for PHP debuggers?
        240946 by: Larry Garfield
        240948 by: Colin Guthrie
        240951 by: Dan McCullough
        240974 by: Yann Larrivee

[SOLVED - THE REDHAT WAY] Re: [PHP] stupid compile problem... additional ini 
files not found
        240947 by: Jochem Maas

Re: Regex
        240950 by: Ivo F.A.C. Fokkema
        240954 by: Richard Lynch
        240970 by: M. Sokolewicz
        240971 by: Dave Goodchild
        240972 by: Alex Turner
        240973 by: J R

Re: syntax error help
        240957 by: Richard Lynch

Re: dynamic variable usage
        240958 by: Richard Lynch

Re: OT alternate website authentication methods
        240959 by: Richard Lynch

Re: number list
        240960 by: Richard Lynch

preg_match problem
        240961 by: afan.afan.net
        240962 by: Dave Goodchild
        240963 by: Alex Turner
        240964 by: Alex Turner
        240966 by: afan.afan.net
        240968 by: Jochem Maas

Re: Shopping cart
        240967 by: Gerry D

Re: [css-d] Where CSS, XHTML and Javascript meet
        240969 by: Kevin Murphy

Administrivia:

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

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

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
I want to set a session with a text link, am having problems with the 
syntax. The link swiches the session to on or off.


<a href="" class="link_text">swtich off</a>
href="" class="link_text">swtich on</a>

I want to do this but the syntax is incorrect.

<?=$_SERVER['PHP_SELF']?$_SESSION['switch]='0'; ?>
<?=$_SERVER['PHP_SELF']?$_SESSION['switch]='1'; ?>

what is the correct syntax for this line?


Ross 

--- End Message ---
--- Begin Message ---
On Mon, 21 Aug 2006 13:08:04 +0100, Ross wrote:

> I want to set a session with a text link, am having problems with the 
> syntax. The link swiches the session to on or off.
> 
> 
> <a href="" class="link_text">swtich off</a>
> href="" class="link_text">swtich on</a>
> 
> I want to do this but the syntax is incorrect.
> 
> <?=$_SERVER['PHP_SELF']?$_SESSION['switch]='0'; ?>
> <?=$_SERVER['PHP_SELF']?$_SESSION['switch]='1'; ?>
> 
> what is the correct syntax for this line?

I am not too sure on what you're trying to do... but maybe this helps?
// Untested code!

<?php
print('<A href="' . $_SERVER['PHP_SELF'] . '?switch=on">Switch on</A><BR>
      '<A href="' . $_SERVER['PHP_SELF'] . '?switch=off">Switch off</A><BR>');

if (isset($_GET['switch'])) {
    // Set switch, as requested.
    $_SESSION['switch'] = ($_GET['switch'] == 'on'? 1 : 0);
}
?>

Hope this helps anything...

Ivo

--- End Message ---
--- Begin Message ---
On Mon, August 21, 2006 7:08 am, Ross wrote:
> I want to set a session with a text link, am having problems with the
> syntax. The link swiches the session to on or off.
>
>
> <a href="" class="link_text">swtich off</a>
> href="" class="link_text">swtich on</a>
>
> I want to do this but the syntax is incorrect.
>
> <?=$_SERVER['PHP_SELF']?$_SESSION['switch]='0'; ?>
> <?=$_SERVER['PHP_SELF']?$_SESSION['switch]='1'; ?>
>
> what is the correct syntax for this line?

something like...

<?php
  $session_switch = isset($_GET['session_switch']) ?
$_GET['session_switch'] : 1;
  $session_switch = (int) $session_switch;
  if ($session_switch){
    session_start();
  }
?>
<a href="<?php echo $_SERVER['PHP_SELF'];?>?session_switch=0">off</a>
<a href="<?php echo $_SERVER['PHP_SELF'];?>?session_switch=1">on</a>


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

--- End Message ---
--- Begin Message ---
That is it but can I not set the session variable directly from the link? 
Something like..

print('<A href="' . $_SERVER['PHP_SELF'] . '?$_SESSION['switch=on']">Switch 
on</A><BR>

""Ivo F.A.C. Fokkema"" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> On Mon, 21 Aug 2006 13:08:04 +0100, Ross wrote:
>
>> I want to set a session with a text link, am having problems with the
>> syntax. The link swiches the session to on or off.
>>
>>
>> <a href="" class="link_text">swtich off</a>
>> href="" class="link_text">swtich on</a>
>>
>> I want to do this but the syntax is incorrect.
>>
>> <?=$_SERVER['PHP_SELF']?$_SESSION['switch]='0'; ?>
>> <?=$_SERVER['PHP_SELF']?$_SESSION['switch]='1'; ?>
>>
>> what is the correct syntax for this line?
>
> I am not too sure on what you're trying to do... but maybe this helps?
> // Untested code!
>
> <?php
> print('<A href="' . $_SERVER['PHP_SELF'] . '?switch=on">Switch on</A><BR>
>      '<A href="' . $_SERVER['PHP_SELF'] . '?switch=off">Switch 
> off</A><BR>');
>
> if (isset($_GET['switch'])) {
>    // Set switch, as requested.
>    $_SESSION['switch'] = ($_GET['switch'] == 'on'? 1 : 0);
> }
> ?>
>
> Hope this helps anything...
>
> Ivo 

--- End Message ---
--- Begin Message ---
<a href="<?php echo $_SERVER['PHP_SELF']?>?_SESSION[switch]=0">off</a>

This *might* work, if you have session.auto_start set to ON, so that
the session is started before PHP processes the URL, and if you have
register_globals set to "ON"

But I doubt it, as that would be horrible security, because you really
do not want to allow users to pollute your $_SESSION data.

Plus, of course, if you're trying to get sessions turned on/off from
this, you'll have the session auto_start and then turn it off and
destroy it within the script if they ask for it to be off, rather than
have it actually not be turned on in the first place.

Work through what happens with your link and the session
construction/tear-down in slow-motion to see why you can't really do
this the simplistic way you are trying.

On Mon, August 21, 2006 11:01 am, Ross wrote:
> That is it but can I not set the session variable directly from the
> link?
> Something like..
>
> print('<A href="' . $_SERVER['PHP_SELF'] .
> '?$_SESSION['switch=on']">Switch
> on</A><BR>
>
> ""Ivo F.A.C. Fokkema"" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> On Mon, 21 Aug 2006 13:08:04 +0100, Ross wrote:
>>
>>> I want to set a session with a text link, am having problems with
>>> the
>>> syntax. The link swiches the session to on or off.
>>>
>>>
>>> <a href="" class="link_text">swtich off</a>
>>> href="" class="link_text">swtich on</a>
>>>
>>> I want to do this but the syntax is incorrect.
>>>
>>> <?=$_SERVER['PHP_SELF']?$_SESSION['switch]='0'; ?>
>>> <?=$_SERVER['PHP_SELF']?$_SESSION['switch]='1'; ?>
>>>
>>> what is the correct syntax for this line?
>>
>> I am not too sure on what you're trying to do... but maybe this
>> helps?
>> // Untested code!
>>
>> <?php
>> print('<A href="' . $_SERVER['PHP_SELF'] . '?switch=on">Switch
>> on</A><BR>
>>      '<A href="' . $_SERVER['PHP_SELF'] . '?switch=off">Switch
>> off</A><BR>');
>>
>> if (isset($_GET['switch'])) {
>>    // Set switch, as requested.
>>    $_SESSION['switch'] = ($_GET['switch'] == 'on'? 1 : 0);
>> }
>> ?>
>>
>> Hope this helps anything...
>>
>> Ivo
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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

--- End Message ---
--- Begin Message ---
Jochem Maas wrote:
hi people,

anyone know why my additional ini files are being ignored.

I've just built php5.1.1
the configure line is:

'./configure' '--with-interbase=shared,/opt/firebird' 
'--with-apxs2=/usr/sbin/apxs' '--with-gd=shared' '--with-zlib-dir'
'--with-jpeg-dir' '--with-config-file-scan-dir=/etc/php.d' '--with-mm=/usr'

the dir [that php is configured to look in for additional ini files] exists:

# ls -lart /etc/php.d/
total 32
-rw-r--r--  1 root root   375 Aug 21 12:42 interbase.ini
-rw-r--r--  1 root root    51 Aug 21 12:42 gd.ini
-rw-r--r--  1 root root  1130 Aug 21 12:42 apc.ini
drwxr-xr-x  2 root root  4096 Aug 21 12:45 .
drwxr-xr-x 91 root root 12288 Aug 21 13:20 ..

YET, doing a 'php -i' shows that no files were read from that dir:

<SNIP>
PHP Version => 5.1.1
System => Linux testserver.dynabyte.nl 2.6.15-1.2054_FC5 #1 Tue Mar 14 15:48:33 
EST 2006 i686
Build Date => Aug 21 2006 13:43:09
Configure Command =>  './configure' '--with-interbase=shared,/opt/firebird' 
'--with-apxs2=/usr/sbin/apxs'
'--with-gd=shared' '--with-zlib-dir' '--with-jpeg-dir' 
'--with-config-file-scan-dir=/etc/php.d' '--with-mm=/usr'
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /etc/php.ini
Scan this dir for additional .ini files => /etc/php.d
PHP API => 20041225
</SNIP>

the following line should be part of the snippet just above the last line (PHP 
API):

additional .ini files parsed => /etc/php.d/apc.ini, /etc/php.d/gd.ini, 
/etc/php.d/interbase.ini


any takers?


For shits and giggles, does 'other' have execute permission on the directory /etc/php.d? Anything in the Apache error log at start-up?

--
By-Tor.com
...it's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message ---
John Nichel wrote:
> Jochem Maas wrote:
>> hi people,
>>
>> anyone know why my additional ini files are being ignored.
>>
>> I've just built php5.1.1
>> the configure line is:
>>
>> './configure' '--with-interbase=shared,/opt/firebird'
>> '--with-apxs2=/usr/sbin/apxs' '--with-gd=shared' '--with-zlib-dir'
>> '--with-jpeg-dir' '--with-config-file-scan-dir=/etc/php.d'
>> '--with-mm=/usr'
>>
>> the dir [that php is configured to look in for additional ini files]
>> exists:
>>
>> # ls -lart /etc/php.d/
>> total 32
>> -rw-r--r--  1 root root   375 Aug 21 12:42 interbase.ini
>> -rw-r--r--  1 root root    51 Aug 21 12:42 gd.ini
>> -rw-r--r--  1 root root  1130 Aug 21 12:42 apc.ini
>> drwxr-xr-x  2 root root  4096 Aug 21 12:45 .
>> drwxr-xr-x 91 root root 12288 Aug 21 13:20 ..

            ^...........................

> 
> For shits and giggles, does 'other' have execute permission on the
> directory /etc/php.d?  Anything in the Apache error log at start-up?
> 

.......................... 'other' seem to have execute perms on that dir (and 
read
perms on the files in it); apache error log contains plenty, unfortunately 
nothing related
to this. :-/

--- End Message ---
--- Begin Message ---
Are /etc and /etc/php.d set to be executable by the PHP user?...

Though I *thought* the files were getting read by root at Apache
startup, so that shouldn't matter...

Did you remember to restart Apache?

Are you 100% sure your apache restart script didn't fail to kill/start
it?...  I spent most of a day once using a badly-written apache
startup script that never actually killed Apache... :-(

On Mon, August 21, 2006 6:58 am, Jochem Maas wrote:
> hi people,
>
> anyone know why my additional ini files are being ignored.
>
> I've just built php5.1.1
> the configure line is:
>
> './configure' '--with-interbase=shared,/opt/firebird'
> '--with-apxs2=/usr/sbin/apxs' '--with-gd=shared' '--with-zlib-dir'
> '--with-jpeg-dir' '--with-config-file-scan-dir=/etc/php.d'
> '--with-mm=/usr'
>
> the dir [that php is configured to look in for additional ini files]
> exists:
>
> # ls -lart /etc/php.d/
> total 32
> -rw-r--r--  1 root root   375 Aug 21 12:42 interbase.ini
> -rw-r--r--  1 root root    51 Aug 21 12:42 gd.ini
> -rw-r--r--  1 root root  1130 Aug 21 12:42 apc.ini
> drwxr-xr-x  2 root root  4096 Aug 21 12:45 .
> drwxr-xr-x 91 root root 12288 Aug 21 13:20 ..
>
> YET, doing a 'php -i' shows that no files were read from that dir:
>
> <SNIP>
> PHP Version => 5.1.1
> System => Linux testserver.dynabyte.nl 2.6.15-1.2054_FC5 #1 Tue Mar 14
> 15:48:33 EST 2006 i686
> Build Date => Aug 21 2006 13:43:09
> Configure Command =>  './configure'
> '--with-interbase=shared,/opt/firebird' '--with-apxs2=/usr/sbin/apxs'
> '--with-gd=shared' '--with-zlib-dir' '--with-jpeg-dir'
> '--with-config-file-scan-dir=/etc/php.d' '--with-mm=/usr'
> Server API => Command Line Interface
> Virtual Directory Support => disabled
> Configuration File (php.ini) Path => /etc/php.ini
> Scan this dir for additional .ini files => /etc/php.d
> PHP API => 20041225
> </SNIP>
>
> the following line should be part of the snippet just above the last
> line (PHP API):
>
> additional .ini files parsed => /etc/php.d/apc.ini, /etc/php.d/gd.ini,
> /etc/php.d/interbase.ini
>
>
> any takers?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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

--- End Message ---
--- Begin Message ---
hi Richard,

Richard Lynch wrote:
> Are /etc and /etc/php.d set to be executable by the PHP user?...

read and execute bit is on for everyone on those dirs.

> 
> Though I *thought* the files were getting read by root at Apache
> startup, so that shouldn't matter...
> 
> Did you remember to restart Apache?

yup.

> 
> Are you 100% sure your apache restart script didn't fail to kill/start
> it?...  I spent most of a day once using a badly-written apache
> startup script that never actually killed Apache... :-(
> 

I have had similar tribulations ... but today restarts were working,
other httpd.conf changes were showing up.

besides I was testing the CLI and the apache module and both had the
same problem.

weird huh!
anyway thanks for your input.

> On Mon, August 21, 2006 6:58 am, Jochem Maas wrote:
>> hi people,
>>
>> anyone know why my additional ini files are being ignored.
>>
>> I've just built php5.1.1
>> the configure line is:
>>
>> './configure' '--with-interbase=shared,/opt/firebird'
>> '--with-apxs2=/usr/sbin/apxs' '--with-gd=shared' '--with-zlib-dir'
>> '--with-jpeg-dir' '--with-config-file-scan-dir=/etc/php.d'
>> '--with-mm=/usr'
>>
>> the dir [that php is configured to look in for additional ini files]
>> exists:
>>
>> # ls -lart /etc/php.d/
>> total 32
>> -rw-r--r--  1 root root   375 Aug 21 12:42 interbase.ini
>> -rw-r--r--  1 root root    51 Aug 21 12:42 gd.ini
>> -rw-r--r--  1 root root  1130 Aug 21 12:42 apc.ini
>> drwxr-xr-x  2 root root  4096 Aug 21 12:45 .
>> drwxr-xr-x 91 root root 12288 Aug 21 13:20 ..
>>
>> YET, doing a 'php -i' shows that no files were read from that dir:
>>
>> <SNIP>
>> PHP Version => 5.1.1
>> System => Linux testserver.dynabyte.nl 2.6.15-1.2054_FC5 #1 Tue Mar 14
>> 15:48:33 EST 2006 i686
>> Build Date => Aug 21 2006 13:43:09
>> Configure Command =>  './configure'
>> '--with-interbase=shared,/opt/firebird' '--with-apxs2=/usr/sbin/apxs'
>> '--with-gd=shared' '--with-zlib-dir' '--with-jpeg-dir'
>> '--with-config-file-scan-dir=/etc/php.d' '--with-mm=/usr'
>> Server API => Command Line Interface
>> Virtual Directory Support => disabled
>> Configuration File (php.ini) Path => /etc/php.ini
>> Scan this dir for additional .ini files => /etc/php.d
>> PHP API => 20041225
>> </SNIP>
>>
>> the following line should be part of the snippet just above the last
>> line (PHP API):
>>
>> additional .ini files parsed => /etc/php.d/apc.ini, /etc/php.d/gd.ini,
>> /etc/php.d/interbase.ini
>>
>>
>> any takers?
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
> 
> 

--- End Message ---
--- Begin Message ---
I use the Zend IDE at work, and honestly I love just about everything about it 
except the price.  The setup can be tricky, but I'm an IT guy so it didn't 
take weeks, just an hour or two with our company server. :-)  

Having used both the real time debugger and print-method (sometimes fancily 
called instrumentation), I can say that both are useful, and both are 
different things.  I currently have hefty debugging facilities built into the 
CMS at work for print-style debugging, in addition to making heavy use of the 
real time debugger in Zend.

I'm watching this thread closely myself, as I'd love something to use at home 
(on Linux) that doesn't cost what Zend does. :-)  Currently I use PHPeclipse, 
but it is frankly not that good (the code assistance feature is rudimentary 
at best), and I've not setup the debugger yet.  That, and Eclipse itself is 
just a dog slow memory hog.  

On Monday 21 August 2006 01:47, Dave M G wrote:
> Paul, Robert,
>
> Thank you for replying and for your recomendations.
>
> While looking into PHP debuggers, I've often come across mention of
> simply using functions like var_dump() and print_r().
>
> But unless I misunderstand the concept, one has to be always writing
> these commands into the code, see what they do, and then take them out
> again when you actually want the code to run as you intend it to be seen.
>
> And I don't see how you can do things like watch variables or set break
> points. Again, unless I don't see it, to watch a variable through many
> steps of a script, you'd have to place a var_dump() at each juncture,
> run the whole script, and pick through the output afterwards. If you
> have arrays which many elements - $_SERVER usually has about 30 or more
> - that could be quite a lot of text dumped to the screen.
>
> While I can see that this approach would work, it also seems to me to
> involve much more manual labour.
>
> In the end, it may just be a personal thing. I'm much more of a graphics
> guy who wants to do some more stuff with his web pages than a hard core
> coder. I prefer a more GUI approach to development.
>
> Zend didn't really wow me. It took weeks of back and forth with their
> support to finally get it up to speed. I'll give them credit for having
> very friendly and responsive support staff. But I would have much rather
> not needed to use their support so much.
>
> But I'd rather that then have to have to build my own set of error
> handlers, which would themselves need constant tweaking, especially as
> I'm a newbie.
>
> --
> Dave M G
> Ubuntu 6.06 LTS
> Kernel 2.6.17.7
> Pentium D Dual Core Processor
> PHP 5, MySQL 5, Apache 2

-- 
Larry Garfield                  AIM: LOLG42
[EMAIL PROTECTED]               ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

--- End Message ---
--- Begin Message ---
Larry Garfield wrote:
I'm watching this thread closely myself, as I'd love something to use at home (on Linux) that doesn't cost what Zend does. :-) Currently I use PHPeclipse, but it is frankly not that good (the code assistance feature is rudimentary at best), and I've not setup the debugger yet. That, and Eclipse itself is just a dog slow memory hog.

Did you look at this? I posted it earlier and although I've not hooked up the debugger, AFAIK it's free (but provided by Zend), so it should suit you nicely (except that you'll still need that extra gig of ram to run eclipse ;))

http://www.zend.com/phpide/

--- End Message ---
--- Begin Message ---
How is this different then what they try and sell you for $249.  I
have eclipse for Java development, and was looking at Zends package
for PHP development, but if they are basically selling me the same
thing then I would go with eclipse.

On 8/21/06, Colin Guthrie <[EMAIL PROTECTED]> wrote:
Larry Garfield wrote:
> I'm watching this thread closely myself, as I'd love something to use at home
> (on Linux) that doesn't cost what Zend does. :-)  Currently I use PHPeclipse,
> but it is frankly not that good (the code assistance feature is rudimentary
> at best), and I've not setup the debugger yet.  That, and Eclipse itself is
> just a dog slow memory hog.

Did you look at this? I posted it earlier and although I've not hooked
up the debugger, AFAIK it's free (but provided by Zend), so it should
suit you nicely (except that you'll still need that extra gig of ram to
run eclipse ;))

http://www.zend.com/phpide/

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



--- End Message ---
--- Begin Message ---
Hello,

Just use xdebug
www.xdebug.org

It's nice,  and IDE independant.
It also generate code profile (in case you need to optimise)

Has far has IDE wise. I know Komodo use xdebug for it's debugger and code step 
trough, so it must be good.

If you have more questions  regarding xdebug let me know. I will try to 
answer.

Cheers.
Yann

On Sunday 20 August 2006 23:55, Dave M G wrote:
> PHP List,
>
> For the last month I have been using Zend Studio and Zend Platform on
> the one month trial period. It works well enough that I was considering
> purchasing it.
>
> But it's only now that I realize that the one feature that makes it
> worthwhile for me, the "debug server" option, is only available in the
> professional edition.
>
> I'm just a lone PHP programmer doing web pages for mainly non-profit
> (not charitable, just extremely cash poor) organizations. The difference
> between the 100 US dollar standard edition and the 300 US dollar
> professional edition is a deal breaker.
>
> So I'm looking around for other debugging options.
>
> The best contender so far has been Quanta with the Gubed plug in. But it
> is buggy, and while I've had success in running it, I've also had as
> much trouble. Especially with some error messages that won't go away:
> http://forum.gubed.mccabe.nu/viewtopic.php?t=396&sid=5b76626496aab99293e062
>c494a7af2e
>
> After that PHPeclipse seems good. By "seems" I mean that I've installed
> Eclipse and PHPeclipse and can run them and see they have a sexy
> interface and all. But trying to download the DBG package that makes
> PHPeclipse interface with the server is near impossible.
>
> As I'm an Ubuntu user, I tried looking up distro-specific instructions
> for installing DBG, and the one forum entry on the topic I found:
> http://www.ubuntuforums.org/showthread.php?t=6672
> ... says to go to this web page:
> http://www.phpeclipse.de/tiki-index.php?page=DbgBasedDebugger
> ... where the installation instructions are for Windows!
>
> There's also a package called "NuSphere", which is paid software, but
> also rests on the DBG debugger technology. I'm very hesitant to
> encounter the same difficulties in installing DBG and having to pay for
> it as well.
>
> I asked once before on this list about which PHP editors people
> recommend, which is how I heard of Eclipse.
>
> However, now I'm asking:
>
> Does anyone know how to get a reliable PHP graphical debugger to
> actually install and work on Linux?
>
> Any tutorials or instructions available anywhere that are newbie
> friendly? After all, aren't the newbies the ones most likely to be the
> ones to use a GUI debugger?
>
> Any advice or help would be greatly appreciated.
>
> Thank you for your time.
>
> --
> Dave M G
> Ubuntu 6.06 LTS
> Kernel 2.6.17.7
> Pentium D Dual Core Processor
> PHP 5, MySQL 5, Apache 2

--- End Message ---
--- Begin Message ---
I worked round my problem by adding the contents of my additional ini files
to the bottom of the std ini file - a typical redhat solution to a typical 
redhat
problem (I only ever seem to have to go through this kind of crap on Redhat - 
Debian
is much nicer to me).

Jochem Maas wrote:
> hi people,
> 
> anyone know why my additional ini files are being ignored.
> 
> I've just built php5.1.1
> the configure line is:
> 
> './configure' '--with-interbase=shared,/opt/firebird' 
> '--with-apxs2=/usr/sbin/apxs' '--with-gd=shared' '--with-zlib-dir'
> '--with-jpeg-dir' '--with-config-file-scan-dir=/etc/php.d' '--with-mm=/usr'
> 
> the dir [that php is configured to look in for additional ini files] exists:
> 
> # ls -lart /etc/php.d/
> total 32
> -rw-r--r--  1 root root   375 Aug 21 12:42 interbase.ini
> -rw-r--r--  1 root root    51 Aug 21 12:42 gd.ini
> -rw-r--r--  1 root root  1130 Aug 21 12:42 apc.ini
> drwxr-xr-x  2 root root  4096 Aug 21 12:45 .
> drwxr-xr-x 91 root root 12288 Aug 21 13:20 ..
> 
> YET, doing a 'php -i' shows that no files were read from that dir:
> 
> <SNIP>
> PHP Version => 5.1.1
> System => Linux testserver.dynabyte.nl 2.6.15-1.2054_FC5 #1 Tue Mar 14 
> 15:48:33 EST 2006 i686
> Build Date => Aug 21 2006 13:43:09
> Configure Command =>  './configure' '--with-interbase=shared,/opt/firebird' 
> '--with-apxs2=/usr/sbin/apxs'
> '--with-gd=shared' '--with-zlib-dir' '--with-jpeg-dir' 
> '--with-config-file-scan-dir=/etc/php.d' '--with-mm=/usr'
> Server API => Command Line Interface
> Virtual Directory Support => disabled
> Configuration File (php.ini) Path => /etc/php.ini
> Scan this dir for additional .ini files => /etc/php.d
> PHP API => 20041225
> </SNIP>
> 
> the following line should be part of the snippet just above the last line 
> (PHP API):
> 
> additional .ini files parsed => /etc/php.d/apc.ini, /etc/php.d/gd.ini, 
> /etc/php.d/interbase.ini
> 
> 
> any takers?
> 

--- End Message ---
--- Begin Message ---
On Mon, 21 Aug 2006 13:51:16 +0400, Nadim Attari wrote:

> Hello,
> 
> I have some text in a table... the text contains hyperlinks (but not 
> html coded, i.e. plain "Some text...http://www.something.com";)
> 
> When i retrieve these texts from the table, i want the hyperlinks to 
> become clickable, i.e. <a href etc added automatically.
> 
> "Some text...<a 
> href="http://www.something.com";>http://www.something.com</a>"
> 
> I know this sould be done using Regex, but i don't know regex.
> 
> Any help (links, examples, etc)
> 
> Thanks
> Nadim Attari

How's this:

<?php
// $s contains the entry from the table.

// Non-strict url matching.
$s = preg_replace('/(http:\/\/[^\s]+)/i', "<A href=\"$1\">$1</A>", $s);
?>

This is very non strict. Anything starting with http:// until the next
whitespace (\s) is clickable. You might want to put a more strict rule in
there, but it depends on the text your searching in. Note that above code
does not work when an url is at the end of a line, and followed by a
period (.).

Ivo

--- End Message ---
--- Begin Message ---
On Mon, August 21, 2006 4:51 am, Nadim Attari wrote:
> I have some text in a table... the text contains hyperlinks (but not
> html coded, i.e. plain "Some text...http://www.something.com";)
>
> When i retrieve these texts from the table, i want the hyperlinks to
> become clickable, i.e. <a href etc added automatically.
>
> "Some text...<a
> href="http://www.something.com";>http://www.something.com</a>"
>
> I know this sould be done using Regex, but i don't know regex.
>
> Any help (links, examples, etc)

Last time I read the User Contributed Notes for PCRE pages, there were
several solutions to this very problem in them...

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

--- End Message ---
--- Begin Message ---
Nadim Attari wrote:
Hello,

I have some text in a table... the text contains hyperlinks (but not html coded, i.e. plain "Some text...http://www.something.com";)

When i retrieve these texts from the table, i want the hyperlinks to become clickable, i.e. <a href etc added automatically.

"Some text...<a href="http://www.something.com";>http://www.something.com</a>"

I know this sould be done using Regex, but i don't know regex.

Any help (links, examples, etc)

Thanks
Nadim Attari

You don't know Regex. Well, that's simple then, TRY to learn it. Noone will (or should) give you any answers if it's absolutely clear that you're not putting any effort into trying to find one yourself. "I know this should be done using Regex, but I don't know regex.", wouldn't you think it'd be a good idea to look up a tutorial somewhere or try to find out what this "regex" exactly is? Try to type regex in the php doc, see the notes for the various functions?

really, a little more effort goes a long way.
- tul

--- End Message ---
--- Begin Message ---
On 21/08/06, M. Sokolewicz <[EMAIL PROTECTED]> wrote:
A little harsh but I agree with the sentiment - plus you will get a lot of
pleasure out of it when you see how powerful a tool it is in your arsenal.




--
http://www.web-buddha.co.uk
http://www.projectkarma.co.uk

--- End Message ---
--- Begin Message --- If what you mean is a db table, then it would seem to me that you should not be using a regex. PHP has rawurlencode() for this sort of thing.

But - you should learn regex ;-)

Try something like (untested and late at night)

function urlme($location)
{
    $enc=rawurlencode($location);
    $spc=htmlspecialchars($location);
    return "<A href='http://$enc'>$spc</a>";
}

AJ

www.project-network.com
www.deployview.com
www.funkifunctions.blogspot.com

M. Sokolewicz wrote:
Nadim Attari wrote:
Hello,

I have some text in a table... the text contains hyperlinks (but not html coded, i.e. plain "Some text...http://www.something.com";)

When i retrieve these texts from the table, i want the hyperlinks to become clickable, i.e. <a href etc added automatically.

"Some text...<a href="http://www.something.com";>http://www.something.com</a>"

I know this sould be done using Regex, but i don't know regex.

Any help (links, examples, etc)

Thanks
Nadim Attari

You don't know Regex. Well, that's simple then, TRY to learn it. Noone will (or should) give you any answers if it's absolutely clear that you're not putting any effort into trying to find one yourself. "I know this should be done using Regex, but I don't know regex.", wouldn't you think it'd be a good idea to look up a tutorial somewhere or try to find out what this "regex" exactly is? Try to type regex in the php doc, see the notes for the various functions?

really, a little more effort goes a long way.
- tul

--- End Message ---
--- Begin Message ---
http://www.php.net/manual/en/reference.pcre.pattern.syntax.php

On 8/22/06, Alex Turner <[EMAIL PROTECTED]> wrote:

If what you mean is a db table, then it would seem to me that you should
not be using a regex.  PHP has rawurlencode() for this sort of thing.

But - you should learn regex ;-)

Try something like (untested and late at night)

function urlme($location)
{
     $enc=rawurlencode($location);
     $spc=htmlspecialchars($location);
     return "<A href='http://$enc'>$spc</a>";
}

AJ

www.project-network.com
www.deployview.com
www.funkifunctions.blogspot.com

M. Sokolewicz wrote:
> Nadim Attari wrote:
>> Hello,
>>
>> I have some text in a table... the text contains hyperlinks (but not
>> html coded, i.e. plain "Some text...http://www.something.com";)
>>
>> When i retrieve these texts from the table, i want the hyperlinks to
>> become clickable, i.e. <a href etc added automatically.
>>
>> "Some text...<a
>> href="http://www.something.com";>http://www.something.com</a>"
>>
>> I know this sould be done using Regex, but i don't know regex.
>>
>> Any help (links, examples, etc)
>>
>> Thanks
>> Nadim Attari
>
> You don't know Regex. Well, that's simple then, TRY to learn it. Noone
> will (or should) give you any answers if it's absolutely clear that
> you're not putting any effort into trying to find one yourself. "I know
> this should be done using Regex, but I don't know regex.", wouldn't you
> think it'd be a good idea to look up a tutorial somewhere or try to find
> out what this "regex" exactly is? Try to type regex in the php doc, see
> the notes for the various functions?
>
> really, a little more effort goes a long way.
> - tul

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




--
GMail Rocks!!!

--- End Message ---
--- Begin Message ---

Older version of MySQL does not support subselects.

On Sun, August 20, 2006 5:18 am, Bigmark wrote:
> Can anyone tell me why this works on my localhost but gets an error on
> my
> server:
>
> <?php
> $sql = "SELECT COUNT(*) FROM leaderboard WHERE points >=( SELECT
> points FROM
> leaderboard WHERE username= '$username' )";
> $result = mysql_query( $sql ) or die ( mysql_error() );
> $rank = mysql_result( $result, 0 );
> echo $rank;
> ?>
>
>
> this is the error message but i cant figure it out:
>
> Your Position  You have an error in your SQL syntax. Check the manual
> that
> corresponds to your MySQL server version for the right syntax to use
> near
> 'SELECT points FROM leaderboard WHERE username= 'ainslie' )' at
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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



--- End Message ---
--- Begin Message ---
On Sat, August 19, 2006 10:49 am, Hiren Parmar wrote:
> i have one problem regarding variable's access ...
>
> i hv defined some varibale like
>
> DEFINE('_xx_USERNAME','Username');
>
> in one file ...
>
> and in another file , i got this variable (_xx_USERNAME) as a value of
> another variable ... like
>
> $filedValue = '_xx_USERNAME' ;
>
> now , the problem is i want the value of _xx_USERNAME in the second
> file ...
>
> that is *Username*...  by using variable $filedValue ...
>
> how could i do this ?

http://php.net/constant

TIP:
ALWAYS read all the "See Also" links for a function when you want a
function related to that function.

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

--- End Message ---
--- Begin Message ---
On Fri, August 18, 2006 4:08 pm, Chris W. Parker wrote:
> Last night I was reading Chris Shiflett's PHP Security book from
> O'Reilly and got to thinking about ways to authenticate a user other
> than using a password.
>
> Ideas:
>
> 1. Use flash to allow the user to draw an image. If the original image
> created during signup is within an acceptable range of the image used
> to
> authenticate, let them in.
>
> 2. (I saw this somewhere else... don't remember where or what it's
> called.) Use flash (again) to allow the user to click on an image in
> certain places. I think it was that you clicked the image in three
> places and then when you later authenticated you were supposed to
> click
> in those same places plus one more (to throw off anyone looking over
> your shoulder I think). As long as three of the 4 places clicked
> matched
> your original points (within a certain tolerance) you were
> authenticated.
>
>
> I'm not sure that these systems are any more SECURE than a simple
> username/password combo (keep in mind though, you'll also need some
> kind
> of username) but at the very least it seems that it could be more
> usable.
>
>
> I'd be interested in hearing your thoughts as well as any links for
> further reading.

You're pretty much leaving out visually-impaired users in the cold...

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

--- End Message ---
--- Begin Message ---
On Sun, August 20, 2006 12:30 am, Bigmark wrote:
> Hi, can anyone help me with this at all.
>
> i have a table leaderboard with username points etc and can echo the
> scores
> in asc order ok but what i want is to grab the scores and display a
> users
> position using their session ID.
>
> So if the scores are for example:
> 36 user3
> 22 user1
> 18 user4
> 12 user2
>
> How do i show user 1's position on the leaderboard on their user login
> page.
> here are the fields in table 'leaderboard'
> ID
> user_id
> username
> points
> comp_id
> email

This is an SQL question, so you'll find much better answers on an SQL
forum.

If all else fails, I guess you could just do the whole ranking, and
then run through counting up the rows until you find the current
person...

Since that would be relativly expensive, perhaps you could run it as a
cron job once a day or once a week and store it in a field on their
profile.

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

--- End Message ---
--- Begin Message ---
hi.

I have to check if the script file belongs to any ov form1.php to
form6.php files. Need something like:
preg_match('/form*.php/', $_SERVER['PHP_SELF'])
wher * kan be any number between 1 and 6.

Thanks for any help.

-afan

--- End Message ---
--- Begin Message ---
On 21/08/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

hi.

I have to check if the script file belongs to any ov form1.php to
form6.php files. Need something like:
preg_match('/form*.php/', $_SERVER['PHP_SELF'])
wher * kan be any number between 1 and 6.

Thanks for any help.

the pattern is form[1-6]+\.php.








--
http://www.web-buddha.co.uk
http://www.projectkarma.co.uk

--- End Message ---
--- Begin Message ---
Off the top of my head:

/form[1-6]\.php/

AJ

www.deployview.com

[EMAIL PROTECTED] wrote:
hi.

I have to check if the script file belongs to any ov form1.php to
form6.php files. Need something like:
preg_match('/form*.php/', $_SERVER['PHP_SELF'])
wher * kan be any number between 1 and 6.

Thanks for any help.

-afan

--- End Message ---
--- Begin Message --- I think this pattern would also match form16.php etc, which I think is not what afan wanted.

Dave Goodchild wrote:
On 21/08/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

hi.

I have to check if the script file belongs to any ov form1.php to
form6.php files. Need something like:
preg_match('/form*.php/', $_SERVER['PHP_SELF'])
wher * kan be any number between 1 and 6.

Thanks for any help.

the pattern is form[1-6]+\.php.









--- End Message ---
--- Begin Message ---
Works perfect. Thanks!
;)

-afan



> function doMatch($f) {
>       echo $f,
>              " = ",
>              (preg_match("#^form[1-6]\.php\$#",basename($f))?"true":"false"),
>              "\n";
> }
>
> doMatch("form1.php"); // true
> doMatch("form2.php"); // true
> doMatch("form3.php"); // true
> doMatch("form4.php"); // true
> doMatch("form5.php"); // true
> doMatch("form6.php"); // true
> doMatch("/some/dir/form6.php");       // true
> doMatch("form06.php");        // false
> doMatch("/some/dir/form06.php");// false
> doMatch("form16.php");        // false
> doMatch("/some/dir/form16.php");// false
>
>
> [EMAIL PROTECTED] wrote:
>> hi.
>>
>> I have to check if the script file belongs to any ov form1.php to
>> form6.php files. Need something like:
>> preg_match('/form*.php/', $_SERVER['PHP_SELF'])
>> wher * kan be any number between 1 and 6.
>>
>> Thanks for any help.
>>
>> -afan
>>
>
>

--- End Message ---
--- Begin Message ---
function doMatch($f) {
        echo $f,
             " = ",
             (preg_match("#^form[1-6]\.php\$#",basename($f))?"true":"false"),
             "\n";
}

doMatch("form1.php");   // true
doMatch("form2.php");   // true
doMatch("form3.php");   // true
doMatch("form4.php");   // true
doMatch("form5.php");   // true
doMatch("form6.php");   // true
doMatch("/some/dir/form6.php"); // true
doMatch("form06.php");  // false
doMatch("/some/dir/form06.php");// false
doMatch("form16.php");  // false
doMatch("/some/dir/form16.php");// false


[EMAIL PROTECTED] wrote:
> hi.
> 
> I have to check if the script file belongs to any ov form1.php to
> form6.php files. Need something like:
> preg_match('/form*.php/', $_SERVER['PHP_SELF'])
> wher * kan be any number between 1 and 6.
> 
> Thanks for any help.
> 
> -afan
> 

--- End Message ---
--- Begin Message ---
So if I understand you gentlemen correctly, these pre-builds serve as
examples how NOT to do it?

Gerry

On 8/20/06, Larry Garfield <[EMAIL PROTECTED]> wrote:
On Sunday 20 August 2006 20:17, Gerry D wrote:
> On 8/19/06, Larry Garfield <[EMAIL PROTECTED]> wrote:
> > OSCommerce is crap.  Don't bother.
>
> Why do you say that, Larry? I may want to get into an app like that
> because I think one of my clients is ready for it. What are the cons,
> and what are my options? What are Drupal's limitations?

I tried using it for a client last summer, because it was available free on
the client's web host.  It is extremely rigid.  If you want a program that
works the way they want and looks kinda like Buy.com with a table-based
layout in 3 columns with certain visual effects, it's fine.  If you want to
change or customize anything, good luck.  Nearly everything is hard coded
with HTML and presentation PHP and business logic PHP all mixed in together.
With a table based layout.

Ugh.

As for using pre-build vs. rolling your own, the main reason I favor
ready-made is the bank hookups.  Anytime financial stuff is involved, I'd
rather use something someone else already debugged than roll my own.

--- End Message ---
--- Begin Message ---
Don't forget that you can also do the CSS inline:

<body style="background: url(/images/$random_image)">

And then also in the CSS file have all the other declarations for the body tag.

--
Kevin Murphy
Webmaster: Information and Marketing Services
Western Nevada Community College
www.wncc.edu
775-445-3326


On Aug 21, 2006, at 12:50 PM, Dave Goodchild wrote:

You're right, a bit off-topic, as is my answer. You could use php, ie have
more contro, as it's server-side ie

the php array

$classes = array('class1', 'class2', 'class3'); ?>

the xhtml with php dynamics

<body class="<?php echo array_rand($classes); ?>">

then in the css, for example

body .class1 {
background: url(/images/class1.jpg);
}

body .class2 {
background: url(/images/class2.jpg);
}

...let me know if this is a viable approach for you and we can continue off
list.


--
http://www.web-buddha.co.uk
http://www.projectkarma.co.uk
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


--- End Message ---

Reply via email to