php-general Digest 9 Jun 2003 04:23:54 -0000 Issue 2106

Topics (messages 150673 through 150699):

Re: A Question with heredoc
        150673 by: Richard Baskett

can't call htpasswd using PHP
        150674 by: Billy

Re: HARDWARE ID WITH PHP
        150675 by: Marek Kilimajer

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in 
f:\.....\none.php on line 286
        150676 by: Marcelo Luiz de Laia
        150677 by: Marcelo Luiz de Laia
        150678 by: Thomas Seifert

Re: file upload script
        150679 by: Rodney Green
        150680 by: Rodney Green
        150683 by: Philip Olson

callback function via preg_replace_callback
        150681 by: Henry H. Tan-Tenn
        150697 by: David Otton

Re: Linux vs. Windows
        150682 by: AzFLSite

filter out with date?
        150684 by: A. Lyse
        150693 by: John W. Holmes

Rateing script
        150685 by: Ryan A

PHPBB and EZBOARD.COM
        150686 by: Miranda, Joel Louie M
        150696 by: Miranda, Joel Louie M

Need a safe way to get user supplied data into a varaible.
        150687 by: Simon Coggins
        150688 by: Lars Torben Wilson
        150689 by: Leif K-Brooks

Re: IE Pagelength issue
        150690 by: Larry Brown

Session Newbie Question: Cookieless sessions
        150691 by: Info.Best-IT
        150692 by: John W. Holmes

Re: A recommended barcode program
        150694 by: Manuel Lemos

Hi I get some problems while using eregi_replace
        150695 by: winst0n

Execute command which has root privileges
        150698 by: vijaypatel

reading a file into variable for using in a javascript
        150699 by: Charles Kline

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 ---
Im not sure if this is your problem, but it was mine awhile ago :)

Make sure there are no spaces after closing off heredoc.. so on your line:

EOF;

Make sure there is nothing except a hard return, no spaces, no characters..
nothing!

Cheers!

Rick

"By three methods we may learn wisdom: First, by reflection which is
noblest; second, by imitation, which is the easiest; and third, by
experience, which is the bitterest." - Confucius

> From: Simon Coggins <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> Date: Sun, 8 Jun 2003 19:10:06 +1000
> To: [EMAIL PROTECTED]
> Subject: [PHP] A Question with heredoc
> 
> Hi
> I'm writing a wrapper for some mailman archives and i'm trying to put
> them message into a variable as in:
> 
> $body = <<<EOF
> text here.....
> EOF;
> 
> But I'm getting an error because of some charactors. ^L to be
> specific. If the text contains a control char I get:
> 
> Code:
> <pre>            
> <?               
> $test = <<<EOF  
> line 1  
> ^L              
> line 2  
> EOF;            
> echo $test;      
> ?>               
> </pre>   
> 
> Error:
> Warning: Unexpected character in input: '' (ASCII=12) state=5 in
> test.html on line 6
> 
> Is there any way I can stop it complaining about it. Or is there
> another way I can put the the text into the string (it's done via a
> template file and a string substitution). The contents could be
> anything so I thougth heredoc would work..
> 
> Thanks in advance.. I'm not on the list so please reply to me directly.
> 
> Regards
> Simon
> 
> -- 
> Simon Coggins (SAGE-AU Member)                Email: [EMAIL PROTECTED]
> Network and System Management Officer         Phone: +61-2-4221-3775
> Information Technology Systems (ITS)          Mobile: 0408 115861
> University of Wollongong, 2522, Australia     Fax:   +61-2-4229-1985
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


--- End Message ---
--- Begin Message ---
Dear all,

i can't call the "htpasswd" command after i used RedHat 8  ( which i can do
so in Red Hat 7.2)

do u have any idea/ suggestion?

thx a lot
HPS



--- End Message ---
--- Begin Message --- You need to execute an external program (hdparm in linux) and catch its output.

nabil wrote:
Can anyone tell me if i can get the Hardisk serial number, by php code?





--- End Message ---
--- Begin Message ---
What this message means?

What it is the error?

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result
resource in f:\.....\none.php on line 286


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.488 / Virus Database: 287 - Release Date: 5/6/2003


--- End Message ---
--- Begin Message ---
What this message means?

What it is the error?

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result
resource in f:\.....\none.php on line 42

