php-general Digest 15 Sep 2001 22:16:40 -0000 Issue 878

Topics (messages 67442 through 67470):

original paintings
        67442 by: Boris_Lipner

Re: WDDX and binary data
        67443 by: Rouvas Stathis

problem with a global variable as class reference
        67444 by: Wolfram Kriesing

Re: [PEAR] problem with a global variable as class reference
        67445 by: Markus Fischer
        67448 by: Wolfram Kriesing

Overriding PHP build-in functions
        67446 by: Robert Klinkenberg

coding practices
        67447 by: Scott Parks
        67456 by: Ninety-Nine Ways To Die
        67464 by: Julio Nobrega Trabalhando

Re: [PEAR] Re: [PHP] Re: [PEAR] problem with a global variable as class reference
        67449 by: Markus Fischer

Flex...
        67450 by: Joaquin
        67470 by: Meir Kriheli

Re: Choices for root privilege
        67451 by: Chris Hobbs

Re: Compiling php like C
        67452 by: Chris Hobbs
        67455 by: Kunal Jhunjhunwala

Urgent
        67453 by: karthikeyan

Re: is PHP crazy, or am I?
        67454 by: Christian Dechery

Re: Help a newbie?
        67457 by: Andrew Hill

Regex
        67458 by: Boaz Yahav
        67459 by: Rasmus Lerdorf

redirect to php problem
        67460 by: Nikola Veber
        67461 by: Jack Dempsey

Re: if(isset($a)) vs if($a)
        67462 by: CC Zona
        67465 by: Mark

Re: Why doesn't this work?
        67463 by: CC Zona
        67468 by: Sterling Hughes

Boy Makes $71,000 in 3 Weeks. You Can Too!!
        67466 by: familiesexcel.home.com

PHP/CVS
        67467 by: Peter Gibson
        67469 by: Sterling Hughes

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]


----------------------------------------------------------------------


Dear Madam and Sir,

Our company, "GALLERY-A"  www.gallery-a.ru  , offer both modern
and classical
art, deals in a line of pieces of art by talented artists.
 Their works  include original paintings, sculptures, etc.,
  copies of masterpieces of various styles, countries and epochs,
   portraits made to order. These
professional artists are high-skilled graduates of educational
 institutions such as the Academy of Fine Arts, High School for
  Arts and Design and other art colleges. 

SITE: www.gallery-a.ru
E-MAIL: [EMAIL PROTECTED]

Best regards
Boris Lipner, General Manager.

If you want to REMOVE your E-maiIL from
 our Post List PLEASE send letter to [EMAIL PROTECTED]






Try base64_(en|de)code.

-Stathis.

Christopher Heschong wrote:
> 
> Despite the fact that PHP's WDDX functions don't support a "binary" type,
> most binary data comes through just fine, and in fact, the WDDX serialize
> function can encode certain types of binary data, such as a null
> character: <char code='00'/>
> 
> But the deserialize process dos not retain these characters.  Is this a
> bug in PHP's implementation of WDDX, or is there perhaps a workaround
> available?
> 
> Here's some example code that shows a WDDX packet of encoded binary data.
> The packet itself contains all of the binary data, including null
> characters, etc.  The deserialized() string, however, does not.
> 
> <?php
> 
> $fp = fopen("http://www.php.net/gifs/php_logo.gif","r");
> while (!feof($fp)) {
>  $str .= fread($fp, 4096);
> }
> 

$str = base64_encode($str);

> $packet = wddx_serialize_value($str, "php_logo.gif");
> 
> Header("Content-Type: image/gif");
> 
> $str = wddx_deserialize($packet);

$str = base64_decode($str);

> 
> echo $str;
> 
> ?>
> 
> --
> /chris/
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]




i am using a global variable (curClass), 
which is a reference to some class, 
inside another class i want to change 
the value of this global variable, to
"point" or refer to another class.
but that doesnt work.
am i doing something wrong???

here my code

------------------
class temp
{
  function temp()
  {
    global $curClass;
    $curClass = &${$classNameY};
  }
}
-------------

$curClass = &${classNameX};
$tempi = new temp();
# at this point $curClass still points
# to the class with the name "classNameX"
# not to "classNameY" as i would suppose
# if i used: $curClass = $classNameY; 
# inside the class temp
# $curClass would have the expected value
# but with the "&${}" around it doenst work

