OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 20 Feb 2004 00:22:17 -0000 Issue 2600

php-general-digest-helplists.php.net
Date: Thu Feb 19 2004 - 18:22:17 CST


php-general Digest 20 Feb 2004 00:22:17 -0000 Issue 2600

Topics (messages 178237 through 178303):

headers_list function
        178237 by: Juan Torres
        178239 by: Richard Davey
        178260 by: Chris Shiflett

Re: post variables
        178238 by: julian haffegee
        178240 by: Duncan Hill

Problem with Sessions
        178241 by: Sheni R. Meledath
        178256 by: Jas

Re: XSL-FO
        178242 by: memoimyself.yahoo.com.br

Re: PHPSESSID and URL rewriting
        178243 by: memoimyself.yahoo.com.br
        178268 by: seba

Re: Mimetypes and image uploads
        178244 by: memoimyself.yahoo.com.br

Re: PHP Header to stimulate a POST method or POST string????
        178245 by: Scott Fletcher
        178246 by: Scott Fletcher

Re: Nested Loops
        178247 by: Alex Hogan

fsockopen failed with permission denied error...
        178248 by: Scott Fletcher
        178274 by: Justin Patrin

Re: fopen errors
        178249 by: John Nichel

How check if URL is running ok before try open it?
        178250 by: M
        178255 by: Pablo Gosse

PHP-INSTALL Compile Error
        178251 by: Jim Thompson

str_replace to replace /n with <p> not having desired effect.
        178252 by: Dave G
        178253 by: Adam Voigt
        178254 by: Richard Davey

Re: str_replace to replace /n with <p> not having desiredeffect. [SOLVED]
        178257 by: Dave G

Serious PHP5b4 speed issues
        178258 by: Andrew Lee Paul
        178265 by: Raditha Dissanayake
        178287 by: Andrew Lee Paul

XSLT in php v5 beta 4
        178259 by: Steve Dieke

Can't remove an element from an array
        178261 by: Brian Dunning
        178262 by: John Nichel
        178263 by: Chris

Re: checking users have the latest version of a file
        178264 by: Chris W. Parker

Unexpected ";"
        178266 by: Paul Furman
        178267 by: Raditha Dissanayake
        178269 by: Alex Hogan
        178270 by: Alex Hogan
        178271 by: Neil Freeman
        178272 by: Michal Migurski
        178276 by: Paul Furman
        178280 by: John Nichel

Re: Recursive Select Box
        178273 by: Justin Patrin

variables
        178275 by: Dominique ANOKRE
        178277 by: Adam Voigt
        178278 by: Adam Voigt
        178279 by: Richard Davey
        178281 by: Dominique ANOKRE

Table's config
        178282 by: [Scripts]
        178283 by: Richard Davey

Generating Sub Headings
        178284 by: Nicole
        178285 by: Chris W. Parker
        178286 by: Nicole
        178288 by: Richard Davey
        178289 by: Nicole
        178291 by: Nicole

PHP & PDFs...
        178290 by: Russell P Jones
        178297 by: Marek Kilimajer

date
        178292 by: Madcat
        178293 by: Jay Blanchard

Problem with Apache!
        178294 by: ãÙÇÁÎÅÎËÏ áÒÔ£Í
        178295 by: BAO RuiXian
        178296 by: BAO RuiXian

PHP Security Issue?
        178298 by: Ed Lazor

heavy parsing of text, storing both versions
        178299 by: Justin French
        178301 by: Torsten Schabdach

Re: I don't understand you!
        178300 by: BAO RuiXian

Re: php as cgi with static libraries?
        178302 by: Marten Lehmann

Re: Headers Again
        178303 by: PETCOL

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

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

attached mail follows:


Hi,

how can I use 'header_list()' function. My manual says: "Might be only in
CVS".
What is CVS? How do I install CVS?

Thanks

attached mail follows:


Hello Juan,

Thursday, February 19, 2004, 1:13:56 PM, you wrote:

JT> how can I use 'header_list()' function. My manual says: "Might be only in
JT> CVS".
JT> What is CVS? How do I install CVS?

In a nutshell, if it's in CVS and you need it for a live site - ignore
it. CVS is the repository where all the beta versions of PHP are
worked on. So you can grab a copy from there, *compile* it yourself and
then test it.

Either that, or your manual is outdated and it's moved from CVS to
live :) it's worth checking that too.

--
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

attached mail follows:


--- Juan Torres <jto_staryahoo.es> wrote:
> how can I use 'header_list()' function. My manual says: "Might be only
> in CVS". What is CVS? How do I install CVS?

This is another way of saying that this might not be in any release of PHP
to date. CVS is the version control system used in development. There is
information on the site about how to check out from CVS. If you don't know
what CVS is, that's a good indication that this is probably not something
you should do. But, I'll let you decide:

http://www.php.net/anoncvs.php

Hope that helps.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
     Coming mid-2004
HTTP Developer's Handbook - Sams
     http://httphandbook.org/
PHP Community Site
     http://phpcommunity.org/

attached mail follows:


Hi all,

I solved this today. It seems odd.

If you define an action it DOES NOT work, but if you skip that entirely the
POST variables are sent!

so
<form method='POST'> works
<form method='POST' action ='something.php'> doesn't work.

Why would this be?

thanks

Jules

----- Original Message -----
From: "julian haffegee" <juleskilli.co.uk>
To: <php-generallists.php.net>
Sent: Wednesday, February 18, 2004 1:58 PM
Subject: Re: [PHP] post variables

>
> Hi Chris
>
> print_r($_REQUEST); (is this what you mean by HTTP Request?)
> print_r($_POST);
> print_r($_GET);
>
> all give Array()
>
> its apache release 10327100 (is that what you mean?)
>
> If I change the form method to GET works, and we get
>
> REQUEST: Array ( [username] => aa [password] => aa )
> _GET: Array ( [username] => aa [password] => aa )
> _POST: Array ( )
>
>
>
>
> > Do you have a way to capture the raw HTTP? I'd like to see:
> >
> > 1. The HTTP Request
> > 2. The output of print_r($_POST)
> > 3. What Web server you're using (and version)
> >
> > With this, I feel certain that we can figure something out.
> >
> > Chris
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

attached mail follows:


On Thursday 19 February 2004 13:32, julian haffegee wrote:
> Hi all,
>
>
> I solved this today. It seems odd.
>
> If you define an action it DOES NOT work, but if you skip that entirely the
> POST variables are sent!
>
> so
> <form method='POST'> works
> <form method='POST' action ='something.php'> doesn't work.

I have -never- seen that behaviour. In fact, I use explicit actions all the
time, and have no problem with $_POST.

attached mail follows:


Hello:

Session is not working in PHP script file when executed through the browser
IE 5.0 on Windows 2000 platform. In IE latest versions the script is
working fine. Does anybody have any solution or report related to this. PHP
version on the server is 4.3.

Sheni R Meledath
shenicyber-gear.com

attached mail follows:


Sheni R. Meledath wrote:
> Hello:
>
> Session is not working in PHP script file when executed through the
> browser IE 5.0 on Windows 2000 platform. In IE latest versions the
> script is working fine. Does anybody have any solution or report related
> to this. PHP version on the server is 4.3.
>
>
> Sheni R Meledath
> shenicyber-gear.com

Well ask yourself a couple of questions...
1. Did you do a 'session_start();' at the top of your script?
2. What Web server are you running? (IIS / Apache etc.)
3. Does my PHP.INI file have the session.save_path directive set?
4. In the folder specified by PHP.INI are there any sess_99898... files?
5. Did you post any examples of your code so we can help pinpoint the
exact problem?

HTH
Jas

attached mail follows:


Hello Juan,

On 18 Feb 2004 at 13:51, Juan Torres wrote:

> Does PHP allow parser a XML with a XSL-FO and create a PDF?

Your English is kind of difficult to understand, but I guess you want to know if you can
perform XSL-FO transformations with PHP. If this is your question, the answer is 'no':
PHP does have an extension to perform XSLT transformations, but not XSL-FO. Maybe
someone out there has developed a class to do this?

Erik

attached mail follows:


Hello Seba,

Check your php.ini file: you'll probably find that "session.use_trans_sid" is set to 1,
which is actually a security hazard. If you set "session.use_trans_sid" to 0, session IDs
will no longer be automatically sent as GET variables.

Cheers,

Erik

On 19 Feb 2004 at 13:15, Seba wrote:

