php-general Digest 29 May 2004 18:39:40 -0000 Issue 2791

Topics (messages 187180 through 187201):

Re: Keep PHP variable values between script calls - XML RPC
        187180 by: Santiago Peirano
        187181 by: Santiago Peirano

Re: Security/Web tree/db connect and select
        187182 by: John W. Holmes

PHP 4.3.6 shows as 4.3.4?
        187183 by: Murray . PlanetThoughtful
        187184 by: Yasin Inat
        187186 by: Murray . PlanetThoughtful

Preg_match question
        187185 by: Dave Carrera
        187187 by: Jeroen Serpieters
        187188 by: Marco Tabini
        187189 by: Dave Carrera
        187190 by: Marco Tabini
        187193 by: Daniel Clark

PHP Coding Standards
        187191 by: charles kline
        187195 by: Gerard Samuel

How to obtain MAC address of server where PHP is running
        187192 by: Andrei Verovski (aka MacGuru)
        187194 by: Gerard Samuel
        187196 by: Andrei Verovski (aka MacGuru)
        187198 by: Gerard Samuel

CVS web front end
        187197 by: Brian V Bonini
        187199 by: lists
        187200 by: Johan Holst Nielsen
        187201 by: lists

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 ---
It is what I was looking for.
Thx a lot for the information.
Santiago
Lance Lovette wrote:
If you only need to persist a handful of request-agnostic variables you may
be able to make use of an extension I wrote. Note that it doesn't work under
Windows and I haven't tested it under PHP 4.3.x.

http://pwee.sourceforge.net/

Lance