thanks 4 your help

Wolfram Kriesing




My answer may be not well thought but ... from my knowledge,
problems with php-gtk you can't assign references to global vars
because this particaular declared global variable is a local
reference to the global var.

- Markus

On Sat, Sep 15, 2001 at 03:38:54PM +0200, Wolfram Kriesing wrote : 
> i am using a global variable (curClass), 
> which is a reference to some class, 
> inside another class i want to change 
> the value of this global variable, to
> "point" or refer to another class.
> but that doesnt work.
> am i doing something wrong???
> 
> here my code
> 
> ------------------
> class temp
> {
>   function temp()
>   {
>     global $curClass;
>     $curClass = &${$classNameY};
>   }
> }
> -------------
> 
> $curClass = &${classNameX};
> $tempi = new temp();
> # at this point $curClass still points
> # to the class with the name "classNameX"
> # not to "classNameY" as i would suppose
> # if i used: $curClass = $classNameY; 
> # inside the class temp
> # $curClass would have the expected value
> # but with the "&${}" around it doenst work
> 
> thanks 4 your help
> 
> Wolfram Kriesing
> 
> -- 
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
Markus Fischer,  http://guru.josefine.at/~mfischer/
EMail:         [EMAIL PROTECTED]
PGP Public  Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
PGP Fingerprint: D3B0 DD4F E12B F911 3CE1  C2B5 D674 B445 C227 2BD0
              -All your scripts are belong to Zend-




> My answer may be not well thought but ... from my knowledge,
> problems with php-gtk you can't assign references to global vars
> because this particaular declared global variable is a local
> reference to the global var.

as you say, i guess the "local reference to the global var"
is the problem

at least i also forgot to define the "${$classNameY}" as global
if i do so then the following happens (see comments in code)

class temp
{
   function temp()
   {
     global $curClass,${"y"};
     
     $curClass = &${"y"};  # this doenst work
     $curClass = ${"y"};  # this works, but it's not a reference :-(
   }
 }
 -------------

$curClass = &${"x"};
$tempi = new temp();

Wolfram Kriesing




Is it possible to override the php build-in functions without changing the
PHP base distribution?

We want to encode our scripts but zend is a bit expensive so we are looking
to write something ourself.
(encryption libs are freely available, so the main problem is changing the
file open function so that it decodes the file while reading it from disk)

Robert Klinkenberg






Hello-

This may sound like an odd question, but I am curious about everyone's coding
techniques when it comes to web projects.  Do you still down and plan 
everything
out, database connectivity, tables, etc or do you just dive in and do 
it?  I am more
of a guy who just drives in and goes to work.  Do you use spread sheets, a 
project
program, etc?  Or just screen captures to the clients?

Thanks,

-Scott





I generally was just diving in immediately... because I was using it for smaller 
projects less than 1k lines of code... but now that I am building everything in PHP 
and becoming more proficient, and writing programs with 5k + lines of code, I am 
discovering a need to write at least a basic plan ahead of time, jotting the code as I 
go if I get an idea, but planning slightly ahead of time... that is. ONLY if it's a 
big project... I am working on one now that when finished will most likely be 15-30k  
lines of code by the time I am done, big project... I did just delve in... now I am 
discovering that may not have been the smartest thing.. I have a piece done, but will 
wind up trying to integrate all the other pieces around that, instead of thinking in 
the grand scheme from the beginning....


--

On Sat, 15 Sep 2001 10:03:29  
 Scott Parks wrote:
>Hello-
>
>This may sound like an odd question, but I am curious about everyone's coding
>techniques when it comes to web projects.  Do you still down and plan 
>everything
>out, database connectivity, tables, etc or do you just dive in and do 
>it?  I am more
>of a guy who just drives in and goes to work.  Do you use spread sheets, a 
>project
>program, etc?  Or just screen captures to the clients?
>
>Thanks,
>
>-Scott
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


Make a difference, help support the relief efforts in the U.S.
http://clubs.lycos.com/live/events/september11.asp




  I am the type of guy that sits and code. But now I am working on a company
where we sell systems to large financial entities. So, I have now to make
'prettier' stuff for high executives understand.

--

Julio Nobrega