> Hi everyone,
> I have this situation:
> I use some regular expressions to rewrite the URL of a web site,
> in particular:
> http://www.mysite.com/lingua-ita/colore-rosso/pagina.html
> that becames
> http://www.mysite.com/pagina.php?lingua=ita&colore=rosso.
>
> Is all ok until I use some session variables.
> It happens that the string ?PHPSESSID=[valore] is merge to the link and
> this will cause a damage in the URL rewriting.
>
> Note that the string comes merged by the browser (Explorer, opera) to
> the link I wrote before.
> (http://www.mysite.com/lingua-ita/colore-rosso/pagina.html?PHPSESSID=f4s6f5d4fs65df4s65fd4).
>
> Since the links first come in this format, then are rewroted by the rule
> in the file htaccess and finally parsed by the webserver (apache , IIS),
> How can I avoid it?
>
> I tried with:
> RewriteRule (.*)?PHPSESSID=(.*) /PHPSESSID-$2/$1
> as last rule, but it didn't work.
>
> Can you help me?
>
> thanks in advance
> Seba

attached mail follows:


Unfortunately I do can not oblige users which will use those pages to accept
cookies .
The pages are for an e-commerce web site.
If I use the directive
session.use_trans_sid = 0
is not possible to MANTAIN THE SAME phpsessid value among differents pages,
isn t it?

Cheers,

Seba

----- Original Message -----
From: <memoimyselfyahoo.com.br>
To: "PHP General list" <php-generallists.php.net>
Sent: Thursday, February 19, 2004 2:45 PM
Subject: [PHP] Re: PHPSESSID and URL rewriting

> Hello Seba,
>
> Check your php.ini file: you'll probably find that "session.use_trans_sid"
is set to 1,
> which is actually a security hazard. If you set "session.use_trans_sid" to
0, session IDs
> will no longer be automatically sent as GET variables.
>
> Cheers,
>
> Erik
>
>
> On 19 Feb 2004 at 13:15, Seba wrote:
>
> > Hi everyone,
> > I have this situation:
> > I use some regular expressions to rewrite the URL of a web site,
> > in particular:
> > http://www.mysite.com/lingua-ita/colore-rosso/pagina.html
> > that becames
> > http://www.mysite.com/pagina.php?lingua=ita&colore=rosso.
> >
> > Is all ok until I use some session variables.
> > It happens that the string ?PHPSESSID=[valore] is merge to the link and
> > this will cause a damage in the URL rewriting.
> >
> > Note that the string comes merged by the browser (Explorer, opera) to
> > the link I wrote before.
> >
(http://www.mysite.com/lingua-ita/colore-rosso/pagina.html?PHPSESSID=f4s6f5d
4fs65df4s65fd4).
> >
> > Since the links first come in this format, then are rewroted by the rule
> > in the file htaccess and finally parsed by the webserver (apache , IIS),
> > How can I avoid it?
> >
> > I tried with:
> > RewriteRule (.*)?PHPSESSID=(.*) /PHPSESSID-$2/$1
> > as last rule, but it didn't work.
> >
> > Can you help me?
> >
> > thanks in advance
> > Seba
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


On 19 Feb 2004 at 15:53, danielelectroteque.org wrote:

> I just discovered something totally bizarre with file uploads and mime
> types, if i have the document open i am trying to upload say a word file
> application/octet-stream and if i close the document application/msword ,
> why is this ?

My guess: MS Word locks a file while it's open, so it's being copied before it's
uploaded.

attached mail follows:


I still get this message with the class HTTP_Request (Pear).

--snip--
Warning: fsockopen() [function.fsockopen]: php_hostconnect: connect failed
in /home/website/emarket/www/zz_test_dir/Net/Socket.php on line 108

Warning: fsockopen() [function.fsockopen]: unable to connect to
216.109.118.68:80 in /home/website/emarket/www/zz_test_dir/Net/Socket.php on
line 108
--snip--

The script I put down are

--snip--
<?
   include('Request.php');

   $a = &new HTTP_Request('http://www.yahoo.com/');
   $a->sendRequest();
   echo $a->getResponseBody();
?>
--snip--

Scott F.
<danielelectroteque.org> wrote in message
news:39926.203.15.102.65.1077170790.squirrelwww.electroteque.org...
> Firstly i luv the subject mwuahhaha, you may want to check out the pear
> class HTTP_Request , it'll do post and get sockets.

attached mail follows:


Yes, the script on the box can run and hit google. I did with telent and it
connected successfully and type a make-up word 'get' follow by the enter key
and got a response below...

--snip--
<html><head><title>400 Bad Request</title><style><!--body {font-family:
arial,sans-serif}div.nav {margin-top: 1ex}div.nav A {font-size: 10pt;
font-family: arial,sans-serif}span.nav {font-size: 10pt; font-family:
arial,sans-serif; font-weight: bold}div.nav A,span.big {font-size: 12pt;
color: #0000cc}div.nav A {font-size: 10pt; color: black}A.l:link {color:
#6f6f6f}A.u:link {color: green}//--></style></head><body text=#000000
bgcolor=#ffffff><table border=0 cellpadding=2 cellspacing=0
width=100%><tr><td rowspan=3 width=1% nowrap><b><font face=times
color=#0039b6 size=10>G</font><font face=times color=#c41200
size=10>o</font><font face=times color=#f3c518 size=10>o</font><font
face=times color=#0039b6 size=10>g</font><font face=times color=#30a72f
size=10>l</font><font face=times color=#c41200
size=10>e</font>&nbsp;&nbsp;</b><td>&nbsp;</td></tr><tr><td
bgcolor=#3366cc><font face=arial,sans-serif
color=#ffffff><b>Error</b></td></tr><tr><td>&nbsp;</td></tr></table><blockqu
ote><H1>Bad Request</H1>Your client has issued a malformed or illegal
request.<p></blockquote><table width=100% cellpadding=0
cellspacing=0><tr><td bgcolor=#3366cc><img alt="" width=1
height=4></td></tr></table></body></html>Connection closed.
--snip--

"John Nichel" <jnichelby-tor.com> wrote in message
news:40344F42.9020309by-tor.com...
> Scott Fletcher wrote:
>
> > This is what I get...
> >
> > --snip--
> > 1
> > Warning: fsockopen() [function.fsockopen]: php_hostconnect: connect
failed
> > in /home/website/emarket/www/zz_test.php on line 4
> >
> > Warning: fsockopen() [function.fsockopen]: unable to connect to
> > www.google.com:80 in /home/website/emarket/www/zz_test.php on line 4
> > [13] [Permission denied]
> > --snip--
>
> Can the box where the script lives and runs hit google?
>
> --
> By-Tor.com
> It's all about the Rush
> http://www.by-tor.com

attached mail follows:


Thanks for the help guys...,

After some sleep and some food this is where it's gone;

$query = "select wn_pdate, wn_text, wn_id " .
              "from whatsnew " .
              "order by wn_pdate";

$pdate = "";
while($row = mssql_fetch_array($result)){
    if ($pdate != $row[0]) {
        print "<tr><td>" . $row[0]</td></tr>";
        $pdate = $row[0];
    }

    print "<tr><td><a href=\"$id\">" . $row[1] . "</a></td></tr>";
}

Results;

Date 1
Item one
Item two
Item three

Date 2
Item four
Item five
Item six

... etc

It produces the results that I was looking for and it's much less code.

alex hogan

> -----Original Message-----
> From: Ford, Mike [LSS] [mailto:M.Fordleedsmet.ac.uk]
> Sent: Thursday, February 19, 2004 4:50 AM
> To: 'Alex Hogan'; PHP General list
> Subject: RE: [PHP] Nested Loops
>
> On 18 February 2004 22:13, Alex Hogan wrote:
>
> > Sorry...,
> >
> >
> >
> > Line 17 is: print "<tr><td><a
> > href=\"$id\">$row2[$rtxt]</a></td></tr>";
>
> I haven't a clue what this is relating to (bit *too* much snippage
> there!), but I think that statement is going to need some curly braces to
> have a chance of working as intended:
>
> print "<tr><td><a href=\"$id\">{$row2[$rtxt]}</a></td></tr>";
>
>
> Cheers!
>
> Mike
>
> ---------------------------------------------------------------------
> Mike Ford, Electronic Information Services Adviser,
> Learning Support Services, Learning & Information Services,
> JG125, James Graham Building, Leeds Metropolitan University,
> Beckett Park, LEEDS, LS6 3QS, United Kingdom
> Email: m.fordleedsmet.ac.uk
> Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

******************************************************************
The contents of this e-mail and any files transmitted with it are
confidential and intended solely for the use of the individual or
entity to whom it is addressed. The views stated herein do not
necessarily represent the view of the company. If you are not the
intended recipient of this e-mail you may not copy, forward,
disclose, or otherwise use it or any part of it in any form
whatsoever. If you have received this e-mail in error please
e-mail the sender.
******************************************************************

attached mail follows:


Hi Everyone!

Sample code below...

--snip--
$fp = fsockopen("www.cnn.com", 80, $errno, $errstr, 30);
--snip--

I get the error message, permission denied along with 13. When I read the
bugs.php.net and found out that I need to add the "" to it so I did this..

--snip--
$fp = fsockopen("www.cnn.com", 80, $errno, $errstr, 30);
--snip--

I get a different error message, it said ...

--snip--
Addr family not supported by protocol (66)
--snip--

Does anyone know what it meant and what is the workaround to it?

Thanks,
 FletchSOD

attached mail follows:


Scott Fletcher wrote:

> Hi Everyone!
>
> Sample code below...
>
> --snip--
> $fp = fsockopen("www.cnn.com", 80, $errno, $errstr, 30);
> --snip--
>
> I get the error message, permission denied along with 13. When I read the
> bugs.php.net and found out that I need to add the "" to it so I did this..
>
> --snip--
> $fp = fsockopen("www.cnn.com", 80, $errno, $errstr, 30);
> --snip--
>
> I get a different error message, it said ...
>
> --snip--
> Addr family not supported by protocol (66)
> --snip--
>
> Does anyone know what it meant and what is the workaround to it?
>
> Thanks,
> FletchSOD

Try the example at: http://us4.php.net/fsockopen

--
--
paperCrane <Justin Patrin>

attached mail follows:


Hunter, Jess wrote:
> Thanks for the reply, you are right, the file is going on a Linux box, but
> the source file is located on the client computer (windoze).

You cannot open a remote file by using it's directory path on the remote
system. The two ways to do this would be to a) (recommended) open it
with a URL, thus the 'client' computer would need to be running a web
server, or b) mount the remote drive as a share on the *nix box, and
access the file thru the share.

