php-general Digest 17 Aug 2002 23:26:06 -0000 Issue 1531

Topics (messages 113070 through 113096):

Re: Problem about rpm package of php
        113070 by: Jason Wong
        113089 by: EdwardSPL.ita.org.mo

Re: Protocol on handling empty checkbox values
        113071 by: Jason Wong

Re: hyperlink parser
        113072 by: Jason Wong
        113073 by: Roman
        113088 by: Jason Wong

Re: Bulk Email [solution found!]
        113074 by: Manuel Lemos
        113090 by: Paul Roberts

PHP - mail() function problem
        113075 by: N. Pari Purna Chand
        113087 by: Jason Wong

Re: printer_draw_text
        113076 by: robert mischke

Re: Upgraded to PHP 4.2.2 and completely lost all GET and POST variables
        113077 by: Deepak Kumar Vasudevan
        113079 by: robert mischke

CHM docs help wanted
        113078 by: Gabor Hojtsy

foreach with methods returning arrays ??? any ideas ?
        113080 by: Ipa
        113081 by: Rasmus Lerdorf
        113082 by: Ipa

Proper permissions for PHP in shared environment?
        113083 by: Bill Leonard

Strange PHP + MySQL add / update issue with NULL values
        113084 by: Dan Tappin
        113085 by: Aron Pilhofer
        113086 by: Dan Tappin

quick ereg() question
        113091 by: eriol
        113092 by: Bas Jobsen
        113093 by: eriol

Cleanup script
        113094 by: Liam MacKenzie
        113095 by: Jose Arce

preg_match help?
        113096 by: Jason Soza

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 ---
On Saturday 17 August 2002 17:42, [EMAIL PROTECTED] wrote:
> If I want to enable the options ( eg : --enable-ftp, --with-gd,
> --with-gettext, --with-memory-limit etc ), so how can I do with rpm / SPRMS
> package of php ?

If they're not enabled in the standard RPMs then:

1) Get the SRPMs and edit the .spec file accordingly

or

2) Forget the RPMs and install entirely from the tarballs


If you choose (1) then ask on the relevant mailing list of the linux 
distribution that you are using.

If you choose (2) then:

  (a) search google for "linux apache mysql php installation"
  (b) and if you have problems subscribe to the php-install list and post your 
questions there.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
There is one way to find out if a man is honest -- ask him.  If he says
"Yes" you know he is crooked.
                -- Groucho Marx
*/

--- End Message ---
--- Begin Message ---
Jason Wong wrote:

> On Saturday 17 August 2002 17:42, [EMAIL PROTECTED] wrote:
> > If I want to enable the options ( eg : --enable-ftp, --with-gd,
> > --with-gettext, --with-memory-limit etc ), so how can I do with rpm / SPRMS
> > package of php ?
>
> If they're not enabled in the standard RPMs then:
>
> 1) Get the SRPMs and edit the .spec file accordingly
>
> or
>
> 2) Forget the RPMs and install entirely from the tarballs
>
> If you choose (1) then ask on the relevant mailing list of the linux
> distribution that you are using.

Does your means if I'm using Redhat Linux 7.2 system, then I can ask the question
to [EMAIL PROTECTED] ( mail list ) ?


--- End Message ---
--- Begin Message ---
On Saturday 17 August 2002 17:40, David Yee wrote:
> > It's not PHP's fault -- it's the CGI/POST specs.  The browser is not
>
> sending
>
> > it through, because that's what it was told to do :)
>
> Ah- got it.  That would make sense since it's the browser that's send the
> form data to the server, and if it doesn't chose to....  I wonder why the
> CGI/POST specs are like that- there's probably a good reason?

One advantage is that it saves some bandwidth.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Although the moon is smaller than the earth, it is farther away.
*/

--- End Message ---
--- Begin Message ---
On Saturday 17 August 2002 19:25, Roman wrote:
> Hello,
>
> I'd need to parse html page and get all hyperlinks there.
>
> Is there any easy way to do it ? I'm not so good at regexps :(
>
> $file=file("http://url.html";);
>
> could be good start :)

Even better, search the archives.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Mother is far too clever to understand anything she does not like.
                -- Arnold Bennett
*/

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

On Saturday 17 August 2002 19:25, Roman wrote:
> I'd need to parse html page and get all hyperlinks there.
> Is there any easy way to do it ? I'm not so good at regexps :(
Even better, search the archives.