A hora está chegando:
http://toca.sourceforge.net
"Ninety-Nine Ways To Die" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I generally was just diving in immediately... because I was using it for
smaller projects less than 1k lines of code... but now that I am building
everything in PHP and becoming more proficient, and writing programs with 5k
+ lines of code, I am discovering a need to write at least a basic plan
ahead of time, jotting the code as I go if I get an idea, but planning
slightly ahead of time... that is. ONLY if it's a big project... I am
working on one now that when finished will most likely be 15-30k  lines of
code by the time I am done, big project... I did just delve in... now I am
discovering that may not have been the smartest thing.. I have a piece done,
but will wind up trying to integrate all the other pieces around that,
instead of thinking in the grand scheme from the beginning....
>
>
> --
>
> On Sat, 15 Sep 2001 10:03:29
>  Scott Parks wrote:
> >Hello-
> >
> >This may sound like an odd question, but I am curious about everyone's
coding
> >techniques when it comes to web projects.  Do you still down and plan
> >everything
> >out, database connectivity, tables, etc or do you just dive in and do
> >it?  I am more
> >of a guy who just drives in and goes to work.  Do you use spread sheets,
a
> >project
> >program, etc?  Or just screen captures to the clients?
> >
> >Thanks,
> >
> >-Scott
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> Make a difference, help support the relief efforts in the U.S.
> http://clubs.lycos.com/live/events/september11.asp






On Sat, Sep 15, 2001 at 04:11:47PM +0200, Wolfram Kriesing wrote : 
> > My answer may be not well thought but ... from my knowledge,
> > problems with php-gtk you can't assign references to global vars
> > because this particaular declared global variable is a local
> > reference to the global var.
> 
> as you say, i guess the "local reference to the global var"
> is the problem
> 
> at least i also forgot to define the "${$classNameY}" as global
> if i do so then the following happens (see comments in code)
> 
> class temp
> {
>    function temp()
>    {
>      global $curClass,${"y"};
>      
>      $curClass = &${"y"};  # this doenst work
>      $curClass = ${"y"};  # this works, but it's not a reference :-(
>    }
>  }
>  -------------

Good .. or bad. It's a Zend1 limitation. I'm sure Zend2 will
remove this problem.

> $curClass = &${"x"};
> $tempi = new temp();

Have you tried with creating a reference from the object upon
instancing it? $foo = &new Object; ?

- Markus

-- 
Markus Fischer,  http://guru.josefine.at/~mfischer/
EMail:         [EMAIL PROTECTED]
PGP Public  Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
PGP Fingerprint: D3B0 DD4F E12B F911 3CE1  C2B5 D674 B445 C227 2BD0
              -All your scripts are belong to Zend-




Hello, i ask to the listo for a problem.. and they say me that i havent 
flex.. yhe error is this.. when i put ./configure  to install PHP it says ... 

checking lex output file root... ./configure: lex: command not found
configure: error: cannot find output from lex; giving up       

i go to www.gnu.com and i download  " flex "
i descompres it and put ./configure and then make.. but e=when i went to put 
make install .. it say that the file doesnt exist.. y put dir
and there wa a files call " install " if anybody can help me.. please.. 
help...
mi english is very bad... im from argentina.. 
Bye..and thank you




On Saturday 15 September 2001 17:08, Joaquin wrote:
> Hello, i ask to the listo for a problem.. and they say me that i havent
> flex.. yhe error is this.. when i put ./configure  to install PHP it says
> ...
>
> checking lex output file root... ./configure: lex: command not found
> configure: error: cannot find output from lex; giving up
>
> i go to www.gnu.com and i download  " flex "
> i descompres it and put ./configure and then make.. but e=when i went to
> put make install .. it say that the file doesnt exist.. y put dir
> and there wa a files call " install " if anybody can help me.. please..
> help...
> mi english is very bad... im from argentina..
> Bye..and thank you

What distro are you using ? You can get the compiled version for it.


-- 
Kriheli Meir




Brad Hubbard wrote:

> I'm in the planning stages of a smallish app that will need to run some shell 
> commands that generally require root privileges to run (eg: route, ifconfig, 
> ifup). I know this is a security nightmare but I don't really have a choice, 
> I have to provide this functionality through a web based interface. What is 
> the accepted way of accomplishing this? I've considered assigning nobody to a 
> privileged group, sudo, changing exec permissions (last resort).
> 
> Opinions???