This is the code.

Thanks very much.

Marcelo


<?php

if (eregi("block-Concurso.php", $PHP_SELF)) {
    Header("Location: index.php");
    die();
}

$usemarquee = 1;
$scrolldirection = "left";

global $prefix, $multilingual, $currentlang, $dbi;

$sql = "DELETE FROM ".$prefix."_anuncios WHERE datafim<NOW()";
sql_query($sql, $dbi);

if ($multilingual == 1) {
    $querylang = "WHERE (alanguage='$currentlang' OR alanguage='')";
} else {
    $querylang = "";
}
$result = "SELECT categoria, nombre, datafim FROM ".$prefix."_anuncios ORDER
BY datafim LIMIT 0,30";
sql_query($result, $dbi);
$content = "<table  width=\"100%\" border=\"0\">";
$content .="<center> <STYLE=\"text-decoration: none\"><font
color=\"#666666\"><b>Últimos 10 Concursos</b></center>";
$content .= "<Marquee Behavior=\"Scroll\" Direction=\"$scrolldirection\"
$width=\"100%\" ScrollAmount=\"3\" ScrollDelay=\"90\"
onMouseOver=\"this.stop()\" onMouseOut=\"this.start()\">";

\\ line 42
while (list($categoria, $nombre, $datafim, $counter) =
mysql_fetch_row($result, $dbi)) {

$content .= "<img src=blocks/images/diamond.gif>&nbsp;<a
href=\"modules.php?name=Concurso\"><font color=\"#096C88\"><b>$categoria
<br> $nombre</b></a>&nbsp;";

}

$content .= "</table>";

?>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.488 / Virus Database: 287 - Release Date: 5/6/2003


--- End Message ---
--- Begin Message ---
why are you using "sql_query" through your code?
its
mysql_query for mysql!
and the result, needed for mysql_fetch_row is returned from that function.
read the docs again.


Thomas

On Sun, 8 Jun 2003 16:37:59 -0300 [EMAIL PROTECTED] (Marcelo Luiz De Laia) wrote:

> $result = "SELECT categoria, nombre, datafim FROM ".$prefix."_anuncios ORDER
> BY datafim LIMIT 0,30";
> sql_query($result, $dbi);


--- End Message ---
--- Begin Message ---
Thanks Philip. I'm now using the code below to upload. What I'm seeing is
that the file is uploaded and placed into the /tmp directory but is not
being moved to the /PIVOT directory. It just disappears after a few seconds
and can't be found in either directory. Any ideas why?

Thanks again,
Rod


----- Original Message ----- 
From: "Philip Olson" <[EMAIL PROTECTED]>
To: "Rodney Green" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, June 08, 2003 1:21 AM
Subject: Re: [PHP] file upload script


>
> By no errors, do you mean you have a PHP version greater
> than PHP 4.2.0 and checked the ['error'] code, and it
> has a value of 0?  Are you sure you want the filename
> to be $file_name?  I doubt you do.
>
> Regards,
> Philip
>
> ref: http://www.php.net/features.file-upload
>
> On Sat, 7 Jun 2003, Rodney Green wrote:
>
> > Hello. I'm attempting to upload a file using the script below and I'm
not
> > having any success. The temp directory I'm using does exist and is
> > writeable. When I browse for the file then hit the send button it
appears to
> > be working then displays the form again with no errors. I look for the
file
> > on the server and it isn't there. Any advice on how to get this working?
> >
> > Thanks!
> > Rod
> >
> >
> > ---------------------------------------------------------------
> >
> > <html>
> > <head>
> > <title>Listing 9.14 A file upload script</title>
> > </head>
> > <?php
> > $file_dir = "/home/corrdev/htdocs/php24/scrap/uploads";
> > $file_url = "http://corros.colo.hosteurope.com/dev/php24/scrap/uploads";;
> >
> > foreach( $HTTP_POST_FILES as $file_name => $file_array ) {
> >  print "path: ".$file_array['tmp_name']."<br>\n";
> >  print "name: ".$file_array['name']."<br>\n";
> >  print "type: ".$file_array['type']."<br>\n";
> >  print "size: ".$file_array['size']."<br>\n";
> >
> >  if ( is_uploaded_file( $file_array['tmp_name'] )
> >   && $file_array['type'] == "image/gif" ) {
> >   move_uploaded_file( $file_array['tmp_name'], "$file_dir/$file_name")
> >    or die ("Couldn't copy");
> >   print "<img src=\"$file_url/$file_name\"><p>\n\n";
> >  }
> > }
> >
> > ?>
> > <body>
> > <form enctype="multipart/form-data" method="POST">
> > <input type="hidden" name="MAX_FILE_SIZE" value="51200">
> > <input type="file" name="fupload"><br>
> > <input type="submit" value="Send file!">
> > </form>
> > </body>
> > </html>
> >
> >
> >
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>