pls how to reach archives and what to search ? I have last 7.000 messages in
my mailer :( I would be here 2 weeks if I had to read it one by one :(

Roman


--- End Message ---
--- Begin Message ---
On Saturday 17 August 2002 20:07, Roman wrote:
> On Saturday 17 August 2002 19:25, Roman wrote:
> > I'd need to parse html page and get all hyperlinks there.
> > Is there any easy way to do it ? I'm not so good at regexps :(
>
> Even better, search the archives.
>
> pls how to reach archives 

Look on the php website for where the archives are found.

> and what to search ? 

I don't know. Try various combinations of

extract, url, regex, hyperlink, parse, link

> I have last 7.000 messages
> in my mailer :( I would be here 2 weeks if I had to read it one by one :(

In that case it might be quicker for you to write your own ;-)

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Love may laugh at locksmiths, but he has a profound respect for money bags.
                -- Sidney Paternoster, "The Folly of the Wise"
*/

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

On 08/17/2002 03:52 AM, Paul Roberts wrote:
> i tried it using the 5th parameter with -odd and the mail got qued but i also need 
>to set [EMAIL PROTECTED] (so i get those bounces) but i got <[EMAIL PROTECTED] -odd> for 
>the return path in the email. 
> 
> i then tried it with the -odd first and it qued the mail but didn't set the return 
>path, i also want to set it so it only returns the headers using -Rhdrs so need to 
>set 3 options when sendmail is called.
> 
> can you set multiple options with the 5th parameter? i would have thought it would 
>append the stuff in the 5th to the sendmail path set in php.ini but it doesn't seem 
>to work that way.
> 
> i can do this fine by using popen() and adding the parameters to the path so i can't 
>see why it doesn't play with the mail function.

That is because PHP encloses what you pass between quotes, so that is 
take as just a single argument, so it can't be used to pass more than 
one argument.

-- 

Regards,
Manuel Lemos

--- End Message ---
--- Begin Message ---
Okay i found a bug report on this
http://bugs.php.net/bug.php?id=15509

Apparently it was changed to only allow one parameter for security reasons.


Paul Roberts
http://www.paul-roberts.com
[EMAIL PROTECTED]
++++++++++++++++++++++++


----- Original Message ----- 
From: "Manuel Lemos" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 17, 2002 1:37 PM
Subject: Re: [PHP] Re: Bulk Email [solution found!]


> Hello,
> 
> On 08/17/2002 03:52 AM, Paul Roberts wrote:
> > i tried it using the 5th parameter with -odd and the mail got qued but i also need 
>to set [EMAIL PROTECTED] (so i get those bounces) but i got <[EMAIL PROTECTED] -odd> for 
>the return path in the email. 
> > 
> > i then tried it with the -odd first and it qued the mail but didn't set the return 
>path, i also want to set it so it only returns the headers using -Rhdrs so need to 
>set 3 options when sendmail is called.
> > 
> > can you set multiple options with the 5th parameter? i would have thought it would 
>append the stuff in the 5th to the sendmail path set in php.ini but it doesn't seem 
>to work that way.
> > 
> > i can do this fine by using popen() and adding the parameters to the path so i 
>can't see why it doesn't play with the mail function.
> 
> That is because PHP encloses what you pass between quotes, so that is 
> take as just a single argument, so it can't be used to pass more than 
> one argument.
> 
> -- 
> 
> Regards,
> Manuel Lemos
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 

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

I am facing a strange problem,
php's mail() function is not working when a php page is executed thru
apache,
but the same page which has mail() function is working fine and is sending
mails
when php is used as a scripting language in shell.

I'm using xmail's sendmail and xmail as MTA on this machine.
 I've been using the same thing on another machine withour any problems.
Both the machines are installed with mandrake 8.2

Any guess what might be causing the problem ?

TIA
/chandu


--- End Message ---
--- Begin Message ---
On Saturday 17 August 2002 21:08, N. Pari Purna Chand wrote:
> Hi guys,
>
> I am facing a strange problem,
> php's mail() function is not working when a php page is executed thru
> apache,
> but the same page which has mail() function is working fine and is sending
> mails
> when php is used as a scripting language in shell.

Is this on the same machine? If so, check that both the apache-php and the 
cgi-php are using the same php.ini (and hence same sendmail settings).

> Any guess what might be causing the problem ?

Try comparing php.ini.


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Heard that the next Space Shuttle is supposed to carry several Guernsey cows?
It's gonna be the herd shot 'round the world.
*/

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


> Hi All,
> 
> I'm trying to print some date right out of an php file,
> to do this i use the  printer_draw_text  function.
> All works fine for one line, but how can i print more than one line?
> 

printer_draw_text($handle, "+", 100, $y);
$y=+$fontsize; 
printer_draw_text($handle, "+", 100, $y);

robert


> When i put my text in a string, and try to print the string
> it will print nice squares, but it will not print multiple lines.
> 
> I have read the manual, but no help there.
> 
> This works for one line:
> $handle = printer_open();
> printer_start_doc($handle, "My Document");
> printer_start_page($handle);
> 
> $font = 
> printer_create_font("Helvetica",36,24,200,false,false,false,0);
> printer_select_font($handle, $font);
> printer_draw_text($handle, "test", 10, 10);
> printer_delete_font($font);
> 
> printer_end_page($handle);
> printer_end_doc($handle);
> printer_close($handle);
> 
> but when i try this, it will print squares (like unknown character)
> 
> $handle = printer_open();
> printer_start_doc($handle, "My Document");
> printer_start_page($handle);
> 
> $font = printer_create_font("Arial",36,24,200,false,false,false,0);
> printer_select_font($handle, $font);
> 
> $text = "Hello,\nThis will be the second line";
> 
> printer_draw_text($handle, $text, 10, 10);
> printer_delete_font($font);
> 
> printer_end_page($handle);
> printer_end_doc($handle);
> printer_close($handle);
> 
> 
> Greetings
> Peter
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
PHP 4.1.2 (+)  has register_globals turned off by default.  

Do either of the below to turn it on:

  1.. Turn register_globals on in PHP.INI
  2.. Use ini_set in one or more of the most commonly used files of the application to 
have register_globals turned on for that application. (I think a variant of PHP 
directive in Apache also achieves this effect. But not sure though).
[EMAIL PROTECTED] 

"James Daily" <[EMAIL PROTECTED]> wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 
> RE: phpsecurityadmin-2002-07-24.zip and PHP 4.2.2
> 
> PLATFORM: win 98
> 
> BACKGROUND: in order to use the above classes i had to
> upgrade to PHP 4.2.2
> 
> PROBLEM: when i upgraded to 4.2.2, all my old scripts
> lost the GET or POST info being passed.
> 
> COMMENTS: everything except the phpsecurityadmin classes
> worked as expected under PHP 4.0.
> 
> after upgrade, phpsecurityadmin classes work but any old
> scripts that are accepting data from previous page via
> GET or POST do not.
> 
> i can manually parse the GET query string, but this is foolish
> and time consuming.
> 
> it's as if the automatic variables are not getting assigned
> the data being passed.
> 
> QUESTION: has anybody else run across this and
> what was the resolution?
> 
> ---------------------------------------------
> James Daily
> Phone : 816 943 9891
> Email : [EMAIL PROTECTED] (or hit reply button)
> Web   : http://tellmama.com/
> Philosophy:
>                             4     2                              1000
> ( cos(ø - r) - sin ø ) * ( r  - 2r  cos(2ø + 2.4) + 0.9) + 0.62r)     < 0
> 
> Education is a progressive discovery of our own ignorance.
>                                                Will Durant
> 
--- End Message ---
--- Begin Message ---

> PHP 4.1.2 (+)  has register_globals turned off by default.  
> 
> Do either of the below to turn it on:
> 
>   1.. Turn register_globals on in PHP.INI
>   2.. Use ini_set in one or more of the most commonly used 
> files of the application to have register_globals turned on 
> for that application. (I think a variant of PHP directive in 
> Apache also achieves this effect. But not sure though). 
> [EMAIL PROTECTED] 

Please correct me, but
AFAIK turn register_globals ON with ini_set() is to late,
you have to use .htaccess:
php_value "register_globals" "0"



greetings 
robert

> 
> > Education is a progressive discovery of our own ignorance.
> >                                                Will Durant
> > 

--- End Message ---
--- Begin Message ---
Hi!

This is loosley related to PHP itself, though would be a nice
opportunity to support the PHP community for those who know
the ins and outs of JavaScript...

We have two known bugs left in the latest "PHP Documentation
CHM Edition", mostly because changes in the IE5 -> IE6
behaviours. We would really appreciate some help to sort these
two out, and release a new sample with all the known bugs
corrected.

More info: http://weblabor.hu/php-doc-chm/#knownbugs

Please send replys to [EMAIL PROTECTED]

Thanks,
Goba


--- End Message ---
--- Begin Message ---
Have a strange problem with methods..

if i use function to return some array and doing 2-level nested foreach(),
for example
function x(){
 return array(1, 2,3);
}

foreach(x() as $key){
 echo $key ."<br>";
 foreach(x() as $key2){
  echo "&nbsp;&nbsp;" . $key2 . "<br>";
 }
}

everything works fine ... the output is
2
  2
  3
3
  2
  3


But when i do it with object method and property i behaves unwanted, and
breaks loop after first nested foreach() stops

class Foo{
 var $y;
 function Foo(){
  $this -> y = array(2,3);
 }

 function gety(){
  return $this -> y;
 }
}

$x = new Foo;

foreach($x->gety() as $key){
 echo $key ."<br>";
 foreach($x->gety() as $key2){
  echo "&nbsp;&nbsp;" . $key2 . "<br>";
 }
}

it returns

2
  2
  3

Can anybody explain what is it ? a normal behavior or bug ?


--- End Message ---
--- Begin Message ---
The code is very different.  In your x() function you create a new array
every time you call x().  In the class example, you create the array once
when you instantiate the class and then return that same array each time
you call the gety() method.  When PHP iterates over arrays, it maintains
an array cursor so it knows where in the array it is.  Since you keep
returning the same array, the array cursor is kept.

-Rasmus

On Sat, 17 Aug 2002, Ipa wrote:

> Have a strange problem with methods..
>
> if i use function to return some array and doing 2-level nested foreach(),
> for example
> function x(){
>  return array(1, 2,3);
> }
>
> foreach(x() as $key){
>  echo $key ."<br>";
>  foreach(x() as $key2){
>   echo "&nbsp;&nbsp;" . $key2 . "<br>";
>  }
> }
>
> everything works fine ... the output is
> 2
>   2
>   3
> 3
>   2
>   3
>
>
> But when i do it with object method and property i behaves unwanted, and
> breaks loop after first nested foreach() stops
>
> class Foo{
>  var $y;
>  function Foo(){
>   $this -> y = array(2,3);
>  }
>
>  function gety(){
>   return $this -> y;
>  }
> }
>
> $x = new Foo;
>
> foreach($x->gety() as $key){
>  echo $key ."<br>";
>  foreach($x->gety() as $key2){
>   echo "&nbsp;&nbsp;" . $key2 . "<br>";
>  }
> }
>
> it returns
>
> 2
>   2
>   3
>
> Can anybody explain what is it ? a normal behavior or bug ?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
yes there is difference in creation returning array.. but i talk about other
thing
IMHO
1. "return" returns COPY of array in both cases .. no difference is it
method or function
2. here we don't return reference to the same array.
3. foreach - as i have read in most sources Makes a copy of given array.  so
it is 2-nd time i have to get copy of that array so 2-nd foreach dont have
to affect 1-st ...

if the cursor pointing to the same array how can it transparently point
through the method ?

isn't it ?? please correct me if i wrong..


> The code is very different.  In your x() function you create a new array
> every time you call x().  In the class example, you create the array once
> when you instantiate the class and then return that same array each time
> you call the gety() method.  When PHP iterates over arrays, it maintains
> an array cursor so it knows where in the array it is.  Since you keep
> returning the same array, the array cursor is kept.
>
> -Rasmus
>
> On Sat, 17 Aug 2002, Ipa wrote:
>
> > Have a strange problem with methods..
> >
> > if i use function to return some array and doing 2-level nested
foreach(),
> > for example
> > function x(){
> >  return array(1, 2,3);
> > }
> >
> > foreach(x() as $key){
> >  echo $key ."<br>";
> >  foreach(x() as $key2){
> >   echo "&nbsp;&nbsp;" . $key2 . "<br>";
> >  }
> > }
> >
> > everything works fine ... the output is
> > 2
> >   2
> >   3
> > 3
> >   2
> >   3
> >
> >
> > But when i do it with object method and property i behaves unwanted, and
> > breaks loop after first nested foreach() stops
> >
> > class Foo{
> >  var $y;
> >  function Foo(){
> >   $this -> y = array(2,3);
> >  }
> >
> >  function gety(){
> >   return $this -> y;
> >  }
> > }
> >
> > $x = new Foo;
> >
> > foreach($x->gety() as $key){
> >  echo $key ."<br>";
> >  foreach($x->gety() as $key2){
> >   echo "&nbsp;&nbsp;" . $key2 . "<br>";
> >  }
> > }
> >
> > it returns
> >
> > 2
> >   2
> >   3
> >
> > Can anybody explain what is it ? a normal behavior or bug ?
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>


--- End Message ---
--- Begin Message ---
Hey all... I am just wondering what everyone thinks about how to properly
set permissions so that a shared hosting user can use PHP to do things, like
create text files, in their own directory?

I know the directory that is to be written in has to have write privledges,
but turning that on for everyone seems like a bit of a security risk, does
it not? 

We are currently battling to find the best case scenario....

Anyway, any best practices here would be appreciated!

Bill


-- 
Bill Leonard                                           [EMAIL PROTECTED]
www.machinemen.com                                            407.464.0147

XrackHosting.com - Mac OS X hosting on Apple's Xserve!
http://www.xrackhosting.com/



--- End Message ---
--- Begin Message ---
I have a table where I have specified several columns which I have specified
that NULL values are not allowed.

I have created a PHP based create / update / delete page where users can
update the table.

I have an INSERT script that takes the user input and generates the
following query statement.

Insert:

INSERT INTO table SET required_field = NULL

I have set the required field to NULL which results in an error because
naturally this is a required field.  If I use an actual value the query runs
fine and the row is added.


Now I have another page that allows the user to update the existing rows.

Update:

UPDATE table SET required_field = NULL WHERE id = '2'

This assumes that the user has cleared a required field and is attempting to
enter NULL data for a required field.  If I execute this directly in mysql
the query fails (0 rows touched).

If I execute this via PHP from the web page the row is updated but it passes
"" instead of NULL so the row is updated.  The query above is echoed right
from the web page and pasted into MySQL.

Any idea?

Thanks,

Dan

--- End Message ---
--- Begin Message ---
Try this instead:

INSERT INTO table SET required_field =""

> -----Original Message-----
> From: Dan Tappin [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, August 17, 2002 12:56 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Strange PHP + MySQL add / update issue with NULL values
>
>
> I have a table where I have specified several columns which I
> have specified
> that NULL values are not allowed.
>
> I have created a PHP based create / update / delete page where users can
> update the table.
>
> I have an INSERT script that takes the user input and generates the
> following query statement.
>
> Insert:
>
> INSERT INTO table SET required_field = NULL
>
> I have set the required field to NULL which results in an error because
> naturally this is a required field.  If I use an actual value the
> query runs
> fine and the row is added.
>
>
> Now I have another page that allows the user to update the existing rows.
>
> Update:
>
> UPDATE table SET required_field = NULL WHERE id = '2'
>
> This assumes that the user has cleared a required field and is
> attempting to
> enter NULL data for a required field.  If I execute this directly in mysql
> the query fails (0 rows touched).
>
> If I execute this via PHP from the web page the row is updated
> but it passes
> "" instead of NULL so the row is updated.  The query above is echoed right
> from the web page and pasted into MySQL.
>
> Any idea?
>
> Thanks,
>
> Dan
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>


--- End Message ---
--- Begin Message ---
That is what PHP / MySQL seems to be doing to the query once it is sent.

I want to pass NULL to the column not a blank field (i.e. "" for text and 0
for numbers).  If I do INSERT INTO table SET required_field ="" I get the
same results.  NULL means no value at all and "" is a empty string which in
MySQL terms are two completely different things.

I have also noticed another weird issue:

UPDATE table SET required_field = NULL, notrequired_field = NULL WHERE id =
'2'

Results in:

id    required_field     notrequired_field
------------------------------------------------
2                             NULL

This is strange...  All of my NOT NULL columns result in '' data instead of
NULL but colunms that do not have a NOT NULL constraint do result in NULL!

Dan

> Try this instead:
> 
> INSERT INTO table SET required_field =""
> 
>> -----Original Message-----
>> From: Dan Tappin [mailto:[EMAIL PROTECTED]]
>> Sent: Saturday, August 17, 2002 12:56 PM
>> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
>> Subject: Strange PHP + MySQL add / update issue with NULL values
>> 
>> 
>> I have a table where I have specified several columns which I
>> have specified
>> that NULL values are not allowed.
>> 
>> I have created a PHP based create / update / delete page where users can
>> update the table.
>> 
>> I have an INSERT script that takes the user input and generates the
>> following query statement.
>> 
>> Insert:
>> 
>> INSERT INTO table SET required_field = NULL
>> 
>> I have set the required field to NULL which results in an error because
>> naturally this is a required field.  If I use an actual value the
>> query runs
>> fine and the row is added.
>> 
>> 
>> Now I have another page that allows the user to update the existing rows.
>> 
>> Update:
>> 
>> UPDATE table SET required_field = NULL WHERE id = '2'
>> 
>> This assumes that the user has cleared a required field and is
>> attempting to
>> enter NULL data for a required field.  If I execute this directly in mysql
>> the query fails (0 rows touched).
>> 
>> If I execute this via PHP from the web page the row is updated
>> but it passes
>> "" instead of NULL so the row is updated.  The query above is echoed right
>> from the web page and pasted into MySQL.
>> 
>> Any idea?
>> 
>> Thanks,
>> 
>> Dan

--- End Message ---
--- Begin Message ---
I checked the manual and it's comments as well as google, but didn't find the
simple answer i'm wanting..

I have the following line in a "show php source code" page:


    if (ereg("(\.php)$",$o0o) && !ereg("\/\.\.", $o0o)){
      ...
    }


It works fine on .php files but I was hoping I could include .inc files as well
when someone wanted to view the source of them.. To include .inc files as
viewable php source code, I'd rewrite it similar to below I assume, but I'm not
understanding the syntax I'm missing..


    if (ereg("(\.inc | .php)$",$o0o) && !ereg("\/\.\.", $o0o)){
      ...
    }


I know I have to use a pipe to seperate allowable file types, but that's the
extent of what I know.. Any help would be appreciated.. TIA..

Take care.. peace..
eriol



--- End Message ---
--- Begin Message ---
if (ereg("((\.)(php|inc))$",$o0o) && !ereg("\/\.\.", $o0o)){

Op zaterdag 17 augustus 2002 23:53, schreef eriol:
> I checked the manual and it's comments as well as google, but didn't find
> the simple answer i'm wanting..
>
> I have the following line in a "show php source code" page:
>
>
>     if (ereg("(\.php)$",$o0o) && !ereg("\/\.\.", $o0o)){
>       ...
>     }
>
>
> It works fine on .php files but I was hoping I could include .inc files as
> well when someone wanted to view the source of them.. To include .inc files
> as viewable php source code, I'd rewrite it similar to below I assume, but
> I'm not understanding the syntax I'm missing..
>
>
>     if (ereg("(\.inc | .php)$",$o0o) && !ereg("\/\.\.", $o0o)){
>       ...
>     }
>
>
> I know I have to use a pipe to seperate allowable file types, but that's
> the extent of what I know.. Any help would be appreciated.. TIA..
>
> Take care.. peace..
> eriol
--- End Message ---
--- Begin Message ---
Thank you Bas.. I appreciate the reply.. It works great..

Take care.. peace..
eriol

====

"Bas Jobsen" <[EMAIL PROTECTED]> disgorged:

: if (ereg("((\.)(php|inc))$",$o0o) && !ereg("\/\.\.", $o0o)){


--- End Message ---
--- Begin Message ---
I just had a massive open house party...

Is it possible to write a PHP script to collect all the bottles and 
cans, mop the floor, fumigate the carpet and make me lunch?



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

that's funny...the function oh_god_im_so_lazy does the job i think jeje...

>From: "Liam MacKenzie" <[EMAIL PROTECTED]>
>To: "php" <[EMAIL PROTECTED]>
>Subject: [PHP] Cleanup script
>Date: Sun, 18 Aug 2002 09:18:50 +1000
>
>I just had a massive open house party...
>
>Is it possible to write a PHP script to collect all the bottles and
>cans, mop the floor, fumigate the carpet and make me lunch?
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php




_________________________________________________________________
Charle con sus amigos online usando MSN Messenger: http://messenger.msn.com

--- End Message ---
--- Begin Message ---
I seriously need some help trying to make a match here. Obligatory
disclaimer: yes, I've searched google.com, I've read the PHP manual section
on preg_match(), and I've sat here for 3 hours trying to resolve this on my
own. :) Any help would be great:

I need to match everything between:

<b>$headline

Where $headline is a variable that will be filled out of a foreach() loop.
The pattern should return everything until it hits:

<font face="Verdana" size="3">

The text file this is taken out of looks like:

<font face="Verdana" size="3"><b>Headline here</b></font><p>

News story, blah, blah, blah...

<font face="Verdana" size="3"><b>Another headline</b></font><p>

More news, blah, blah...

...

The contents of the text file echo correctly before the preg_match, but the
preg_match I've tried:

preg_match("!<b[^>]+>(.*)<font face=\"Verdana\" size=\"3\">!", $contents,
$story);

Returns array(), so no matches are made. Any suggestions?

TIA,

Jason Soza


--- End Message ---

Reply via email to