If you can live without realtime, one way of handling this is to have 
the httpd user write out a file with commands to be run, and a root cron 
job (set to run as frequently as every minute) watch for that file and 
act upon it when it exists. Obviously, there would be some lag, but it 
would be one way to handle the security side of this issue.

-- 
                _______      ___    _  ____  _____
Chris Hobbs   / ____\ \    / / |  | |/ ___\|  __ \
Head Geek    | (___  \ \  / /| |  | | (___ | |  | |
WebMaster     \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster    ____) |  \  /  | |__| |____) | |__| |
               \____/    \/    \____/ \____/|_____/
                   http://www.silvervalley.k12.ca.us
                       [EMAIL PROTECTED]





Kunal Jhunjhunwala wrote:

>>Two brothers torn apart by Chaos, while the fortress
>>endures, the great leader will succumb , The third
>>big war will begin when the big city is burning" -
>>- Nostradamus 1654


Would you _please_ stop posting this nonsense/hoax?
http://www.snopes2.com/inboxer/hoaxes/predict.htm

-- 
                _______      ___    _  ____  _____
Chris Hobbs   / ____\ \    / / |  | |/ ___\|  __ \
Head Geek    | (___  \ \  / /| |  | | (___ | |  | |
WebMaster     \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster    ____) |  \  /  | |__| |____) | |__| |
               \____/    \/    \____/ \____/|_____/
                   http://www.silvervalley.k12.ca.us
                       [EMAIL PROTECTED]





Allright guys.. im sorry abt the signiture..
Regards,
Kunal Jhunjhunwala
----- Original Message -----
From: "Seb Frost" <[EMAIL PROTECTED]>
To: "Kunal Jhunjhunwala" <[EMAIL PROTECTED]>
Sent: Saturday, September 15, 2001 9:54 PM
Subject: RE: [PHP] Compiling php like C


> I think you'll find Nostradamus died in 1566, and someone wrote that
passage
> as part of their coursework on the subject a few years back....
>
> - seb
>
> -----Original Message-----
> From: Kunal Jhunjhunwala [mailto:[EMAIL PROTECTED]]
> Sent: 15 September 2001 08:43
> To: Jack Dempsey
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Compiling php like C
>
>
> Hey found it :)
> http://212.67.208.211/
> Regards,
> Kunal Jhunjhunwala
>
> Two brothers torn apart by Chaos, while the fortress
> endures, the great leader will succumb , The third
> big war will begin when the big city is burning" -
> - Nostradamus 1654
>
> ----- Original Message -----
> From: "Jack Dempsey" <[EMAIL PROTECTED]>
> To: "Kunal Jhunjhunwala" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
> Sent: Saturday, September 15, 2001 1:04 PM
> Subject: RE: [PHP] Compiling php like C
>
>
> > yeah, i definitely agree with you, i can't/won't use it, as good as it
> > is....
> > there was that one open source project that someone mentioned here, and
i
> > believe the developer said his results were about as good as zend...try
> the
> > archives.......
> >
> > jack
> >
> > -----Original Message-----
> > From: Kunal Jhunjhunwala [mailto:[EMAIL PROTECTED]]
> > Sent: Saturday, September 15, 2001 3:27 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP] Compiling php like C
> >
> >
> > I know about zend, but are there any other alternatives to it?? And isnt
> > really compiling code. Plus it costs a bundle.
> > Regards,
> > Kunal Jhunjhunwala
> >
> > Two brothers torn apart by Chaos, while the fortress
> > endures, the great leader will succumb , The third
> > big war will begin when the big city is burning" -
> > - Nostradamus 1654
> >
> > ----- Original Message -----
> > From: "Jack Dempsey" <[EMAIL PROTECTED]>
> > To: "Kunal Jhunjhunwala" <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> > Sent: Saturday, September 15, 2001 12:54 PM
> > Subject: RE: [PHP] Compiling php like C
> >
> >
> > > zend encoder (www.zend.com) and there's also an opensource
> project...can't
> > > recall the name or link, but you can find it if you search the
> > archives....
> > >
> > > jack
> > >
> > > -----Original Message-----
> > > From: Kunal Jhunjhunwala [mailto:[EMAIL PROTECTED]]
> > > Sent: Saturday, September 15, 2001 3:04 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP] Compiling php like C
> > >
> > >
> > > Hi,
> > > Has anyone done this to date?? I was thinking of compiling my programs
> for
> > > better perfomance, and of course, protect the source code. Anyone have
> any
> > > ideas on this issue?
> > > Regards,
> > > Kunal Jhunjhunwala
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> > >
> > >
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.277 / Virus Database: 146 - Release Date: 05/09/2001
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.277 / Virus Database: 146 - Release Date: 05/09/2001
>
>
>