--- End Message ---
--- Begin Message ---
Sorry, here's the code:

<form name="form1" method="post" action="" enctype="multipart/form-data">
<input type="file" name="imagefile">
<br>
<input type="submit" name="Submit" value="Submit">

<?php
$filesdir = "/PIVOT";

echo $_FILES['imagefile']['name'];
echo $_FILES['imagefile']['tmp_name'];

if(isset( $Submit )) {



if ($_FILES['imagefile']['type'] == "image/gif") {

copy ($_FILES['imagefile']['tmp_name'],
"$filesdir/".$_FILES['imagefile']['name'])
        or die ("Could not copy");


echo "<br><br>";
        echo "Name: ".$_FILES['imagefile']['name']."<br>";
        echo "Size: ".$_FILES['imagefile']['size']."<br>";
        echo "Type: ".$_FILES['imagefile']['type']."<br>";
        echo "Copy Done....";
        }


else
{
echo "<br><br>";
echo "Could Not Copy, Wrong Filetype
(".$_FILES['imagefile']['name'].")<br>";
}
}


?>

</form>


----- Original Message ----- 
From: "Philip Olson" <[EMAIL PROTECTED]>
To: "Rodney Green" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, June 08, 2003 1:21 AM
Subject: Re: [PHP] file upload script


>
> By no errors, do you mean you have a PHP version greater
> than PHP 4.2.0 and checked the ['error'] code, and it
> has a value of 0?  Are you sure you want the filename
> to be $file_name?  I doubt you do.
>
> Regards,
> Philip
>
> ref: http://www.php.net/features.file-upload
>
> On Sat, 7 Jun 2003, Rodney Green wrote:
>
> > Hello. I'm attempting to upload a file using the script below and I'm
not
> > having any success. The temp directory I'm using does exist and is
> > writeable. When I browse for the file then hit the send button it
appears to
> > be working then displays the form again with no errors. I look for the
file
> > on the server and it isn't there. Any advice on how to get this working?
> >
> > Thanks!
> > Rod
> >
> >
> > ---------------------------------------------------------------
> >
> > <html>
> > <head>
> > <title>Listing 9.14 A file upload script</title>
> > </head>
> > <?php
> > $file_dir = "/home/corrdev/htdocs/php24/scrap/uploads";
> > $file_url = "http://corros.colo.hosteurope.com/dev/php24/scrap/uploads";;
> >
> > foreach( $HTTP_POST_FILES as $file_name => $file_array ) {
> >  print "path: ".$file_array['tmp_name']."<br>\n";
> >  print "name: ".$file_array['name']."<br>\n";
> >  print "type: ".$file_array['type']."<br>\n";
> >  print "size: ".$file_array['size']."<br>\n";
> >
> >  if ( is_uploaded_file( $file_array['tmp_name'] )
> >   && $file_array['type'] == "image/gif" ) {
> >   move_uploaded_file( $file_array['tmp_name'], "$file_dir/$file_name")
> >    or die ("Couldn't copy");
> >   print "<img src=\"$file_url/$file_name\"><p>\n\n";
> >  }
> > }
> >
> > ?>
> > <body>
> > <form enctype="multipart/form-data" method="POST">
> > <input type="hidden" name="MAX_FILE_SIZE" value="51200">
> > <input type="file" name="fupload"><br>
> > <input type="submit" value="Send file!">
> > </form>
> > </body>
> > </html>
> >
> >
> >
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>