http://us4.php.net/manual/en/function.fopen.php

> The addslashes was part of the original sample script.

It was probably made for text to be entered in a db, and in that case
(if you are using MySQL), the function mysql_escape_string() would be a
better choice...

http://us4.php.net/manual/en/function.mysql-escape-string.php

> The storage would only be temporary, I intend to make it so when the file is
> viewed, there will be an option to delete it. The binary images would only
> reside in the DB for 2-4 weeks tops.

Most seem to think (including myself) that it is better to store binary
files in the file system, and put the text url/path to them in the db.

> As for your suggestion to modify the script to meet my needs, that is what I
> am trying to do... Thanks for the assistance

Look in the manual for explanations of the functions you're trying to
use. Copying an example will rarely do what YOU need/want it to do, and
you'll have a better understanding how to modify it by reading how the
individual functions work.

>>-----Original Message-----
>>From: John Nichel [SMTP:jnichelby-tor.com]

Please don't reply directly to me (or anyone else on the list) unless
asked to do so. When you just reply to an individual, your message does
not make it into the list archives, and won't be searchable by the next
person who comes along with the same problem (that is IF people would
actually search the archives).
<snip>

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

attached mail follows:


Hello, I decided to make a pre-URL caller into my script, so when user
try link to another URL, instead show these annoying http errors (when
URL off), I could direct him to more user friendly environment.

I checked FOPEN($url-name,'R') command, but in some cases it will pop up
fire-walls alerts for users who uses firewalls, when FOPEN is executed.

I would like to try more silent tricks for this task, and appreciate any
help.

Mig

attached mail follows:


<snip>Hello, I decided to make a pre-URL caller into my script, so when
user
try link to another URL, instead show these annoying http errors (when
URL off), I could direct him to more user friendly environment.

I checked FOPEN($url-name,'R') command, but in some cases it will pop up
fire-walls alerts for users who uses firewalls, when FOPEN is executed.

I would like to try more silent tricks for this task, and appreciate any
help.</snip>

Create custom error handling pages which you would specify in your
apache configuration.

In your conf file you would need to add something like:

ErrorDocument 403 /path/to/403.php
ErrorDocument 404 /path/to/404.php

wherever you define the configuration directives for the site in
question.

Hope that helps.

Cheers,
Pablo

attached mail follows:


I'm getting this error when running a make on php 4.3.4 on AIX 5.2:

ld: 0711-317 ERROR: Undefined symbol: .pow
ld: 0711-317 ERROR: Undefined symbol: .ceil
ld: 0711-317 ERROR: Undefined symbol: .floor
ld: 0711-317 ERROR: Undefined symbol: .sin
ld: 0711-317 ERROR: Undefined symbol: .cos
ld: 0711-317 ERROR: Undefined symbol: .tan
ld: 0711-317 ERROR: Undefined symbol: .asin
ld: 0711-317 ERROR: Undefined symbol: .acos
ld: 0711-317 ERROR: Undefined symbol: .atan
ld: 0711-317 ERROR: Undefined symbol: .atan2
ld: 0711-317 ERROR: Undefined symbol: .sinh
ld: 0711-317 ERROR: Undefined symbol: .cosh
ld: 0711-317 ERROR: Undefined symbol: .tanh
ld: 0711-317 ERROR: Undefined symbol: .exp
ld: 0711-317 ERROR: Undefined symbol: .expm1
ld: 0711-317 ERROR: Undefined symbol: .log
ld: 0711-317 ERROR: Undefined symbol: .log10
ld: 0711-317 ERROR: Undefined symbol: .sqrt
ld: 0711-317 ERROR: Undefined symbol: .fmod
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.
collect2: ld returned 8 exit status
make: 1254-004 The error code from the last command is 1.

Can anyone help with this?

attached mail follows:


PHP Listers,
        I am trying to use str_replace to format text taken from a MySQL
TEXT field and make it so that it is compatible with my CSS formatting.
Essentially, I want to ensure that new lines are replaced with <p> tags
with the appropriate CSS class designation.
        The code I have created with assistance from information found
on the web, looks like this:

$charInfoCss = '<p class="content">' . str_replace('\n', '</p>\n<p
class="content">\n', $charInfo[introE]) . '</p>';

        The output looks like this:
<p class="content">Blah blah blah blah.
Another line of blah blah blah.
A third line of blah blah blah.</p>

        The output I desire is this:
<p class="content">Blah blah blah blah.</p>
<p class="content">Another line of blah blah blah.</p>
<p class="content">A third line of blah blah blah.</p>

        How do I correct my code to accomplish this?

        Thank you.

--
Yoroshiku!
Dave G
mlautotelic.com

attached mail follows:


Single quotes don't work for the escape characters.
Use double quotes around the str_replace where there is a \n.

On Thu, 2004-02-19 at 10:52, Dave G wrote:
> PHP Listers,
> I am trying to use str_replace to format text taken from a MySQL
> TEXT field and make it so that it is compatible with my CSS formatting.
> Essentially, I want to ensure that new lines are replaced with <p> tags
> with the appropriate CSS class designation.
> The code I have created with assistance from information found
> on the web, looks like this:
>
> $charInfoCss = '<p class="content">' . str_replace('\n', '</p>\n<p
> class="content">\n', $charInfo[introE]) . '</p>';
>
> The output looks like this:
> <p class="content">Blah blah blah blah.
> Another line of blah blah blah.
> A third line of blah blah blah.</p>
>
> The output I desire is this:
> <p class="content">Blah blah blah blah.</p>
> <p class="content">Another line of blah blah blah.</p>
> <p class="content">A third line of blah blah blah.</p>
>
> How do I correct my code to accomplish this?
>
> Thank you.
>
> --
> Yoroshiku!
> Dave G
mlautotelic.com
--

Adam Voigt
adamkotisprop.com

attached mail follows:


Hello Dave,

Thursday, February 19, 2004, 3:52:54 PM, you wrote:

DG> $charInfoCss = '<p class="content">' . str_replace('\n', '</p>\n<p
class="content">>\n', $charInfo[introE]) . '</p>';

Double-bag it:

str_replace("\n", "</p>\n<p class=\"content\">\n", $charInfo[introE])

--
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

attached mail follows:


> From: Adam
> Single quotes don't work for the escape characters.
> Use double quotes around the str_replace where there is a \n.
and...
> From: Richard
> Double-bag it:
> str_replace("\n", "</p>\n<p class=\"content\">\n", $charInfo[introE])

It's always the simplest of mistakes that one overlooks.
Thanks guys! That's done the trick.

--
Yoroshiku!
Dave G
mlautotelic.com

attached mail follows:


Hello all

I have recently installed PHP 5.0 Beta 4 on my
development server and am very concerned with
performance. I have read everywhere, that PHP5 offers
increased performance. However, in my tests, the
requests per second have decreased dramatically:

PHP5: Requests per second: 4.23 [#/sec] (mean)
PHP4: Requests per second: 23.08 [#/sec] (mean)

Full test results are below.

The environment and the requested page are identical
in both tests (using ab). The tests were run on
Apache/1.3.28.

Has anyone else experienced similar behavior? Or can
anyone suggest what is happening...

Thank you in advance.

Andrew

>> Results with PHP5 module loaded <<

<snip>

Concurrency Level: 10
Time taken for tests: 236.372 seconds
Complete requests: 1000
Failed requests: 0
Broken pipe errors: 0
Total transferred: 12732000 bytes
HTML transferred: 12514000 bytes
Requests per second: 4.23 [#/sec] (mean)
Time per request: 2363.72 [ms] (mean)
Time per request: 236.37 [ms] (mean, across all
concurrent requests)
Transfer rate: 53.86 [Kbytes/sec] received

<snip>

>> Results with PHP4 module loaded <<

<snip>

Concurrency Level: 10
Time taken for tests: 43.328 seconds
Complete requests: 1000
Failed requests: 0
Broken pipe errors: 0
Total transferred: 12728000 bytes
HTML transferred: 12514000 bytes
Requests per second: 23.08 [#/sec] (mean)
Time per request: 433.28 [ms] (mean)
Time per request: 43.33 [ms] (mean, across all
concurrent requests)
Transfer rate: 293.76 [Kbytes/sec] received

<snip>

__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools

attached mail follows:


Hi,

I am a guy who doesn't believe in 'requests per second' and 'number of
concurrent users' stats so please ignore the rest of this message if you
wish:

The problem here could be that while it's possible to improve the speed
of execution it's not possible to do so for the full set of functions or
features available in a particular language. There will be areas where
there is huge boost in speed and there may be areas where there is slow
down and it's quite possible that you have hit one of them.

Secondly it's quite possible that the optimization techniques used with
one version may be counter productive with another version.
If you better describe the functionality of your pages i think you will
be more likely to recieve a better answer (from me or someone better
qualified).

best regards.

Andrew Lee Paul wrote:

>Hello all
>
>I have recently installed PHP 5.0 Beta 4 on my
>development server and am very concerned with
>performance. I have read everywhere, that PHP5 offers
>increased performance. However, in my tests, the
>requests per second have decreased dramatically:
>
>PHP5: Requests per second: 4.23 [#/sec] (mean)
>PHP4: Requests per second: 23.08 [#/sec] (mean)
>
>Full test results are below.
>
>The environment and the requested page are identical
>in both tests (using ab). The tests were run on
>Apache/1.3.28.
>
>Has anyone else experienced similar behavior? Or can
>anyone suggest what is happening...
>
>Thank you in advance.
>
>Andrew
>
>
>
>
>
>
>>>Results with PHP5 module loaded <<
>>>
>>>
>
><snip>
>
>Concurrency Level: 10
>Time taken for tests: 236.372 seconds
>Complete requests: 1000
>Failed requests: 0
>Broken pipe errors: 0
>Total transferred: 12732000 bytes
>HTML transferred: 12514000 bytes
>Requests per second: 4.23 [#/sec] (mean)
>Time per request: 2363.72 [ms] (mean)
>Time per request: 236.37 [ms] (mean, across all
>concurrent requests)
>Transfer rate: 53.86 [Kbytes/sec] received
>
><snip>
>
>
>
>
>
>>>Results with PHP4 module loaded <<
>>>
>>>
>
><snip>
>
>Concurrency Level: 10
>Time taken for tests: 43.328 seconds
>Complete requests: 1000
>Failed requests: 0
>Broken pipe errors: 0
>Total transferred: 12728000 bytes
>HTML transferred: 12514000 bytes
>Requests per second: 23.08 [#/sec] (mean)
>Time per request: 433.28 [ms] (mean)
>Time per request: 43.33 [ms] (mean, across all
>concurrent requests)
>Transfer rate: 293.76 [Kbytes/sec] received
>
><snip>
>
>
>
>__________________________________
>Do you Yahoo!?
>Yahoo! Mail SpamGuard - Read only the mail you want.
>http://antispam.yahoo.com/tools
>
>
>

--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.

attached mail follows:


Thank you for your comments.

So that we have a page to compare between PHP4 and
PHP5, I have taken the home page of php.net. I have a
local copy – 'php.local' and re-ran the tests on the
first page (ab running on 'php.local')

   ab http://php.loca/ -n1000 -c10

Again, the results are alarming - PHP5 seems to be
about 50% slower :-(

Below are the results.

>> Results with PHP5 module loaded <<

<snip>

Concurrency Level: 10
Time taken for tests: 113.320 seconds
Complete requests: 1000
Failed requests: 0
Broken pipe errors: 0
Total transferred: 26031972 bytes
HTML transferred: 25689608 bytes
Requests per second: 8.82 [#/sec] (mean)
Time per request: 1133.20 [ms] (mean)
Time per request: 113.32 [ms] (mean, across all
concurrent requests)
Transfer rate: 229.72 [Kbytes/sec] received

<snip>

>> Results with PHP4 module loaded <<

<snip>

Document Path: /
Document Length: 25651 bytes

Concurrency Level: 10
Time taken for tests: 64.971 seconds
Complete requests: 1000
Failed requests: 0
Broken pipe errors: 0
Total transferred: 26056665 bytes
HTML transferred: 25710578 bytes
Requests per second: 15.39 [#/sec] (mean)
Time per request: 649.71 [ms] (mean)
Time per request: 64.97 [ms] (mean, across all
concurrent requests)
Transfer rate: 401.05 [Kbytes/sec] received

<snip>

--- Raditha Dissanayake <jabberraditha.com> wrote:
> Hi,
>
> I am a guy who doesn't believe in 'requests per
> second' and 'number of
> concurrent users' stats so please ignore the rest of
> this message if you
> wish:
>
> The problem here could be that while it's possible
> to improve the speed
> of execution it's not possible to do so for the full
> set of functions or
> features available in a particular language. There
> will be areas where
> there is huge boost in speed and there may be areas
> where there is slow
> down and it's quite possible that you have hit one
> of them.
>
> Secondly it's quite possible that the optimization
> techniques used with
> one version may be counter productive with another
> version.
> If you better describe the functionality of your
> pages i think you will
> be more likely to recieve a better answer (from me
> or someone better
> qualified).
>
> best regards.
>
>
>
> Andrew Lee Paul wrote:
>
> >Hello all
> >
> >I have recently installed PHP 5.0 Beta 4 on my
> >development server and am very concerned with
> >performance. I have read everywhere, that PHP5
> offers
> >increased performance. However, in my tests, the
> >requests per second have decreased dramatically:
> >
> >PHP5: Requests per second: 4.23 [#/sec] (mean)
> >PHP4: Requests per second: 23.08 [#/sec] (mean)
> >
> >Full test results are below.
> >
> >The environment and the requested page are
> identical
> >in both tests (using ab). The tests were run on
> >Apache/1.3.28.
> >
> >Has anyone else experienced similar behavior? Or
> can
> >anyone suggest what is happening...
> >
> >Thank you in advance.
> >
> >Andrew
> >
> >
> >
> >
> >
> >
> >>>Results with PHP5 module loaded <<
> >>>
> >>>
> >
> ><snip>
> >
> >Concurrency Level: 10
> >Time taken for tests: 236.372 seconds
> >Complete requests: 1000
> >Failed requests: 0
> >Broken pipe errors: 0
> >Total transferred: 12732000 bytes
> >HTML transferred: 12514000 bytes
> >Requests per second: 4.23 [#/sec] (mean)
> >Time per request: 2363.72 [ms] (mean)
> >Time per request: 236.37 [ms] (mean, across
> all
> >concurrent requests)
> >Transfer rate: 53.86 [Kbytes/sec] received
> >
> ><snip>
> >
> >
> >
> >
> >
> >>>Results with PHP4 module loaded <<
> >>>
> >>>
> >
> ><snip>
> >
> >Concurrency Level: 10
> >Time taken for tests: 43.328 seconds
> >Complete requests: 1000
> >Failed requests: 0
> >Broken pipe errors: 0
> >Total transferred: 12728000 bytes
> >HTML transferred: 12514000 bytes
> >Requests per second: 23.08 [#/sec] (mean)
> >Time per request: 433.28 [ms] (mean)
> >Time per request: 43.33 [ms] (mean, across
> all
> >concurrent requests)
> >Transfer rate: 293.76 [Kbytes/sec]
> received
> >
> ><snip>
> >
> >
> >
> >__________________________________
> >Do you Yahoo!?
> >Yahoo! Mail SpamGuard - Read only the mail you
> want.
> >http://antispam.yahoo.com/tools
> >
> >
> >
>
>
> --
> Raditha Dissanayake.
>
------------------------------------------------------------------------
> http://www.radinks.com/sftp/ |
> http://www.raditha.com/megaupload
> Lean and mean Secure FTP applet with | Mega Upload -
> PHP file uploader
> Graphical User Inteface. Just 150 KB | with progress
> bar.
>

__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools

attached mail follows:


I am guesing that I have installed something incorrectly. I am trying to
use the function xslt_create(). I installed php v5 Beta 4 successfully. but
when I try to use the function xslt_create() I get the following error:

Fatal Error: Call to undefined function xslt_create()

I have a test php page that uses phpinfo() and here's what the xml related
setting say.

xml
XML Support active
XML Namespace Support active
libxml2 Version 2.6.6

xsl
XSL enabled
libxslt Version 1.1.3
libxslt compiled against libxml Version 2.6.6
EXSLT enabled
libexslt Version 1.1.3

My environment is the following:
Fedora Core 1
php - version 5 beta 4
apache - 2.0.48

Anyone have any ideas? I have looked at the articles on php.net and didn't
see anything that I thought would help.

Thanks,
Steve

attached mail follows:


Hi, I have an array that holds the item_id's for a shopping cart. I am
trying to remove the item specified by a GET like this:

foreach ($_SESSION["cart_array"] as $item) {
   if ($item==$_GET["item_id"]) {unset($_SESSION["cart_array"], $item);
break;}
}

But it removes ALL items from the cart. And then when I view the cart
on the next page, EVERYTHING is back, including the item I tried to
remove. What am I doing wrong? Thanks!

- Brian

attached mail follows:


Brian Dunning wrote:

> Hi, I have an array that holds the item_id's for a shopping cart. I am
> trying to remove the item specified by a GET like this:
>
> foreach ($_SESSION["cart_array"] as $item) {
> if ($item==$_GET["item_id"]) {unset($_SESSION["cart_array"], $item);
> break;}
> }
>
> But it removes ALL items from the cart. And then when I view the cart on
> the next page, EVERYTHING is back, including the item I tried to remove.
> What am I doing wrong? Thanks!
>
> - Brian
>

Because you're unsetting the WHOLE 'cart_array'. If you're 'cart_array'
is set up like this....

Cart ->
        Item0 ->
                stuff
                stuff
        Item1 ->
                stuff
                stuff
        Item2 ->
                stuff
                stuff

And someone wants to delete Item1 from their cart....

unset ( $_SESSION['cart_array']['Item1'] );

http://us4.php.net/manual/en/function.unset.php

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

attached mail follows:


You have two separate problems here:
1) unset($_SESSION["cart_array"], $item)
   This unsets $_SESSION["cart_array"] and also $item,
   it should be unset($_SESSION["cart_array"][$item])
2) The method of unsetting session variables depends on whether you have
register_globals on, it's all here:
http://www.php.net/manual/en/ref.session.php . The Examples section has
detailed examples that should help you fix your problem

> -----Original Message-----
> From: Brian Dunning [mailto:brianbriandunning.com]
> Sent: Thursday, February 19, 2004 8:50 AM
> To: php-generallists.php.net
> Subject: [PHP] Can't remove an element from an array
>
>
> Hi, I have an array that holds the item_id's for a shopping cart. I am
> trying to remove the item specified by a GET like this:
>
> foreach ($_SESSION["cart_array"] as $item) {
> if ($item==$_GET["item_id"]) {unset($_SESSION["cart_array"], $item);
> break;}
> }
>
> But it removes ALL items from the cart. And then when I view the cart
> on the next page, EVERYTHING is back, including the item I tried to
> remove. What am I doing wrong? Thanks!
>
> - Brian
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

attached mail follows:


danielelectroteque.org <mailto:danielelectroteque.org>
    on Wednesday, February 18, 2004 5:18 PM said:

> I dont understand what you are doing with the md5, and
>
> i assume YOU will know which file is the latest version.
>
> this is what i have to try and find out to prevent that.

the md5 thing will just give you an easy way to determine if two (or
more) files are different from each other. even if there's one byte
different within the files, you'll get a different hash from the md5
function.

if you don't know what an md5 hash is you can use this as an example:

<?php

        echo md5("stereolab")."<br/>";
        echo md5("stareolab")."<br/>";

?>

it's possible to perform an md5 hash on an entire file from the command
line so you'll need to figure out how to do that. if you so choose to do
that at all.

chris.

attached mail follows:


I don't see what's wrong with this if statement:

while ... and ... {
   if (($pic_num + 1) <= $thumb_num {
      $tab = ((($pics * $page) - 1) + $pic_num); }

Error unexpected ";" on the last line there.

I added some extra () to make sure I had everything together & not two
statements or something odd like that. The while loop above works with
the if statement removed.

attached mail follows:


should be
if (($pic_num + 1) <= $thumb_num) {

Paul, with PHP the Parsers error is usally above the line number that's
actually reffered to.

Paul Furman wrote:

> I don't see what's wrong with this if statement:
>
> while ... and ... {
> if (($pic_num + 1) <= $thumb_num {
> $tab = ((($pics * $page) - 1) + $pic_num); }
>
> Error unexpected ";" on the last line there.
>
>
> I added some extra () to make sure I had everything together & not two
> statements or something odd like that. The while loop above works with
> the if statement removed.
>

--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.

attached mail follows:


Did you close your loop?

while ... and ... {
   if (($pic_num + 1) <= $thumb_num {
      $tab = ((($pics * $page) - 1) + $pic_num);
   }
}

alex

******************************************************************
The contents of this e-mail and any files transmitted with it are
confidential and intended solely for the use of the individual or
entity to whom it is addressed. The views stated herein do not
necessarily represent the view of the company. If you are not the
intended recipient of this e-mail you may not copy, forward,
disclose, or otherwise use it or any part of it in any form
whatsoever. If you have received this e-mail in error please
e-mail the sender.
******************************************************************

attached mail follows:


You also forgot to close your "if statement".

while ... and ... {
   if (($pic_num + 1) <= $thumb_num) {
      $tab = ((($pics * $page) - 1) + $pic_num); }

alex

> -----Original Message-----
> From: Paul Furman [mailto:pauledgehill.net]
> Sent: Thursday, February 19, 2004 11:33 AM
> To: php-generallists.php.net
> Subject: [PHP] Unexpected ";"
>
> I don't see what's wrong with this if statement:
>
> while ... and ... {
> if (($pic_num + 1) <= $thumb_num {
> $tab = ((($pics * $page) - 1) + $pic_num); }
>
> Error unexpected ";" on the last line there.
>
>
> I added some extra () to make sure I had everything together & not two
> statements or something odd like that. The while loop above works with
> the if statement removed.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

******************************************************************
The contents of this e-mail and any files transmitted with it are
confidential and intended solely for the use of the individual or
entity to whom it is addressed. The views stated herein do not
necessarily represent the view of the company. If you are not the
intended recipient of this e-mail you may not copy, forward,
disclose, or otherwise use it or any part of it in any form
whatsoever. If you have received this e-mail in error please
e-mail the sender.
******************************************************************

attached mail follows:


You're missing a right bracket within the if statement.

Paul Furman wrote:
> ***********************************************
> This Email Has Been Virus Swept
> ***********************************************
>
> I don't see what's wrong with this if statement:
>
> while ... and ... {
> if (($pic_num + 1) <= $thumb_num {
> $tab = ((($pics * $page) - 1) + $pic_num); }
>
> Error unexpected ";" on the last line there.
>
>
> I added some extra () to make sure I had everything together & not two
> statements or something odd like that. The while loop above works with
> the if statement removed.
>

--
----------------------
  www.curvedvision.com
----------------------

This communication is confidential to the intended recipient(s). If you are not that person you are not permitted to make use of the information and you are requested to notify the sender immediately of its receipt then destroy the copy in your possession. Any views or opinions expressed are those of the originator and may not represent those of Advanced System Architectures Ltd.

*** This Email Has Been Virus Checked ***

attached mail follows:


>I don't see what's wrong with this if statement:
>
>while ... and ... {
> if (($pic_num + 1) <= $thumb_num {
> $tab = ((($pics * $page) - 1) + $pic_num); }

Looks like you need an editor that's syntax-aware.
May I recommend: jEdit, BBedit, UltraEdit?

---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca http://mike.teczno.com/contact.html

attached mail follows:


Thanks folks, it was the missing paren on the if statement.
if (...{...}
if (...){...}

I'm using PSPad as an editor with syntax highlighting and it works
pretty well but I don't always <g>.

Paul Furman wrote:

> I don't see what's wrong with this if statement:
>
> while ... and ... {
> if (($pic_num + 1) <= $thumb_num {
> $tab = ((($pics * $page) - 1) + $pic_num); }
>
> Error unexpected ";" on the last line there.
>
>
> I added some extra () to make sure I had everything together & not two
> statements or something odd like that. The while loop above works with
> the if statement removed.

attached mail follows:


Paul Furman wrote:

> I don't see what's wrong with this if statement:
>
> while ... and ... {
> if (($pic_num + 1) <= $thumb_num {
------------------------------------^

You're missing a closing parentheses...

> $tab = ((($pics * $page) - 1) + $pic_num); }
>
> Error unexpected ";" on the last line there.
>
>
> I added some extra () to make sure I had everything together & not two
> statements or something odd like that. The while loop above works with
> the if statement removed.
>

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

attached mail follows:


PEAR DB is just a pckage which allows you to connect to any DB with the
same interface, it will work with mysql.

http://pear.php.net/package/DB

If you don't want to use that, just switch the calls to mysql ones:

function getSelect(&$link, $catParent = 0, $indent = '') {
   $sth = mysql_query('SELECT * FROM categories WHERE Cat_Parent =
'.$catParent, $link);
   while($rec = mysql_fetch_assoc($sth)) {
     echo '<option
value="'.$rec['Cat_ID'].'">'.$indent.$rec['Cat_Name'].'</option>';
     getSelect($link, $rec['Cat_ID'], $indent.' ');
   }
}

$link = mysql_connect('example.com', 'username', 'password');
echo '<select name="selectBox">';
getSelect($link);
echo '</select>';

Matt Palermo wrote:

> No, i'm using a MySQL DB.
>
> "Justin Patrin" <papercranereversefold.com> wrote in message
> news:20040218220602.22224.qmailpb1.pair.com...
>
>>Matt Palermo wrote:
>>
>>
>>>Hey everyone. I'm looking for assistance/suggestions/answers on how to
>>>build a select dropdown box from data that needs to be pulled
>
> recursively
>
>>>from a MySQL database. Basically the situation is mainly for a
>
> dicussion
>
>>>thread system type of thing where I have categories nested inside
>>>categories, nested inside categories... Anyway, I want to be able to
>
> build
>
>>>a drop down box containing all the categories indented underneath it's
>>>parent category to look something similar to this:
>>>
>>>-------------------------
>>>Top Level Category
>>> - Nested Category
>>> - Lower level
>>> - Etc....
>>>Top Level Category
>>> - Nested Category
>>>Top Level Category
>>>-------------------------
>>>
>>>Then the user will be able to select one from the dropdown menu. I have
>
> all
>
>>>the categories stored in a MySQL database called site_categories. The
>
> table
>
>>>is setup like this:
>>>
>>>__________________________________
>>>| Cat_ID | Cat_Parent | Cat_Name |
>>>|---------------------------------------------|
>>>| 1 | 0 | Top Level 1 |
>>>|---------------------------------------------|
>>>| 2 | 1 | Nested 1 |
>>>|---------------------------------------------|
>>>| 3 | 0 | Top Level 2 |
>>>|---------------------------------------------|
>>>| 4 | 2 | Nested 2 |
>>>|---------------------------------------------|
>>>
>>>Sorry for the bad pictures you hopefully you get the idea. Anything
>
> with a
>
>>>0 Cat_Parent is a Top Level category. Then the others are all nested
>
> inside
>
>>>other categories that have the same Cat_ID as the nested categories
>>>Cat_Parent. I basically need help creating a properly indented dropdown
>>>menu box using this structure from the database. I assume I'm gonna
>
> have to
>
>>>use some sort of recursion here, but I'm not sure how to go about this.
>>>Please help if you can.
>>>
>>>Thanks,
>>>
>>>Matt
>>>http://sweetphp.com
>>
>>I'd suggest using a recursive function. (I'm assuming you're using PEAR
>>DB...)
>>
>>function getSelect(&$db, $catParent = 0, $indent = '') {
>> $sth = $db->query('SELECT * FROM categories WHERE Cat_Parent =
>>'.$catParent);
>> while($rec = $sth->fetchRow()) {
>> echo '<option
>>value="'.$rec['Cat_ID'].'">'.$indent.$rec['Cat_Name'].'</option>';
>> getSelect($db, $rec['Cat_ID'], $indent.' ');
>> }
>>}
>>
>>$db = DB::connect('mysql://user:passhost/db');
>>$db->setFetchMode(DB_FETCHMODE_ASSOC);
>>echo '<select name="selectBox">';
>>getSelect($db);
>>echo '</select>';
>>
>>I think that will work ;-)
>>
>>
>>--
>>paperCrane <Justin Patrin>

--
--
paperCrane <Justin Patrin>

attached mail follows:


hello,

how can i put the character \ in a variable ?

I've done the code below but errors occurs :

$barre_oblique = "\";

Parse error: parse error, unexpected T_STRING

Please help !!!!

attached mail follows:


Escape it.

$string = "\\";

Or, use single quotes:

$string = '\';

On Thu, 2004-02-19 at 12:49, Dominique ANOKRE wrote:
> hello,
>
>
> how can i put the character \ in a variable ?
>
> I've done the code below but errors occurs :
>
> $barre_oblique = "\";
>
>
> Parse error: parse error, unexpected T_STRING
>
> Please help !!!!
--

Adam Voigt
adamkotisprop.com

attached mail follows:


Whoops, mistyped on my reply, you need to escape it with the single
quotes to.

On Thu, 2004-02-19 at 12:49, Dominique ANOKRE wrote:
> hello,
>
>
> how can i put the character \ in a variable ?
>
> I've done the code below but errors occurs :
>
> $barre_oblique = "\";
>
>
> Parse error: parse error, unexpected T_STRING
>
> Please help !!!!
--

Adam Voigt
adamkotisprop.com

attached mail follows:


Hello Dominique,

Thursday, February 19, 2004, 5:49:43 PM, you wrote:

DA> how can i put the character \ in a variable ?
DA> I've done the code below but errors occurs :
DA> $barre_oblique = "\";
DA> Parse error: parse error, unexpected T_STRING
DA> Please help !!!!

$barre_oblique = "\\";

--
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

attached mail follows:


ok thanks
pb solved

thank you everybody
----- Original Message -----
From: "Richard Davey" <richlaunchcode.co.uk>
To: "Dominique ANOKRE" <dominique.anokrebull.ci>
Cc: "Php List" <php-generallists.php.net>
Sent: Thursday, February 19, 2004 5:52 PM
Subject: Re: [PHP] variables

> Hello Dominique,
>
> Thursday, February 19, 2004, 5:49:43 PM, you wrote:
>
> DA> how can i put the character \ in a variable ?
> DA> I've done the code below but errors occurs :
> DA> $barre_oblique = "\";
> DA> Parse error: parse error, unexpected T_STRING
> DA> Please help !!!!
>
> $barre_oblique = "\\";
>
> --
> Best regards,
> Richard Davey
> http://www.phpcommunity.org/wiki/296.html
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


Hello All,
I am trying to do a install script.

Here is my question:
I want to do a $prefix

This is what I have:
$prefix = "demo_";

$table_name = '.$prefix."auth_users"';

This is not working, am I missing something??

Thanks in advance,
~WILL~

attached mail follows:


Hello [Scripts],

Thursday, February 19, 2004, 6:14:31 PM, you wrote:

S> This is what I have:
S> $prefix = "demo_";

S> $table_name = '.$prefix."auth_users"';

S> This is not working, am I missing something??

Just syntax/quote issues, try:

$table_name = $prefix . "auth_users";

So much simpler :)

--
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

attached mail follows:


I have data that looks like this:

(20, '1915', '192', '', '', '312', '525', '404', '', 'title')
(21, '1915', '338', '', '', '736', '0', '929', '', 'title')
(22, '1917', '193', '', '', '447', '0', '1275', '', 'title')
(23, '1919', '129', '', '', '208', '636', '0', '', 'title')
(24, '1919', '274', '', '', '581', '321', '1634', '', 'title')

The second value is the year, I have have multiple files for the same year.
What I want to do is output the values under Year sub headings.

So it prints like this:
-------------------------------------

<b>1915</b>
<p>(20, '1915', '192', '', '', '312', '525', '404', '', 'title')<br>
(21, '1915', '338', '', '', '736', '0', '929', '', 'title')

<b>1917</b>
<p>(22, '1917', '193', '', '', '447', '0', '1275', '', 'title')

<b>1919</b>
<p>(23, '1919', '129', '', '', '208', '636', '0', '', 'title')<br>
(24, '1919', '274', '', '', '581', '321', '1634', '', 'title')

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

I have a function that displays each "history" in a loop. Here's the
function:

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

function display_history($dbArray,$yearArray)
{
 while($field = mysql_fetch_array($dbArray))
 {
  $yeartitle="";
   while($years = mysql_fetch_array($yearArray))
  {
   if ( $years["year"] != $yeartitle)
   {
    print "<p><b>" . $years["year"] . "</b>";
   }
    print "<p><a href=\"" . $field["filename"] . "\">" . $field["year"];
    //print the Resolution or Act Number
    if (!$field["res_no"] && !$field["j_res_no"])
    {
     print " - Act # " . $field["act_no"];
    }
    elseif (!$field["act_no"] && !$field["j_res_no"])
    {
     print " - Res # " . $field["res_no"];
    }
    else
    {
     print " - J.Res.# " . $field["j_res_no"];
    }

    //print the Public Law Number
    if ($field["pl_no"]!=0)
    {
     print ", P.L. " . $field["pl_no"];
    }
    //print the Senate Bill Number
    if ($field["sb_no"]!=0)
    {
     print ", SB " . $field["sb_no"];
    }

    //print the House Bill Number
    if ($field["hb_no"]!=0)
    {
     print ", HB " . $field["hb_no"];
    }

    //close the link
    print "</a> - ";

    //print the Misc Text or Part Number if there is one
    if ($field["misc_part_no"] != "")
    {
     print $field["misc_part_no"] . " - ";
    }

    //print the title and number of pages
    print $field["title"] . " - [" . $field["pgs"] . " pgs - ";

    //print the file size
    if ($field["mb"] != 0)
    {
     print $field["mb"] . "mb]";
    }
    else
    {
     print $field["kb"] . "kb] ";
    }
   $yeartitle = $years["year"];
  }
 }
}

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

The values being passed in are:

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

//get all of the histories from the table sorted by year
//then resolution number then by act number
$result = mysql_query("SELECT * FROM table ORDER BY
year, res_no, j_res_no, act_no, misc_part_no",$connect);

//get the years from the same table
$yrArray = mysql_query("SELECT * FROM table ORDER BY
 year",$connect);

//display histories
display_history($result,$yrArray);

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

I'm sure it's an easy solution ... but here's what a resulting page looks
like:

-------------------------------------
1501

1501 - Act # 90, P.L. 647, SB 582 - this test - [5 pgs - 55kb]

1913

1501 - Act # 90, P.L. 647, SB 582 - this test - [5 pgs - 55kb]
1501 - Act # 90, P.L. 647, SB 582 - this test - [5 pgs - 55kb]
1501 - Act # 90, P.L. 647, SB 582 - this test - [5 pgs - 55kb]
1501 - Act # 90, P.L. 647, SB 582 - this test - [5 pgs - 55kb]

1925

1501 - Act # 90, P.L. 647, SB 582 - this test - [5 pgs - 55kb]
1501 - Act # 90, P.L. 647, SB 582 - this test - [5 pgs - 55kb]
-------------------------------------

And so on, always putting the right years and the right number of histories
below the year, but always listing the first history and nothing else. My
loop works if I don't have the while loop in there with the subheadings ...

Thank in advance for any help you can offer!

attached mail follows:


Nicole <mailto:ndiratojenkinslaw.org>
    on Thursday, February 19, 2004 10:28 AM said:

> I have data that looks like this:

[snip]

> The second value is the year, I have have multiple files for the same
> year. What I want to do is output the values under Year sub headings.

ok woh. that's way too much code for me to wade through so i'll just
give you some ideas. hopefully you're not already implementing it.

1. you want to put your data in order (either ascending or descending)
but the year. and according to your short data snippet it looks like
you're already doing this. good job.

2. you need to somehow compare the date that's currently ready to be
printed with what was ALREADY printed. the way you do this is by having
a temporary variable that stores the previous year data. when the next
loop cycle occurs you can say "is this current date the same as the
previous cycles date?" and then act appropriately.

for (...)
{
        $current_date = $new_date;

        // if the current date does not equal the
        // old date you're obviously moving into
        // a new year and you should therefore
        // start a new group.
        if ($current_date != $old_date)
        {
                echo "<br/><br/>1915<br/>\n";
        }
        else
        {
                echo "&nbsp;&nbsp;(20, '1915', ...)<br/>\n";
        }

        $old_date = $current_date;
}

but of course instead of hard coding what gets printed you'd use your
variables to print the correct values.

hth,
chris.

attached mail follows:


Sorry about all of the code. I do do what you say to do there.

My year sub headings are changing correctly, it's the data that's printed
under each heading that isn't correct.

Nicole

"Chris W. Parker" <cparkerswatgear.com> wrote in message
news:001BD19C96E6E64E8750D72C2EA0ECEE4478F0ati-ex-01.ati.local...
Nicole <mailto:ndiratojenkinslaw.org>
    on Thursday, February 19, 2004 10:28 AM said:

> I have data that looks like this:

[snip]

> The second value is the year, I have have multiple files for the same
> year. What I want to do is output the values under Year sub headings.

ok woh. that's way too much code for me to wade through so i'll just
give you some ideas. hopefully you're not already implementing it.

1. you want to put your data in order (either ascending or descending)
but the year. and according to your short data snippet it looks like
you're already doing this. good job.

2. you need to somehow compare the date that's currently ready to be
printed with what was ALREADY printed. the way you do this is by having
a temporary variable that stores the previous year data. when the next
loop cycle occurs you can say "is this current date the same as the
previous cycles date?" and then act appropriately.

for (...)
{
$current_date = $new_date;

// if the current date does not equal the
// old date you're obviously moving into
// a new year and you should therefore
// start a new group.
if ($current_date != $old_date)
{
echo "<br/><br/>1915<br/>\n";
}
else
{
echo "&nbsp;&nbsp;(20, '1915', ...)<br/>\n";
}

$old_date = $current_date;
}

but of course instead of hard coding what gets printed you'd use your
variables to print the correct values.

hth,
chris.

attached mail follows:


Hello Nicole,

Thursday, February 19, 2004, 6:28:13 PM, you wrote:

N> And so on, always putting the right years and the right number of histories
N> below the year, but always listing the first history and nothing else. My
N> loop works if I don't have the while loop in there with the subheadings ...

In looking quickly at the code, I can't see a chance for the $field
value to ever be updated. You call it once (in the first while
statement) and populate the field array with the SQL results, you then
move into the 2nd while loop which handles the years. But once in that
loop you don't fill the $field array with any new data, so it's using
the same data over and over again for every year. I believe, although
I've not looked at it for very long, it's simply that the while loops
are nested in such a way that the field values never get a chance to
re-populate themselves.

--
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

attached mail follows:


That's exactly it!

I don't know why I didn't think about that. For anyone else reading this, I
added

$field = mysql_fetch_array($dbArray);

above the line that reads

$yeartitle = $years["year"];

And now it works!

"Richard Davey" <richlaunchcode.co.uk> wrote in message
news:1849384669.20040219191241launchcode.co.uk...
> Hello Nicole,
>
> Thursday, February 19, 2004, 6:28:13 PM, you wrote:
>
> N> And so on, always putting the right years and the right number of
histories
> N> below the year, but always listing the first history and nothing else.
My
> N> loop works if I don't have the while loop in there with the subheadings
...
>
> In looking quickly at the code, I can't see a chance for the $field
> value to ever be updated. You call it once (in the first while
> statement) and populate the field array with the SQL results, you then
> move into the 2nd while loop which handles the years. But once in that
> loop you don't fill the $field array with any new data, so it's using
> the same data over and over again for every year. I believe, although
> I've not looked at it for very long, it's simply that the while loops
> are nested in such a way that the field values never get a chance to
> re-populate themselves.
>
> --
> Best regards,
> Richard Davey
> http://www.phpcommunity.org/wiki/296.html

attached mail follows:


Can we take this one step further and make it so that if you're searching
and you want to only see histories with the works "parking" in the title it
only puts the year headings for the years that actually have a history that
meets this criteria?

attached mail follows:


Is there any way to deal with PDFS using PHP and not installing PHPlib? I
simply need to pull the first page of a PDF document and print it out
using PHP. (Like a PDF preview of sorts)...

Any ideas?

Russ Jones

attached mail follows:


Russell P Jones wrote:
> Is there any way to deal with PDFS using PHP and not installing PHPlib? I
> simply need to pull the first page of a PDF document and print it out
> using PHP. (Like a PDF preview of sorts)...
>
> Any ideas?
>
> Russ Jones
>

Do you want to print the pdf on the server? PHPlib would not help you
with this, it's for creating pdf documents. On unices you can execute
lpr(1) command. I don't know about windoses.

attached mail follows:


hi there

how do i make php give me yesterday's date?

i tried

date("Y-m-d")-1

but if today would be the 1st of july (2004-07-01), yesterday would be 00.
july (2004-07-00) according to that calculator.
is there any way to make this one get it right? without any if-structures if
possible

regards

attached mail follows:


[snip]
hi there

how do i make php give me yesterday's date?

i tried

date("Y-m-d")-1

but if today would be the 1st of july (2004-07-01), yesterday would be
00.
july (2004-07-00) according to that calculator.
is there any way to make this one get it right? without any
if-structures if
possible
[/snip]

http://www.php.net/strtotime

attached mail follows:


    Hello! My name is Artem!
    I want to tell you about my problem. Please, help me....
When I changed my "httpd.conf" file like in book by Julie C.Meloni, I try to open file phpinfo.php from directory "C:\Program Files\Apache Group\Apache2\htdocs".
But when I open Internet Explorer and write http://localhost/phpinfo.php in it I see an error like "Object not found!". Why?

I attached my "httpd.conf" file... Maybe deal in this file?
    Please, answer me... I really need your help...
    Artem.

attached mail follows:


ãÙÇÁÎÅÎËÏ áÒÔ£Í wrote:

> Hello! My name is Artem!
> I want to tell you about my problem. Please, help me....
> When I changed my "httpd.conf" file like in book by Julie C.Meloni, I
> try to open file phpinfo.php from directory "C:\Program Files\Apache
> Group\Apache2\htdocs".
> But when I open Internet Explorer and write
> http://localhost/phpinfo.php in it I see an error like "Object not
> found!". Why?

Do you have the file phpinfo.php in C:\Program Files\Apache
Group\Apache2\htdocs?

Please don't send HTML format message to the list, instead a plain text
message is most welcome.

Best

Bao

>
> I attached my "httpd.conf" file... Maybe deal in this file?
> Please, answer me... I really need your help...
> Artem.
>
>
>
>

attached mail follows:


ãÙÇÁÎÅÎËÏ áÒÔ£Í wrote:

>Please, tell me, do you check my "httpd.conf" file?
>
>
Yes, I have checked your httpd.conf file. It is missing the following line:

LoadModule php4_module YourRealPath/php4apache2.dll

Please keep discussion on the list.

Best

Bao

>Maybe deal in it??
>____________________________
>E-mail: tomas-artemlist.ru
>
>
>
>----- Original Message -----
>From: "BAO RuiXian" <ruixian.baopp.inet.fi>
>To: "ãÙÇÁÎÅÎËÏ áÒÔ£Í" <tomas-artemlist.ru>
>Cc: <php-generallists.php.net>
>Sent: Thursday, February 19, 2004 11:40 PM
>Subject: Re: [PHP] Problem with Apache!
>
>
>
>
>>ãÙÇÁÎÅÎËÏ áÒÔ£Í wrote:
>>
>>
>>
>>> Hello! My name is Artem!
>>> I want to tell you about my problem. Please, help me....
>>>When I changed my "httpd.conf" file like in book by Julie C.Meloni, I
>>>try to open file phpinfo.php from directory "C:\Program Files\Apache
>>>Group\Apache2\htdocs".
>>>But when I open Internet Explorer and write
>>>http://localhost/phpinfo.php in it I see an error like "Object not
>>>found!". Why?
>>>
>>>
>>Do you have the file phpinfo.php in C:\Program Files\Apache
>>Group\Apache2\htdocs?
>>
>>Please don't send HTML format message to the list, instead a plain text
>>message is most welcome.
>>
>>Best
>>
>>Bao
>>
>>
>>
>>>I attached my "httpd.conf" file... Maybe deal in this file?
>>> Please, answer me... I really need your help...
>>> Artem.
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>
>
>
>

attached mail follows:


Hi Everyone,

Oddball error randomly shows up when accessing pages on my web hosting
provider. The error message is below.

My account is obb4wine. PHP behaves as if I'm the account budguy when
the script error occurs. A page refresh usually makes the error go
away. The error happens frequently enough that site users are
complaining.

Any ideas?

-Ed

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

PHP: 4.3.4. (See below for Configure Command)
 
Apache: Apache/1.3.29 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2
mod_bwlimited/1.4 PHP/4.3.4 FrontPage/5.0.2.2634 mod_ssl/2.8.16
OpenSSL/0.9.6b

------------------------------------------------------------------------
----
Error Message:
------------------------------------------------------------------------
----
Warning: Unknown(): open_basedir restriction in effect.
File(/home/obb4wine/public_html/prepend.php) is not within the allowed
path(s): (/home/budguy:/usr/lib/php:/usr/local/lib/php:/tmp) in Unknown
on line 0

Warning: Unknown(/home/obb4wine/public_html/prepend.php): failed to open
stream: Operation not permitted in Unknown on line 0

Warning: (null)(): Failed opening
'/home/obb4wine/public_html/prepend.php' for inclusion
(include_path='.:/home/obb4wine/public_html') in Unknown on line 0

-------------------------------------------------
PHP Configure Command
-------------------------------------------------

'./configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-xml'
'--enable-bcmath' '--enable-calendar' '--with-curl' '--with-dom'
'--with-dom-xslt' '--with-dom-exslt' '--enable-ftp' '--with-gd'
'--with-jpeg-dir=/usr/local' '--with-png-dir=/usr'
'--with-xpm-dir=/usr/X11R6' '--with-imap' '--with-imap-ssl'
'--with-kerberos' '--with-mcrypt' '--with-ming=../ming-0.2a'
'--enable-magic-quotes' '--with-mysql=/usr' '--with-openssl'
'--with-pear' '--enable-xslt' '--with-xslt-sablot' '--enable-sockets'
'--enable-track-vars' '--enable-versioning' '--enable-wddx'
'--with-xmlrpc' '--with-zlib'

attached mail follows:


Hi all,

I'm building a CMS that does heavy parsing of a "HTML shorthand" plain
text to XHTML strict, in a similar way to Textile
<http://www.textism.com/tools/textile/>.

The problem is this conversion might take place on 2-3 columns of text,
and unlimited other fields (my CMS has user-defined data models), and
since they'll need to edit this text at a later date, I either need to:

1. Parse the text on demand into HTML -- the parsing script is to
heavy/slow for this.

2. Store both the plain (shorthand HTML) text and parsed XHTML versions
of each field -- the problem with this being that i'm storing double
the data in the database... combine this with versioning of each
'page', and I'm going to be storing a LOT of data in the DB.

100 articles x 3 versions each x 500 words x 6 chars per word = 900,000
chars;
add a whole bunch of XHTML to this, and it's looking pretty huge.
Double the articles or versions, and it's scary :)

It also means I need to have two fields for each "field" (input and
parsed), which makes the MySQL tables a lot more complex, etc.

3. write a reverse set of functions which converts the XHTML back to
the shorthand on demand for editing -- this seems great, but I don't
like the idea of maintaining two functions for such a beast.

Has anyone got any further ideas?

---
Justin French
http://indent.com.au

attached mail follows:


Hi Justin,

> I'm building a CMS that does heavy parsing of a "HTML shorthand" plain
> text to XHTML strict, in a similar way to Textile
> <http://www.textism.com/tools/textile/>.
> The problem is this conversion might take place on 2-3 columns of text,
> and unlimited other fields (my CMS has user-defined data models),

Could you please provide a short example or an URL of your data model?
This would clear things a little bit.

> 2. [...] I'm going to be storing a LOT of data in the DB.

Why not save both as files? Maybe you find a structure for this, i.e.
http://example.org/articles/2004/02/19/text34_v3.html or something like
this. You save the "editfiles" and cache the xhtml-output.

> 3. write a reverse set of functions which converts the XHTML back to the
> shorthand on demand for editing -- this seems great, but I don't like
> the idea of maintaining two functions for such a beast.

Only parse one way. I mean only from your format to XHTML. There is no
need for converting back (I believe). your people edit the text, after
that they open up the browser and hitting refresh. So that's when your
parser comes in play. And with caching only once per document.

--
Torsten