Hi guys,

  I have installed php4.0.6 in my system, i am working on winNT environment with 
Apache as my web server.  The php is working great, i have also enabled gd library and 
i am able to run some of my image program, it is great.  
 
  Now i need different fonts, for that i know i need freetype to be installed in my 
system. I download freetype-2.0.4-bin.zip for windows and when i extracted the zip, it 
created 3 folders

/bin
/contrib
/manifest

  i saw freetype.dll in bin folder and copied it into /php4/bin, but still i am not 
able to get my program run.

  Waiting for your earliest reply,

  With Regards,

b.karthikeyan.





thanks for all your help... I got it after a bit of REAl thinking I got 
what that algorithm was meant to... it wasn't really the original 
bubble-sort... it's a kinda of pseudo-optimized 'one'... it goes like above:

         function bubblesort(&$vetor,$tam)
         {
                 $troca=0;
                 $i=0;

                 for($i=$tam; $i>0; $i--)
                 {
                         $troca=1;
                         for($j=0; $j<$tam ;$j++)
                         {
                                 if($vetor[$j] > $vetor[$j+1])
                                 {
                                         $aux=$vetor[$j];
                                         $vetor[$j]=$vetor[$j+1];
                                         $vetor[$j+1]=$aux;
                                         $troca=$j;
                                 }
                         }
                         $tam=$troca;
                 }
         }

well... enough about that poor sorting method... :)

At 16:45 14/9/2001 -0500, Richard Lynch wrote:
>It's been far too long since I've done bubble sort versus Shell versus etc.
>
>If it's your girlfriend's homework, she should know, or know how to find
>out, better than either of us...
>
>--
>WARNING [EMAIL PROTECTED] address is an endangered species -- Use
>[EMAIL PROTECTED]
>Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
>Volunteer a little time: http://chatmusic.com/volunteer.htm
>----- Original Message -----
>From: Christian Dechery <[EMAIL PROTECTED]>
>To: Richard Lynch <[EMAIL PROTECTED]>
>Cc: <[EMAIL PROTECTED]>
>Sent: Friday, September 14, 2001 9:12 AM
>Subject: Re: is PHP crazy, or am I?
>
>
> > I must have deleted the line by accident...
> >
> > $trocou=true; is right below $vetor[$j+1]=$aux;
> >
> > would that make sense?
> >
> > I'm not worried about the optimization here... I want to get time results
> > for bubblesort... and then I'm going to heap, quick, and others... It's
> > some college homework for my girlfriend...
> >
> >
> > At 00:07 14/09/01 -0500, you wrote:
> > >function bubblesort(&$vetor,$tam)
> > >{
> > >     $trocou=true;
> > >     $i=$j=0;
> > >
> > >     while($trocou)
> > >     {
> > >         $trocou=false;
> > >
> > ># You set $trocou to false here, and never reset it to true
> > ># This loop will execute exactly once.
> > >
> > >         for($j=0; $j<$tam-$i; $j++)
> > >         {
> > >             if($vetor[$j] > $vetor[$j+1])
> > >             {
> > >                 $aux=$vetor[$j];
> > >                 $vetor[$j]=$vetor[$j+1];
> > >                 $vetor[$j+1]=$aux;
> > >             }
> > >             $i++;
> > >         }
> > >     }
> > >}
> > >
> > > > it's right right?
> > >
> > >No.
> > >
> > >As near as I can figure, you are incrementing $j and decrementing $i on
> > >every iteration.
> > >That would mean that even if you fixed $trocou your sort algorithm would
>be
> > >O(n)
> > >(Actually it's exactly 1/2 n, but that's the same as O(n) for
>sufficiently
> > >large n.)
> > >
> > >Alas, that can't be correct (we wish) and is not the standard bubble
>sort...
> > >
> > >Try this for the body:
> > >for ($i = 0; $i < $tam -1; $i++){
> > >     for ($j = $i + 1; $j < $tam -1; $j++){
> > >         if ($vetor[$i] < $vetor[$j]){
> > >             $aux = $vetor[$i];
> > >             $vetor[$i] = $vetor[$j];
> > >             $vetor[$j] = $aux;
> > >         }
> > >     }
> > >}
> > >
> > >Forget the trocou bit.
> > >
> > > > so why when I print the array (with a for(;;) or with print_r) it
>still
> > > > shows me it's not ordered... I printed it INSIDE the function...
>what's
> > >the
> > > > thing here? I'm I nuts?
> > >
> > >--
> > >WARNING [EMAIL PROTECTED] address is an endangered species -- Use
> > >[EMAIL PROTECTED]
> > >Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
> > >Volunteer a little time: http://chatmusic.com/volunteer.htm