--- End Message ---
--- Begin Message ---
What PHP version?  You should rewrite your code to more
reflect what's being used in the manual.

  a) use move_uploaded_file() and not copy()
  b) check what ['error'] has to say
  c) set action in the form
  d) print_r($_FILES) is great for debugging
  e) only show the form is it's not yet submitted,
     or at least print something only if the form
     hasn't yet submitted so you know... debug. As
     for all know, $Submit may never be set.

Regards,
Philip



On Sun, 8 Jun 2003, Rodney Green wrote:

> Sorry, here's the code:
> 
> <form name="form1" method="post" action="" enctype="multipart/form-data">
> <input type="file" name="imagefile">
> <br>
> <input type="submit" name="Submit" value="Submit">
> 
> <?php
> $filesdir = "/PIVOT";
> 
> echo $_FILES['imagefile']['name'];
> echo $_FILES['imagefile']['tmp_name'];
> 
> if(isset( $Submit )) {
> 
> 
> 
> if ($_FILES['imagefile']['type'] == "image/gif") {
> 
> copy ($_FILES['imagefile']['tmp_name'],
> "$filesdir/".$_FILES['imagefile']['name'])
>         or die ("Could not copy");
> 
> 
> echo "<br><br>";
>         echo "Name: ".$_FILES['imagefile']['name']."<br>";
>         echo "Size: ".$_FILES['imagefile']['size']."<br>";
>         echo "Type: ".$_FILES['imagefile']['type']."<br>";
>         echo "Copy Done....";
>         }
> 
> 
> else
> {
> echo "<br><br>";
> echo "Could Not Copy, Wrong Filetype
> (".$_FILES['imagefile']['name'].")<br>";
> }
> }
> 
> 
> ?>
> 
> </form>
> 
> 
> ----- Original Message ----- 
> From: "Philip Olson" <[EMAIL PROTECTED]>
> To: "Rodney Green" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Sunday, June 08, 2003 1:21 AM
> Subject: Re: [PHP] file upload script
> 
> 
> >
> > By no errors, do you mean you have a PHP version greater
> > than PHP 4.2.0 and checked the ['error'] code, and it
> > has a value of 0?  Are you sure you want the filename
> > to be $file_name?  I doubt you do.
> >
> > Regards,
> > Philip
> >
> > ref: http://www.php.net/features.file-upload
> >
> > On Sat, 7 Jun 2003, Rodney Green wrote:
> >
> > > Hello. I'm attempting to upload a file using the script below and I'm
> not
> > > having any success. The temp directory I'm using does exist and is
> > > writeable. When I browse for the file then hit the send button it
> appears to
> > > be working then displays the form again with no errors. I look for the
> file
> > > on the server and it isn't there. Any advice on how to get this working?
> > >
> > > Thanks!
> > > Rod
> > >
> > >
> > > ---------------------------------------------------------------
> > >
> > > <html>
> > > <head>
> > > <title>Listing 9.14 A file upload script</title>
> > > </head>
> > > <?php
> > > $file_dir = "/home/corrdev/htdocs/php24/scrap/uploads";
> > > $file_url = "http://corros.colo.hosteurope.com/dev/php24/scrap/uploads";;
> > >
> > > foreach( $HTTP_POST_FILES as $file_name => $file_array ) {
> > >  print "path: ".$file_array['tmp_name']."<br>\n";
> > >  print "name: ".$file_array['name']."<br>\n";
> > >  print "type: ".$file_array['type']."<br>\n";
> > >  print "size: ".$file_array['size']."<br>\n";
> > >
> > >  if ( is_uploaded_file( $file_array['tmp_name'] )
> > >   && $file_array['type'] == "image/gif" ) {
> > >   move_uploaded_file( $file_array['tmp_name'], "$file_dir/$file_name")
> > >    or die ("Couldn't copy");
> > >   print "<img src=\"$file_url/$file_name\"><p>\n\n";
> > >  }
> > > }
> > >
> > > ?>
> > > <body>
> > > <form enctype="multipart/form-data" method="POST">
> > > <input type="hidden" name="MAX_FILE_SIZE" value="51200">
> > > <input type="file" name="fupload"><br>
> > > <input type="submit" value="Send file!">
> > > </form>
> > > </body>
> > > </html>
> > >
> > >
> > >
> > > -- 
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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

I have Function A containing a preg_replace_callback calling Function B.
The code works quite nicely.