-----Original Message-----
From: Santiago Peirano [mailto:[EMAIL PROTECTED] Sent: Thursday, May 27, 2004 11:17 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Keep PHP variable values between script calls - XML RPC


Ok, here we go.
I would like to implement an XML-RPC server (a script of course) that keeps the value of certain variables between the different invocations of the script.


I think that it should be possible, but I don't know where to start (none of the search in internet gave me a starting point).

Thanks in advance

Santiago

--- End Message ---
--- Begin Message ---
It is what I was looking for.
Thx a lot for the information.
Santiago
Lance Lovette wrote:
If you only need to persist a handful of request-agnostic variables you may
be able to make use of an extension I wrote. Note that it doesn't work under
Windows and I haven't tested it under PHP 4.3.x.

http://pwee.sourceforge.net/

Lance


-----Original Message-----
From: Santiago Peirano [mailto:[EMAIL PROTECTED] Sent: Thursday, May 27, 2004 11:17 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Keep PHP variable values between script calls - XML RPC


Ok, here we go.
I would like to implement an XML-RPC server (a script of course) that keeps the value of certain variables between the different invocations of the script.


I think that it should be possible, but I don't know where to start (none of the search in internet gave me a starting point).

Thanks in advance

Santiago

--- End Message ---
--- Begin Message --- Dennis Seavers wrote:
Option 1: Include the mysql_connect and mysql_select_db commands within the script that manipulates the data from the database.

Option 2: Include the mysql_connect and mysql_select_db commands (along with usernames and passwords) outside the Web tree, but have the script run from within the Web tree. The script would use a command like file() or file_get_contents()
to get the information from a text file outside the Web tree.


My belief is that Option 2 affords a higher level of security than Option 1, but I wanted to make sure.

You're right. Option 2 offers more security in that no one will ever be able to reach the file directly with a web browser. You don't need to use file() or file_get_contents(), though... A simple include('../includes/db.inc'); wil work (where ../ takes you outside of the webroot and into an includes/ directory for the db.inc file). Or use an absolute path include('/home/user/includes/db.inc'); where /home/user/www/ is your webroot (for example).


--
---John Holmes...

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

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
Hi All,

 

I've just recently downloaded and (I believe) installed PHP Ver 4.3.6.

 

I was previously running PHP Ver 4.3.4 (Win XP Pro, Apache 1.3.28).

 

When I run phpinfo(), it tells me that I'm still running PHP Version 4.3.4,
though in the apache information segment in phpinfo, it says: Apache/1.3.28
(Win32) PHP/4.3.6

 

Have I done something wrong in my upgrade to Ver 4.3.6, or is phpinfo
misreporting the version number in the header?

 

Any help appreciated!

 

Much warmth,

 

Murray

http://www.planetthoughtful.org

 

 


--- End Message ---
--- Begin Message ---
be sure, u have updated php4ts.dll correctly   in ur system path ...

--- End Message ---
--- Begin Message ---
Hi,

Thank you - that was exactly the problem!

Much warmth,

Murray
http://www.planetthoughtful.org

On 5/29/2004 4:06:15 AM, Yasin Inat ([EMAIL PROTECTED]) wrote: 
> be sure, u have updated php4ts.dll correctly   in ur system path ... 
> 
> -- 
> PHP General Mailing List (http://www.php.net/) 
> To unsubscribe, visit: http://www.php.net/unsub.php 


--- End Message ---
--- Begin Message ---
Hi List,

I have managed to list files on my website using a combination of
preg_match_all and str_replace in an array.

What I would like to know is how do I lift out of a <a> tag the contents
from href=".

Example:

Link returned = <a href="./somepage.php">Of to some page</a>

The bit I want to play with is ./somepage.php.

I think it might be something to do with another preg of some kind but I can
not work it our so I ask for help from the list.

Thank you in advance for any help or guidance you my give

Dave C

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.691 / Virus Database: 452 - Release Date: 26/05/2004
 

--- End Message ---
--- Begin Message ---
On Sat, 29 May 2004, Dave Carrera wrote:

>
> Link returned = <a href="./somepage.php">Of to some page</a>
>
> The bit I want to play with is ./somepage.php.
>

$str = '<a href="./somepage.php">Of to some page</a>';

if( preg_match("/<a href=\"(.*)\">/Ui", $str, $matches) )
        echo $matches[1];
else
        echo "string didn't match";

-- 
Jeroen

Always code as if the guy who ends up maintaining your code will be a violent 
psychopath who knows where you live.
        -- Martin Golding

--- End Message ---
--- Begin Message ---
I guess the simplest would be to use preg_match_all on 

'/<a +href="([^"]+)">/i'

Assuming that all your links are in that format, this will extract all the
contents of the href portion of the links in your string. There was a regex
series on our magazine that also covered more complex examples of this kind.

Cheers,


Marco

--
php|architect - The Magazine for PHP Professionals
http://www.phparch.com <-- Get your free issue today!

> -----Original Message-----
> From: Dave Carrera [mailto:[EMAIL PROTECTED]
> Sent: May 29, 2004 4:30 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Preg_match question
> 
> Hi List,
> 
> I have managed to list files on my website using a combination of
> preg_match_all and str_replace in an array.
> 
> What I would like to know is how do I lift out of a <a> tag the contents
> from href=".
> 
> Example:
> 
> Link returned = <a href="./somepage.php">Of to some page</a>
> 
> The bit I want to play with is ./somepage.php.
> 
> I think it might be something to do with another preg of some kind but I
> can
> not work it our so I ask for help from the list.
> 
> Thank you in advance for any help or guidance you my give
> 
> Dave C
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.691 / Virus Database: 452 - Release Date: 26/05/2004
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
Thanks Marco,

I worked it out, with trial and error but I will refine what I have by
reading your examples.

Is there a preg to find a "?" in a string since a "?" is used for
calculations as I see it.

Thank you and others for all the help with this

Dave Carrera


-----Original Message-----
From: Marco Tabini [mailto:[EMAIL PROTECTED] 
Sent: 29 May 2004 13:32
To: 'Dave Carrera'; [EMAIL PROTECTED]
Subject: RE: [PHP] Preg_match question


I guess the simplest would be to use preg_match_all on 

'/<a +href="([^"]+)">/i'

Assuming that all your links are in that format, this will extract all the
contents of the href portion of the links in your string. There was a regex
series on our magazine that also covered more complex examples of this kind.

Cheers,


Marco

--
php|architect - The Magazine for PHP Professionals
http://www.phparch.com <-- Get your free issue today!

> -----Original Message-----
> From: Dave Carrera [mailto:[EMAIL PROTECTED]
> Sent: May 29, 2004 4:30 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Preg_match question
> 
> Hi List,
> 
> I have managed to list files on my website using a combination of 
> preg_match_all and str_replace in an array.
> 
> What I would like to know is how do I lift out of a <a> tag the 
> contents from href=".
> 
> Example:
> 
> Link returned = <a href="./somepage.php">Of to some page</a>
> 
> The bit I want to play with is ./somepage.php.
> 
> I think it might be something to do with another preg of some kind but 
> I can not work it our so I ask for help from the list.
> 
> Thank you in advance for any help or guidance you my give
> 
> Dave C
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.691 / Virus Database: 452 - Release Date: 26/05/2004
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php




---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.691 / Virus Database: 452 - Release Date: 26/05/2004
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.691 / Virus Database: 452 - Release Date: 26/05/2004
 

--- End Message ---
--- Begin Message ---
> Is there a preg to find a "?" in a string since a "?" is used for
> calculations as I see it.
> 

You just need to escape it with a backslash, e.g. \?

Good luck,


Marco

--- End Message ---
--- Begin Message ---
Great quote Jeroen.

>>Always code as if the guy who ends up maintaining your code will be a violent 
>>psychopath who knows where you live.
>>      -- Martin Golding

--- End Message ---
--- Begin Message ---
Hi all,

I was having a conversation with a friend and talking about coding standards in the open source community (focusing on PHP). I seem to remember there being a document out there that sort of laid it out pretty well.

Anyone know where I might find a copy?

Thanks,
Charles

--- End Message ---
--- Begin Message ---
On Saturday 29 May 2004 08:55 am, charles kline wrote:
> Hi all,
>
> I was having a conversation with a friend and talking about coding
> standards in the open source community (focusing on PHP). I seem to
> remember there being a document out there that sort of laid it out
> pretty well.
>
> Anyone know where I might find a copy?
>

Probably -> http://pear.php.net/manual/en/standards.php

--- End Message ---
--- Begin Message ---
Hi,

Anyone knows ho to obtain MAC address of server where PHP is running (with PHP 
function, of course)?

Thanks in advance for any suggestion(s)

Andrei

--- End Message ---
--- Begin Message ---
On Saturday 29 May 2004 10:21 am, Andrei Verovski (aka MacGuru) wrote:
> Hi,
>
> Anyone knows ho to obtain MAC address of server where PHP is running (with
> PHP function, of course)?
>
> Thanks in advance for any suggestion(s)
>

I use passthru() to execute shell commands, and use preg_match() to get the 
MAC address.
Unfortunately, this would only work if passthru() isn't disabled, and 
safe_mode is off...

--- End Message ---
--- Begin Message ---
Hi, Gerard,

Can you please be so kind to post your code snippet you have described below?

Thanks.

On Saturday 29 May 2004 05:36 pm, Gerard Samuel wrote:
> On Saturday 29 May 2004 10:21 am, Andrei Verovski (aka MacGuru) wrote:
> > Hi,
> >
> > Anyone knows ho to obtain MAC address of server where PHP is running
> > (with PHP function, of course)?
> >
> > Thanks in advance for any suggestion(s)
>
> I use passthru() to execute shell commands, and use preg_match() to get the
> MAC address.
> Unfortunately, this would only work if passthru() isn't disabled, and
> safe_mode is off...

--- End Message ---
--- Begin Message ---
On Saturday 29 May 2004 12:35 pm, Andrei Verovski (aka MacGuru) wrote:
> Hi, Gerard,
>
> Can you please be so kind to post your code snippet you have described
> below?
>

<?php

ob_start();

passthru('/sbin/ifconfig | grep ether');
$dump = ob_get_contents();
preg_match('/[A-F0-9]{2}:[A-F0-9]{2}:[A-F0-9]{2}:[A-F0-9]{2}:[A-F0-9]{2}:
[A-F0-9]{2}/i', $dump, $mac);
$mac_address = $mac[0];

ob_end_clean();

?>

--- End Message ---
--- Begin Message ---
n e 1 know of a web based front end for CVS? Not just a file/project
browser but a fully functioning web based GUI.

--- End Message ---
--- Begin Message ---
tortoise is nice

http://www.tortoisecvs.org/

-chris
http://www.semioticpixels.com

--- End Message ---
--- Begin Message --- Lists wrote:
tortoise is nice

http://www.tortoisecvs.org/

As far as I can see, it have nothing to do with an web frontend?

--
Johan Holst Nielsen
Freelance PHP Developer
http://phpgeek.dk

--- End Message ---
--- Begin Message ---
<<As far as I can see, it have nothing to do with an web frontend?>>

you're so right. I meant to send the link for horde

http://www.horde.org/chora/


chris
http://www.semioticpixels.com

--- End Message ---

Reply via email to