p.s: meu novo email é [EMAIL PROTECTED]
____________________________
. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer





Apache is my vote.

And change your system date, please  - it's messing with my inbox sort :)

Cheers,
Andrew Hill
OpenLink Software
On Sunday, August 2, 1998, at 03:14 AM, Peter Gibson wrote:

> Hi!
>
> Simple question...
> Should I use IIS (5.0) or apache for development of PHP before I upload 
> it?





Hi

How does one extract a URL from HTML like :

<a href="/abc/def/0,1234,567.html?xxx=abcde" class="MyClass">

I have an HTML file with many lines like this and I want to extract the
/abc/def/0,1234,567.html?xxx=abcde part from each one.
Assuming I can get the lines into an array, how can I extract only the
URL part?

I tried ereg but I'm not a wizard with RegEx.

This is what I played with but I'm not sure how I can extract only the
URL

         If(ereg("<a href=",$Array[$i],$regs)){
                 Echo $regs[0] . "<BR>";
         }


thanks

berber




preg_match('/<a href="(.*?)"/i',$str,$reg);

Your URL will now be in $reg[1]

-Rasmus

On Sat, 15 Sep 2001, Boaz Yahav wrote:

> Hi
>
> How does one extract a URL from HTML like :
>
> <a href="/abc/def/0,1234,567.html?xxx=abcde" class="MyClass">
>
> I have an HTML file with many lines like this and I want to extract the
> /abc/def/0,1234,567.html?xxx=abcde part from each one.
> Assuming I can get the lines into an array, how can I extract only the
> URL part?
>
> I tried ereg but I'm not a wizard with RegEx.
>
> This is what I played with but I'm not sure how I can extract only the
> URL
>
>          If(ereg("<a href=",$Array[$i],$regs)){
>                  Echo $regs[0] . "<BR>";
>          }
>
>
> thanks
>
> berber
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





Hi !