Now, is there a way for the callback function (B) to receive *additional*
arguments
(from A), so that, for example, it may optionally perform additional tasks?
If not, is there a way for B to otherwise access arguments passed to A, for
the same purpose?

Thanks.

--H. Tan-Tenn








--- End Message ---
--- Begin Message ---
On Sun, 08 Jun 2003 16:25:19 -0400, you wrote:

>I have Function A containing a preg_replace_callback calling Function B.
>The code works quite nicely.
>
>Now, is there a way for the callback function (B) to receive *additional*
>arguments
>(from A), so that, for example, it may optionally perform additional tasks?
>If not, is there a way for B to otherwise access arguments passed to A, for
>the same purpose?

I'm pretty sure it's not possible, and I've asked similar questions before.

You could try generating the callback function /within/ A, using PHP's
equivalent of lambda functions:

http://www.php.net/manual/en/function.create-function.php


--- End Message ---
--- Begin Message ---
Ok the results are in heh :) With W2k the times were
faster than on .NET but varied a lot. Ranging as low
as .9 to as high as 2 full seconds. Ouch! So I got
Mandrake 9 back up and with php 4.2.3 and mysql 4 I am
back to the faster times. Heck even getting .007 on a
regular bases. I still need to install Zend or ZPC.
Anyone have any input on which is better to install?
Zend or APC that is.

Thanks
Silly


--- DvDmanDT <[EMAIL PROTECTED]> wrote:
> Thanks, this sorta draws my intrest now... Also, I'm
> a bit outdated on the
> microsoft front... Has windows gone opensource?
> 
> 
> "Azflsite" <[EMAIL PROTECTED]> skrev i meddelandet
>
news:[EMAIL PROTECTED]
> > Thanks everyone for your replies.
> >
> > I did test on the same server. I had .NET
> installed
> > and tested. Then installed Linux on same box. The
> box
> > is a p4 1.7 gig with 512 ddr with a 30 gig 7200rpm
> hdd
> >
> > Im going to drop to win2k and see the results. I
> will
> > post results here if anyone cares.
> >
> > Silly
> > --- DvDmanDT <[EMAIL PROTECTED]> wrote:
> > > It's quite suprising how fast my PHP (and Perl)
> is
> > > under WinME/Apache
> > > 1.3.27/PHP 4.3.2... It's unstable as F though so
> not
> > > way to recommended...
> > >
> > > I was intrested in your server specs? How much
> RAM?
> > > And so on... And was the
> > > tests on the same server or did I missunderstand
> > > something?
> > > "Azflsite" <[EMAIL PROTECTED]> skrev i
> meddelandet
> > >
> >
>
news:[EMAIL PROTECTED]
> > > > Thought I throw in my post from the forums
> into
> > > this
> > > > mailing list:
> > > >
> > > > Just wanted to give my results on this test I
> did.
> > > > First the story. I will be hosting sites on my
> > > server
> > > > and decided to go with .NET/Win2003, with IIS.
> > > Well
> > > > most sites are php based or perl with mysql
> > > backend.
> > > > After configuring everything I gave it a test
> from
> > > > another system externally. i did that and
> noticed
> > > it
> > > > was slow. Slower compared to the linux box I
> > > currently
> > > > have the site on for testing purposes on
> another
> > > > provider. Heck even while statements without
> > > hitting
> > > > the DB were giving delays that were over 10
> > > seconds!
> > > >
> > > > Wooa I couldnt believe it. So I decided to add
> a
> > > code
> > > > snippet to get the seconds of script
> execution. I
> > > did
> > > > this off a query with 12 results that echoed
> out
> > > into
> > > > html. Now with Linux I came up with numbers
> like:
> > > >
> > > > 0.0163360
> > > >
> > > >
> > > > The above number was pretty consistent. Now
> onto
> > > > Windows 2003 .NET. On the same page with the
> same
> > > > output:
> > > >
> > > > 2.6936080
> > > > 0.9500151
> > > > 4.9112860
> > > > 0.6226690
> > > > 0.6032619
> > > >
> > > > Wooa!! But this cant be true. I have had Win2k
> > > host
> > > > php sites before and it seemed faster then
> .NET.
> > > But
> > > > these are the results so far. So with this my
> > > thoughts
> > > > of cause are:
> > > >
> > > > a) Windows just plain sucks with open source
> > > > b) .NET doesnt seem to allow cgi, only ISAPI.
> > > Perhaps
> > > > ISAPI is slowing it down
> > > > c) In Linux Im using Apache, where in Windows
> Im
> > > using
> > > > IIS
> > > > d) The .NET OS is a beta and that could be the
> > > issue
> > > > e) My code just sucks. But why would it be
> faster
> > > on
> > > > Linux then?
> > > >
> > > > Any thoughts on the possibilities I have shown
> > > here?
> > > >
> > > > The Chaos
> > > >
> > > > __________________________________
> > > > Do you Yahoo!?
> > > > Yahoo! Calendar - Free online calendar with
> sync
> > > to Outlook(TM).
> > > > http://calendar.yahoo.com
> > >
> > >
> > >
> > > -- 
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit:
> http://www.php.net/unsub.php
> > >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Calendar - Free online calendar with sync
> to Outlook(TM).
> > http://calendar.yahoo.com
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

--- End Message ---
--- Begin Message ---
I got the array info: on the articles:
Array
(
    [0] => ingress Object
        (
            [artikkelid] => 241
            [nettstedid] => 11
            [gyldig] => 1
            [overskrift] => motorsport formel1
            [artikkellink] => art.php?artikkelid=241
            [forfatternavn] => Aleksander Lyse
            [forfatterlink] => http://www.ikke.no/
            [ingress] => Formel1
            [publisertLang] => 20030530135301
            [publisert] => 2003 30/05
            [bilde] =>
            [artikkeltypeid] => 38
        )

The code I use to feed the articles are:

if($ingresser =
hentIngresser($nettstedid,37,$sprakid,$offsetannet,$antal1ingress))
        listIngresser1($ingresser);

How can I only show the articles from eg. 2003 01/06 - 2003 31/6

Regards
A. Lyse



--- End Message ---
--- Begin Message ---
> I got the array info: on the articles:
> Array
> (
>     [0] => ingress Object
>         (
>             [artikkelid] => 241
>             [nettstedid] => 11
>             [gyldig] => 1
>             [overskrift] => motorsport formel1
>             [artikkellink] => art.php?artikkelid=241
>             [forfatternavn] => Aleksander Lyse
>             [forfatterlink] => http://www.ikke.no/
>             [ingress] => Formel1
>             [publisertLang] => 20030530135301
>             [publisert] => 2003 30/05
>             [bilde] =>
>             [artikkeltypeid] => 38
>         )
> 
> The code I use to feed the articles are:
> 
> if($ingresser =
> hentIngresser($nettstedid,37,$sprakid,$offsetannet,$antal1ingress))
>         listIngresser1($ingresser);
> 
> How can I only show the articles from eg. 2003 01/06 - 2003 31/6

Wouldn't it be smarter to only fill this array with items matching the
date you want in the first place??

Anyhow...now you'll have to loop through each "ingress Object" and see
if substr($obj->publisert,-2) matches the month you want. 

---John W. Holmes...

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

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



--- End Message ---
--- Begin Message ---
Hi,
I am creating a host directory and have decided to add a "rate this host"
kind of option to each of the hosts to make decision time a bit easier....,
I have visited hotscripts and the like searching for a good one (ex. like
the one they are using) but unable to find one....any of you guys have any
idea/s?

The closest i got was this from google
http://www.hotscripts.com/Detailed/16425.html but that again gave me a 404
page :-(

What do ya think?

Cheers,
-Ryan


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

Has anyone got an idea how to migrate the things in ezboard.com to phpbb
forum?

Thanks,
Louie

--- End Message ---
--- Begin Message ---
Got an idea.

Brb.
Louie

-----Original Message-----
From: Miranda, Joel Louie M 
Sent: Monday, June 09, 2003 8:04 AM
To: [EMAIL PROTECTED]
Subject: [PHP] PHPBB and EZBOARD.COM


Hello,

Has anyone got an idea how to migrate the things in ezboard.com to phpbb
forum?

Thanks,
Louie

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

--- End Message ---
--- Begin Message ---
Hi,
After lots of looking I've worked out I can't use heredoc for what I
want. Does anyone else have any better ideas on how to do this:

I have a template file that is used to generate a html page. in this
template I currently have:

$body = <<<EOF
possibly any type of text as it's an email message body
EOF;

I then do some operations on this text and print out the result.

My problem is that heredoc parses variables, so if the email happends
to contain a string that looks like or is php variables it all goes
wrong. Plus it means someone could intentionaly start echoing variables.

I need some way of putting a block of text into a variable without
having to read it in from a file. From the template point of view, all
that happends is a token is replaced with the body of the text. So
reading that in from a file is hard. 

Thanks


-- 
Simon Coggins (SAGE-AU Member)                Email: [EMAIL PROTECTED]
Network and System Management Officer         Phone: +61-2-4221-3775
Information Technology Systems (ITS)          Mobile: 0408 115861
University of Wollongong, 2522, Australia     Fax:   +61-2-4229-1985


--- End Message ---
--- Begin Message ---
On Sun, 2003-06-08 at 17:15, Simon Coggins wrote:
> Hi,

[snipped for brevity]

> I need some way of putting a block of text into a variable without
> having to read it in from a file. From the template point of view, all
> that happends is a token is replaced with the body of the text. So
> reading that in from a file is hard. 
> 
> Thanks

Single quotes will do this;

http://ca.php.net/manual/en/language.types.string.php#language.types.string.syntax.single

$body = '
Some text here.
';


Hope this helps,

Torben


-- 
 Torben Wilson <[EMAIL PROTECTED]>                        +1.604.709.0506
 http://www.thebuttlesschaps.com          http://www.inflatableeye.com
 http://www.hybrid17.com                  http://www.themainonmain.com
 -----==== Boycott Starbucks!  http://www.haidabuckscafe.com ====-----




--- End Message ---
--- Begin Message --- Why not just use file() and friends?

Simon Coggins wrote:

Hi,
After lots of looking I've worked out I can't use heredoc for what I
want. Does anyone else have any better ideas on how to do this:

I have a template file that is used to generate a html page. in this
template I currently have:

$body = <<<EOF
possibly any type of text as it's an email message body
EOF;

I then do some operations on this text and print out the result.

My problem is that heredoc parses variables, so if the email happends
to contain a string that looks like or is php variables it all goes
wrong. Plus it means someone could intentionaly start echoing variables.

I need some way of putting a block of text into a variable without
having to read it in from a file. From the template point of view, all
that happends is a token is replaced with the body of the text. So
reading that in from a file is hard.


Thanks





-- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.



--- End Message ---
--- Begin Message ---
Yes, the entire page is visible when selecting view source.  And again, it
does view ok in Mozilla.  I will try breaking the table into smaller tables
and see if that is it.  I won't have access till Tuesday.  If anyone has any
other ideas feel free to throw in.

Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388

-----Original Message-----
From: John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Saturday, June 07, 2003 9:37 PM
To: 'Larry Brown'; 'PHP List'
Subject: RE: [PHP] IE Pagelength issue

If you "view source" in IE, do you see the entire page? If so, then it's
an IE display issue.

---John W. Holmes...

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

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

> -----Original Message-----
> From: Larry Brown [mailto:[EMAIL PROTECTED]
> Sent: Saturday, June 07, 2003 7:30 PM
> To: [EMAIL PROTECTED]; PHP List
> Subject: RE: [PHP] IE Pagelength issue
>
> Example is a page that displays the concerts and bands at each concert
for
> a
> given spectator. Table one gives information on the spectator and has
a
> field that lists the concert events he/she has been to.  Table two
lists
> concerts along with location information and date along with bands and
> then
> another table that lists band information.  There are several loops,
the
> first one is "while $spectator..." and within it a "while $concert..."
and
> within it a "while $band..."  So the resulting page can have user
> information then a list with concert bands, concert bands, concert
bands,
> for each he/she has been to.  The one we are having a problem with has
27
> concerts and IE stops at 25 and Mozilla goes all the way to the 27th.
I
> will try and split each concert into its own table.  Just as a not
each
> concert listed gives the option to edit the concert information and a
way
> to
> edit the band information in addition to removing any one of them.  So
> there
> are various buttons throughout.
>
> Larry S. Brown
> Dimension Networks, Inc.
> (727) 723-8388
>
> -----Original Message-----
> From: John W. Holmes [mailto:[EMAIL PROTECTED]
> Sent: Saturday, June 07, 2003 6:08 PM
> To: 'Larry Brown'; 'PHP List'
> Subject: RE: [PHP] IE Pagelength issue
>
> > I am running into a strange problem.  I have a script that parses a
> > database
> > for results.  It cycles through the data one record at a time
looking
> for
> > matches to the query.  Up til now I haven't had any problems as the
> > results
> > have been limited in length.  Now I have one that has a significant
> length
> > and the bottom is cut off on IE6.  I haven't tried any earlier
> versions of
> > IE but Mozilla loads the entire page without this problem.  Has
anyone
> run
> > across this?  Is there a way around it?
>
> > Just as an additional note:  the page has one continuous table so
> another
> > potential problem would be a limit to the length of a table?
>
> Probably and IE "feature" of only being able to handle a certain table
> size.
>
> The "way around" it would be to end the table and start another every
so
> many rows... or split your rows up into Prev/Next pages...
>
> Did I read correctly that you're selecting an entire database and then
> using PHP to match criteria? Are you using a WHERE clause to do the
> sorting? Sounds like you may be going about this the wrong way... if
> not, carry on.
>
> ---John W. Holmes...
>
> Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your
copy
> today. http://www.phparch.com/
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>




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



--- End Message ---
--- Begin Message ---
How can one set up cookie-less sessions?  More specifically, if you store
your sessions in a database, once the user comes back how do you call that
same session back? 

I guess I still donšt understand how to keep user specific data maintained
for a particular user.  Because when you log off or the cookie expires, then
you have no data for that user.

Any insights are very welcome!
/T  




--- End Message ---
--- Begin Message ---
> How can one set up cookie-less sessions?  More specifically, if you
store
> your sessions in a database, once the user comes back how do you call
that
> same session back?
> 
> I guess I still donšt understand how to keep user specific data
maintained
> for a particular user.  Because when you log off or the cookie
expires,
> then
> you have no data for that user.

Umm... getting rid of cookies isn't going to help you here. That's the
_only_ way you're going to "remember" someone who comes back after they
close their browser or leave your site. You actually need to increase
the session cookie lifetime so it persists after the browser is closed,
like a regular cookie. Where you store your session data is irrelevant. 

---John W. Holmes...

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

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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

On 06/02/2003 09:30 PM, Todd Cary wrote:
I would like to have a reccommendation for a PHP class that generates a barcode.

Have you seen these?


Class: Barcode128 pattern  compute class
http://www.phpclasses.org/barcode128

Class: BarcodeI25
http://www.phpclasses.org/barcode


--


Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/



--- End Message ---
--- Begin Message ---
Hi, so first of all, I'm sorry for my bad english.
I'll try to write as better as I can, but I think it will be readable ;)

So, this is 3 code unsing eregi_replace, but they dont work as well...

If some one can give me a help, it's will be great.

Many thx !

/******************** code ********************/

/* transform [color=FFFFFF]colored text[/color] to <font
color="FFFFFF">colored text</font> */
$message = eregi_replace ("[color=(.*)](.*)[/color]","<font
color='\\1'>\\2</font>",$message);

/* transform [url=xxx]link![/url] to <a href="xxx">link!</a> */
$message = eregi_replace ("[url=(.*)](.*)[/url]","<A HREF=\"\\1\"
TARGET=\"blank\">\\2</A>",$message);

/* transform [b]big text[/b] to <b>big text</b> */
$message = eregi_replace (".*([b]).*([/b]).*","\\1<b>\\2</b>\\3",$message);


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

I am using FreeBSD 4.7 ,PHP 4.2.3 & Apache 1.3

I want to execute shell script which contains few IPFW commands. I have tried with 
system(),exec(),passthru() command to execute script but i can't do that. 
Apache has created "www" user on FreeBSD. I found that "www" user has not privilege 
for IPFW.

How can i execute script which contains IPFW commands with PHP?

I have given 777 permission to script file.

Thanking You.

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

I am reading the content of a text file into a variable to be used in a javascript. I am reworking some code that was originally done using ColdFusion and the jsStringFormat(var) function. What is the PHP equivalent string function? Is there one? I have searched the docs, but can't figure out which to use.

Thanks
Charles


--- End Message ---

Reply via email to