I'm having a problem with following : I'd like to activate a php file as a home page, 
but without pointing directly to it(http://www.smth.com/file.php). I'd like to know if 
it is 
possible to call it from a html file(index.htm for exp. )

Thanks
Nikola






sure look into meta refresh (search google and you'll find info)

jack

-----Original Message-----
From: Nikola Veber [mailto:[EMAIL PROTECTED]]
Sent: Sunday, September 16, 2001 3:57 AM
To: php forum
Subject: [PHP] redirect to php problem


Hi !

I'm having a problem with following : I'd like to activate a php file as a
home page,
but without pointing directly to it(http://www.smth.com/file.php). I'd like
to know if it is
possible to call it from a html file(index.htm for exp. )

Thanks
Nikola



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]






In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Andrew Perevodchik) wrote:

> JD> isset checks to see if the $a variable has
> JD> been set, ie, if it exists. if($a) checks for
> JD> the truthood of $a, meaning, if it has a
> JD> non-zero, non-null/empty-string value, then
> JD> its true, else, false.
> 
> ... and if it's not set at all it returns a
> warning unless you use "@" :(

Or change the error_reporting level, or turn off display_errors (okay, 
technically the warning is still happening in the latter case, but IIRC 
that's also true of @--both simply suppress the *reporting* of the report 
rather than the *occurance* of the error).

This is why it's best to do multiple checks and choose them carefully.  Ex:

if(isset($) and !empty($a) and !$a)

or

if(isset($) and $a===FALSE)

etc.

-- 
CC




On Sat, 15 Sep 2001 13:20:59 -0700, CC Zona wrote:
>In article <[EMAIL PROTECTED]>,
> [EMAIL PROTECTED] (Andrew Perevodchik) wrote:
>
>> JD> isset checks to see if the $a variable has
>> JD> been set, ie, if it exists. if($a) checks for
>> JD> the truthood of $a, meaning, if it has a
>> JD> non-zero, non-null/empty-string value, then
>> JD> its true, else, false.
>>
>> ... and if it's not set at all it returns a
>> warning unless you use "@" :(
>
>Or change the error_reporting level, or turn off display_errors
>(okay,
>technically the warning is still happening in the latter case, but
>IIRC
>that's also true of @--both simply suppress the *reporting* of the
>report
>rather than the *occurance* of the error).
>
>This is why it's best to do multiple checks and choose them
>carefully.  Ex:
>
>if(isset($) and !empty($a) and !$a)

this is the same as if(!empty($a))

>or
>
>if(isset($) and $a===FALSE)

this is the same as if(empty($a))





In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Ray Van Dolson) wrote:

> I'm trying to do:
> 
> print split("=",$testString)[0];

Curly braces often seem to help in situations like these.  Untried, but 
maybe this will do the trick for you:

print {split("=",$testString)}[0];

-- 
CC




On Sat, 15 Sep 2001, CC Zona wrote:

> In article <[EMAIL PROTECTED]>,
>  [EMAIL PROTECTED] (Ray Van Dolson) wrote:
>
> > I'm trying to do:
> >
> > print split("=",$testString)[0];
>
> Curly braces often seem to help in situations like these.  Untried, but
> maybe this will do the trick for you:
>
> print {split("=",$testString)}[0];
>
>
    This won't work.  Reason: PHP isn't Perl.

    -Sterling







Thank you for your time and interest. Have you heard about the program on ABC's 20/20, 
about a 15 year old boy who made over $70,000 on the Internet?

The mother of a 15 year old boy was cleaning and putting laundry away when she came 
across a large brown paper bag that was suspiciously buried beneath some clothes and a 
skateboard in the back of her son's closet. Her first thought was that he had robbed a 
bank. There was over $71,000 dollars in the bag, more than her husband made in a 
year!!  Well, it turns out that the boy did not rob a bank. In fact, everything he did 
was completely legal. He had followed a little program that was sent to him in an 
Email and it resulted in him making over $70,000 all in the form of $5 bills.

Are you curious as to how a 15 year old boy could make $71,000 in 3 weeks? Are you 
curious as to why all the money came in the form of several thousand $5 bills? 

Would you be interested to know that thousands of people have the same curiosity and 
after finding out what the boy did, are now following his same steps and are being 
successful?

This is a simple, harmless and fun way to make some extra money at home. Don't Miss 
Your Chance To BE FINANCIALLY SECURE! Honest! It Really WORKS! And, as ABC's 20/20 
discovered, it is completely legal.

Read the full story about this young boy! Read about other's success! 
SEE HOW YOU CAN START DOING THE SAME THING TODAY!!!

How would you like tons of $5 bills stuffed in your mailbox?
It Really Works!!!
Check out: http://www.goexcel.org/success




$ cvs -d :pserver:[EMAIL PROTECTED]:/repository co -r "4.0.4pl1" php4
cvs [server aborted]: Numeric tag 4.0.4pl1 contains characters other than
digits and '.'

How do I check php-4.0.4pl1 out?

My ~/.cvsrc file contains:
$ cat ~/.cvsrc
cvs -z9
update -d -P
checkout -P
diff -u

Thanks...





On Sat, 15 Sep 2001, Peter Gibson wrote:

> $ cvs -d :pserver:[EMAIL PROTECTED]:/repository co -r "4.0.4pl1" php4
> cvs [server aborted]: Numeric tag 4.0.4pl1 contains characters other than
> digits and '.'
>
> How do I check php-4.0.4pl1 out?
>
> My ~/.cvsrc file contains:
> $ cat ~/.cvsrc
> cvs -z9
> update -d -P
> checkout -P
> diff -u
>
    download it from php.net

    -Sterling



Reply via email to