php-general Digest 13 Jan 2001 00:13:41 -0000 Issue 451

Topics (messages 34235 through 34330):

Urgent - Special Characters
        34235 by: TV Karthick Kumar

Re: Question
        34236 by: Johan Holst Nielsen
        34238 by: Cynic
        34240 by: Johan Holst Nielsen

Re: Urgent: Special Characters
        34237 by: Cynic

strange error
        34239 by: Leon Mergen, BlazeNetwork
        34241 by: Pavel Jartsev

Re: Special Characters
        34242 by: TV Karthick Kumar
        34243 by: lists.www.mulga.com.au
        34244 by: TV Karthick Kumar
        34328 by: Alex Black

Re: Limit image height/width on upload
        34245 by: joe.jwebmedia.com

Re: apache+php4 error ..
        34246 by: John Meyerhofer
        34271 by: Naresh Chafekar
        34273 by: Naresh Chafekar

Re: Session Help (transparent sid's)
        34247 by: Pickup, Jordan

upload _ safe_mode
        34248 by: andreas \(.work\)
        34270 by: Philip Olson

Re: APC Alternative PHP Cache Release Announcement
        34249 by: Michael Kimsal
        34255 by: Monte Ohrt

Problem with Exec()
        34250 by: Jon Haworth

Re: mixing HTML and PHP code
        34251 by: MR
        34256 by: MR
        34257 by: Hrishi
        34258 by: Antonio S. Martins Jr.
        34276 by: Alex Black
        34277 by: Alex Black
        34279 by: Alex Black
        34281 by: Alex Black
        34283 by: Alexander Wagner
        34287 by: Mark Maggelet
        34290 by: Jade Ohlhauser
        34291 by: MR
        34297 by: MR
        34298 by: Mark Maggelet
        34300 by: Tim Zickus
        34319 by: Alex Black
        34320 by: Alex Black
        34321 by: Alex Black
        34324 by: Alex Black
        34325 by: Alex Black

Re: apple-macintosh
        34252 by: Michael Stearne
        34327 by: Alex Black

GD graphics extension question
        34253 by: Paul Trapnell

IFX_CONNECT function
        34254 by: Riccardo Vitella

Is there a function to subtract dates
        34259 by: Matthew Brealey
        34261 by: Rasmus Lerdorf

Sorting an array
        34260 by: Matthew Brealey
        34263 by: Monte Ohrt

Question about phpinfo() and XML
        34262 by: Noah Spitzer-Williams
        34275 by: Moritz Petersen

money data type cause problem in connection to Mssql7.0
        34264 by: michael.smartemail.net
        34266 by: Joe Stump

Looking for a freeware PHP/MySQL classifieds script
        34265 by: John Guynn
        34267 by: Joe Stump
        34269 by: John Guynn

newbie
        34268 by: Kenneth R Zink II

PHP mungin $xx when returned from a DB.
        34272 by: Cameron Watters -- List Subscriptions
        34282 by: Cameron Watters -- List Subscriptions

Re: APC Cache and eval()
        34274 by: George Schlossnagle
        34278 by: George Schlossnagle
        34280 by: George Schlossnagle

advise (MyCart)
        34284 by: Jerry Lake

session vars with recursive form
        34285 by: bill
        34286 by: Javier Muniz
        34289 by: bill

Re: <?= was born when?
        34288 by: Jim Winstead

on style (was mixing PHP and HTML code)
        34292 by: DanO
        34295 by: Mark Maggelet
        34322 by: Alex Black

odbc_* <-> MyODBC <-> MySQL
        34293 by: Cynic

Forms with Field Arrays and JavaScript
        34294 by: Diego Fulgueira

CodeCharge
        34296 by: Jerry Lake

How do I store a pic?
        34299 by: Kenneth R Zink II
        34329 by: Shane McBride

WinHelp Documentation Uploaded
        34301 by: Derick Rethans

APC cache and Solaris
        34302 by: George Schlossnagle

mysql php4.04 and  safe_mode
        34303 by: andreas \(.work\)

PHP 4.0.4pl1 as CGI
        34304 by: Devin Atencio
        34305 by: Devin Atencio

HTTP_REFERER not giving proper results
        34306 by: Chakravarthy K Sannedhi

regex
        34307 by: Jerry Lake
        34308 by: Cynic
        34310 by: Jerry Lake
        34311 by: Cynic
        34312 by: Steve Edberg
        34314 by: Jerry Lake
        34317 by: Cynic
        34323 by: Jerry Lake

Sessions
        34309 by: Randy Johnson

Script execution Speed
        34313 by: Randy Johnson
        34315 by: Cynic
        34326 by: Alex Black

Simple form not passing variables, Why??
        34316 by: jeff fitzmyers
        34318 by: Cynic

Templates
        34330 by: PeterOblivion.aol.com

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]


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


Hi all,

    I have a problem while converting the string into upper case by using
the strtoupper function.

    I want to convert the string which has some special characters in it.
For example, med vänlig hälsning, António etc. There are lots of strings /
words with some special characters in it. It cannot be listed.

    As I want to convert them into upper case, I tried.strtoupper(hälsning),
it's just converting it as: HäLSNING and then writes
onto the database. But I want that special character - ' ä ' also to be
converted into upper case and then onto the database. How do I get rid of
this problem and convert into upper case ?.

    PLS. HELP ME.

    Thanks in advance.

~ Karthick






>Is there a way in PHP to get the size of a directory? (so I can see how much disk 
>space my >users are using in their home directory).

>Can someone also tell me what the PHP General list is exactly. Is it run by PHP folk 
>only? Can >I subscribe to this list somewhere and maybe help someone else out for a 
>change?

Yes! Try to see this, it isn't tested, just maked out of memory!

<?
$totalfilesize = 0;
$dir=opendir('.');
while (($files = readdir($dir))!==false) {
    $totalfilesize .= filesize($files);
}
closedir($dir);
print($totalfilesize." bytes");
?>
      
      

      





you probably meant $totalfilesize += filesize($files);
                                  ^

At 13:17 12.1. 2001, Johan Holst Nielsen wrote the following:
-------------------------------------------------------------- 
>>Is there a way in PHP to get the size of a directory? (so I can see how much disk 
>space my >users are using in their home directory).
>
>>Can someone also tell me what the PHP General list is exactly. Is it run by PHP folk 
>only? Can >I subscribe to this list somewhere and maybe help someone else out for a 
>change?
>
>Yes! Try to see this, it isn't tested, just maked out of memory!
>
><?
>$totalfilesize = 0;
>$dir=opendir('.');
>while (($files = readdir($dir))!==false) {
>    $totalfilesize .= filesize($files);
>}
>closedir($dir);
>print($totalfilesize." bytes");
>?>
>      
>      
>
>      
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
------end of quote------ 



____________________________________________________________
Cynic:

A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.

[EMAIL PROTECTED]






> you probably meant $totalfilesize += filesize($files);

Offcause. Sorry just think I'm a bit tired ;o). But the rest should work?

With Best Regards

Johan





IIRC the conversion rules are locale specific. use setlocale() 
to set appropriate environment.

At 13:01 12.1. 2001, TV Karthick Kumar wrote the following:
-------------------------------------------------------------- 
>Hi all,
>
>    I have a problem while converting the string into upper case by using
>the strtoupper function.
>
>    I want to convert the string which has some special characters in it.
>For example, med vänlig hälsning, António etc. There are lots of strings /
>words with some special characters in it. It cannot be listed.
>
>    As I want to convert them into upper case, I tried.
>strtoupper(hälsning), it's just converting it as: HäLSNING and then writes
>onto the database. But I want that special character - ' ä ' also to be
>converted into upper case and then onto the database. How do I get rid of
>this problem and convert into upper case ?.
>
>    PLS. HELP ME.
>
>    Thanks in advance.
>
>~ Karthick
>
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
------end of quote------ 



____________________________________________________________
Cynic:

A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.

[EMAIL PROTECTED]






  Warning: REG_EPAREN in /home/coolguest/html/db/functions.php3 on line 13
   

What does this mean? The statement that is located there, is:

 $string = eregi_replace(">:(","<img src=\"/images/smileys/sm2.gif\" border=\"0\" 
width=\"15\" height=\"15\"",$string);

What is wrong with this? What can I do to fix it?

Thanks in advance,

Leon Mergen





"Leon Mergen, BlazeNetwork" wrote:
> 
> ...
>
>  $string = eregi_replace(">:(","<img src=\"/images/smileys/sm2.gif\" border=\"0\" 
>width=\"15\" height=\"15\"",$string);
> 
> What is wrong with this? What can I do to fix it?
> 

Use this pattern: ">:\("
Point is, you must escape "(" here, 'cause it's metacharacter in regexp.


Hope this helps.

-- 
Pavel a.k.a. Papi




Thanks a million for your mail. It's very helpful for me.

This is fine. But can I use this for all the Special Characters. I mean,
this should NOT be working only with one language or so. I want this to be
working with all the Special Characters and Languages available in this
world.

Pls. give me more info on this.

Thanks,
~ Karthick


You wrote a swedish sentence :-)

U can use strtr to exchange characters in a string, based on a list of chars
to be changed, like:

<?
$string = "Vänlig hälsning André";
$newstring = strtoupper(strtr( $string, "æøåéáíóúëäïöüàèìòùêâîôûñãõ",
"ÆØÅÉÁÍÓÚËÄÏÖÜÀÈÌÒÙÊÂÎÔÛÑÃÕ" ));
echo $newstring;
?>

Probably
-----Original Message-----
From: TV Karthick Kumar [mailto:[EMAIL PROTECTED]]
Sent: 12. januar 2001 13:20
To: Bryne Jørg Vidar
Subject: Re: [PHP] Urgent - Special Characters


Hi

    Can you write me in English ?. It seems that you are helping me. But I
want to get it in English.

    PLEASE HELP ME.

Thanks,
~ Karthick

----- Original Message -----
From: Bryne Jørg Vidar <[EMAIL PROTECTED]>
To: TV Karthick Kumar <[EMAIL PROTECTED]>
Sent: Friday, January 12, 2001 12:06 PM
Subject: RE: [PHP] Urgent - Special Characters


Hva med en rask løsning:
strtr( "Vänlig", "æøåéáíóúëäïöüàèìòùêâîôû", "ÆØÅÉÁÍÓÚËÄÏÖÜÀÈÌÒÙÊÂÎÔÛ" )


-----Original Message-----
From: TV Karthick Kumar [mailto:[EMAIL PROTECTED]]
Sent: 12. januar 2001 13:02
To: [EMAIL PROTECTED]
Subject: [PHP] Urgent - Special Characters


Hi all,

    I have a problem while converting the string into upper case by using
the strtoupper function.

    I want to convert the string which has some special characters in it.
For example, med vänlig hälsning, António etc. There are lots of strings /
words with some special characters in it. It cannot be listed.

    As I want to convert them into upper case, I tried.strtoupper(hälsning),
it's just converting it as: HäLSNING and then writes
onto the database. But I want that special character - ' ä ' also to be
converted into upper case and then onto the database. How do I get rid of
this problem and convert into upper case ?.

    PLS. HELP ME.

    Thanks in advance.

~ Karthick



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








I don't know what you're doing with your data, but it might be worth
knowing that in some languages such as Spanish and Italian (and French I
think) upper case letters are not always written with accents even though
the same word would have accents in lower case. 

On Fri, 12 Jan 2001, TV Karthick Kumar wrote:

> Thanks a million for your mail. It's very helpful for me.
> 
> This is fine. But can I use this for all the Special Characters. I mean,
> this should NOT be working only with one language or so. I want this to be
> working with all the Special Characters and Languages available in this
> world.
> 
> Pls. give me more info on this.
> 
> Thanks,
> ~ Karthick
> 
> 
> You wrote a swedish sentence :-)
> 
> U can use strtr to exchange characters in a string, based on a list of chars
> to be changed, like:
> 
> <?
> $string = "Vänlig hälsning André";
> $newstring = strtoupper(strtr( $string, "æøåéáíóúëäïöüàèìòùêâîôûñãõ",
> "ÆØÅÉÁÍÓÚËÄÏÖÜÀÈÌÒÙÊÂÎÔÛÑÃÕ" ));
> echo $newstring;
> ?>
> 
> Probably
> -----Original Message-----
> From: TV Karthick Kumar [mailto:[EMAIL PROTECTED]]
> Sent: 12. januar 2001 13:20
> To: Bryne Jørg Vidar
> Subject: Re: [PHP] Urgent - Special Characters
> 
> 
> Hi
> 
>     Can you write me in English ?. It seems that you are helping me. But I
> want to get it in English.
> 
>     PLEASE HELP ME.
> 
> Thanks,
> ~ Karthick
> 
> ----- Original Message -----
> From: Bryne Jørg Vidar <[EMAIL PROTECTED]>
> To: TV Karthick Kumar <[EMAIL PROTECTED]>
> Sent: Friday, January 12, 2001 12:06 PM
> Subject: RE: [PHP] Urgent - Special Characters
> 
> 
> Hva med en rask løsning:
> strtr( "Vänlig", "æøåéáíóúëäïöüàèìòùêâîôû", "ÆØÅÉÁÍÓÚËÄÏÖÜÀÈÌÒÙÊÂÎÔÛ" )
> 
> 
> -----Original Message-----
> From: TV Karthick Kumar [mailto:[EMAIL PROTECTED]]
> Sent: 12. januar 2001 13:02
> To: [EMAIL PROTECTED]
> Subject: [PHP] Urgent - Special Characters
> 
> 
> Hi all,
> 
>     I have a problem while converting the string into upper case by using
> the strtoupper function.
> 
>     I want to convert the string which has some special characters in it.
> For example, med vänlig hälsning, António etc. There are lots of strings /
> words with some special characters in it. It cannot be listed.
> 
>     As I want to convert them into upper case, I tried.strtoupper(hälsning),
> it's just converting it as: HäLSNING and then writes
> onto the database. But I want that special character - ' ä ' also to be
> converted into upper case and then onto the database. How do I get rid of
> this problem and convert into upper case ?.
> 
>     PLS. HELP ME.
> 
>     Thanks in advance.
> 
> ~ Karthick
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 





Hi all,

    Where can I get all the special characters that can come from a Keyboard
?. Is there any site which gives information like that ?.

    I need your help. Thanks in advance.

~ Karthick






eh?

check out htmlspecialchars()

(I think that's right, from memory)

it basically lets you fuggeddaboutit.

-a


--
Alex Black, Head Monkey
[EMAIL PROTECTED]

The Turing Studio, Inc.
http://www.turingstudio.com

vox+510.666.0074
fax+510.666.0093

Saul Zaentz Film Center
2600 Tenth St Suite 433
Berkeley, CA 94710-2522




> From: [EMAIL PROTECTED] ("TV Karthick Kumar")
> Newsgroups: php.general
> Date: 12 Jan 2001 06:36:49 -0800
> Subject: [PHP] Special Characters
> 
> Hi all,
> 
> Where can I get all the special characters that can come from a Keyboard
> ?. Is there any site which gives information like that ?.
> 
> I need your help. Thanks in advance.
> 
> ~ Karthick
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 





Specifically getimagesize() - You'll get an array with element 0 as the
width and 1 as the height. Just test it after it's uploaded and either keep
it or throw it out.

Joe

Jason Murray wrote:

> > Is there a way to limit the image size with php?
>
> You would have to use some image manipulation functions to look at the
> file once it's been uploaded.
>
> Jason
>
> --
> Jason Murray
> [EMAIL PROTECTED]
> Web Design Team, Melbourne IT
> Fetch the comfy chair!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]






I would try copying it to your
"C:\Program Files\Apache Group\Apache\modules\" folder then
change your LoadModule line to:

LoadModule php4_module modules/php4apache.dll

Or if you want to keep it there try this:
LoadModule php4_module "c:/php4/sapi/php4apache.dll"
                       ^                           ^

John






"Naresh Chafekar" <[EMAIL PROTECTED]> on 01/12/2001 01:58:50 AM

To:   [EMAIL PROTECTED]
cc:

Subject:  [PHP] apache+php4 error ..


I have windows98, apache 1.3.14, php4. After adding
following line in httpd.conf file

# for the apache module
#LoadModule php4_module c:/php4/sapi/php4apache.dll

I get following error while starting apache (which
works fine otherwise)

Cannot load c:/php4/sapi/php4apache.dll into server:
(1157) One of the library f
iles needed to run this application cannot be found:

Can someone please help me fix this ?

Thanks,

Naresh.

=====
Naresh Chafekar



__________________________________________________
Do You Yahoo!?
Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!
http://photos.yahoo.com/

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













John,

Thanks for the suggestion.  I tried both options and
still got the same error. 
Let me know if you can think of any other way to fix
this.

Naresh.

--- John Meyerhofer <[EMAIL PROTECTED]> wrote:
> 
> I would try copying it to your
> "C:\Program Files\Apache Group\Apache\modules\"
> folder then
> change your LoadModule line to:
> 
> LoadModule php4_module modules/php4apache.dll
> 
> Or if you want to keep it there try this:
> LoadModule php4_module "c:/php4/sapi/php4apache.dll"
>                        ^                           ^
> 
> John
> 
> 
> 
> 
> 
> 
> "Naresh Chafekar" <[EMAIL PROTECTED]> on
> 01/12/2001 01:58:50 AM
> 
> To:   [EMAIL PROTECTED]
> cc:
> 
> Subject:  [PHP] apache+php4 error ..
> 
> 
> I have windows98, apache 1.3.14, php4. After adding
> following line in httpd.conf file
> 
> # for the apache module
> #LoadModule php4_module c:/php4/sapi/php4apache.dll
> 
> I get following error while starting apache (which
> works fine otherwise)
> 
> Cannot load c:/php4/sapi/php4apache.dll into server:
> (1157) One of the library f
> iles needed to run this application cannot be found:
> 
> Can someone please help me fix this ?
> 
> Thanks,
> 
> Naresh.
> 
> =====
> Naresh Chafekar
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Photos - 35mm Quality Prints, Now Get 15
> Free!
> http://photos.yahoo.com/
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 
> 
> 
> 
> 
> 
> 
> 
> 


=====
Naresh Chafekar



__________________________________________________
Do You Yahoo!?
Yahoo! Photos - Share your holiday photos online!
http://photos.yahoo.com/




This solved the problem. Thanks.

Naresh.

--- Belltree <[EMAIL PROTECTED]> wrote:
> Naresh Chafekar£¬Hello£¡
> 
> You must copy php4ts.dll to windows/system folder.
> 
> Belltree
> 
> ÔÚ 01-1-11 23:58:00 you wrote£º
> >I have windows98, apache 1.3.14, php4. After adding
> >following line in httpd.conf file
> >
> ># for the apache module
> >#LoadModule php4_module c:/php4/sapi/php4apache.dll
> >
> >I get following error while starting apache (which
> >works fine otherwise)
> >
> >Cannot load c:/php4/sapi/php4apache.dll into
> server:
> >(1157) One of the library f
> >iles needed to run this application cannot be
> found:
> >
> >Can someone please help me fix this ?
> >
> >Thanks,
> >
> >Naresh.
> >
> >=====
> >Naresh Chafekar
> >
> >
> >
> >__________________________________________________
> >Do You Yahoo!?
> >Yahoo! Photos - 35mm Quality Prints, Now Get 15
> Free!
> >http://photos.yahoo.com/
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> >For additional commands, e-mail:
> [EMAIL PROTECTED]
> >To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 
> 


=====
Naresh Chafekar



__________________________________________________
Do You Yahoo!?
Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!
http://photos.yahoo.com/




I got past this horrible mess by breaking the code.

PHP seems to look for <A HREF=""> structures so if you break it up:
print("<A "); print("HREF=javascript:go();>");
or 
print("<IMG "); print("SRC=img1.gif>");
or
$s .= "<A ";
$s .= "HREF=javascript:go();>";
print($s);

It will not put in the sid.

On Thursday, January 11, 2001 5:21 PM, Jamie Burns
[SMTP:[EMAIL PROTECTED]] wrote:
> Hello,
> 
> Can someone please help?
> 
> My ISP has recompiled php with the transparent sid support and now when i
try to access a certain page for the first time (ie. no cookie yet set) then
php is making a right mess of my javascript and html (adding speech marks
and question marks in unwanted places) !
> 
> Is there a way to override this behaviour in the ini file, or even in the
code?
> 
> One of my customers sites is down because of this, and i can find nothing
through searching 8(
> 
> Thanks guys,
> 
> Jamie Burns.
> 




hi,

we are hosting sites on a cobalt raq

we installed php4.04  ( safe_mode)


how can we owners of the site allow uploads !


is there a way to set

upload_temp_dir  on a site basis

if yes how


thank you

andreas









Hi!  There are a few more options these days and php4.0.5 will be even
friendlier safe mode file uploading (so I hear from reliable sources.)

Through some discussion in #php , this use was proposed (by onki) :

    $tmp_name = $HTTP_POST_FILES["userfile"]["tmp_name"];

    move_uploaded_file ($tmp_name, "/home/httpd/html/upload/example.zip");

    chmod("/home/httpd/html/upload/example.zip", 0644);

And it worked!  move_uploaded_file is the key here.  Haven't personally
tried it as the safe mode server I have access to is 4.0.2 and it is a .3
function.

What I do/have done is get/got a script called chuid from here :

    http://www.srparish.net/scripts/

It must be installed by sysadmin.  Then, users do something like this :

    ... <input type="file" name="file"> ...

    passthru ("chuid $file 1033"); 
    @copy("$file", "/path/to/uploads/$file_name") 
        or die ("could not copy file $file_name");

Something like that.  The above is the users uid which can be echo'd in
shell like this :

    echo $UID


Regards,


Philip Olson
http://www.cornado.com/


               be outside the box.


On Fri, 12 Jan 2001, andreas (@work) wrote:

> hi,
> 
> we are hosting sites on a cobalt raq
> 
> we installed php4.04  ( safe_mode)
> 
> 
> how can we owners of the site allow uploads !
> 
> 
> is there a way to set
> 
> upload_temp_dir  on a site basis
> 
> if yes how
> 
> 
> thank you
> 
> andreas
> 
> 
> 
> 
> 
> 








George Schlossnagle wrote:

> I'd like to announce the release of the APC Alternative PHP Cache
> http://apc.communityconnect.com/ .  APC works by caching the scripts in
> shared memory post-compilation to effectively eliminate the overhead of
> parsing and compilation.  APC was developed as a completely free and
> open alternative to the Zend Cache, and is extremely robust and
> flexible.  Performance increases are very significant (100-200% on many
> of our scripts, which admittedly have lengthy includes.  You results may
> vary. :)
>
> george
>

Wanted to just post a quick thanks to George and the other developer(s)
of this product.  Couple teething problems last night, and we have to plan the upgrade 
for a couple live boxes, but it worked *quite* well - the tests I did so far showed 
10-20%
improvement on the low end and up to 200% increase.

Admittedly it's 'just' apachebench 'blast' testing, but going to 34 pps to 104pps is 
quite remarkable.

Thanks guys.  :)







I've been trying to get this to compile on SPARC Solaris 2.7, and having
troubles with the semaphore syntax. If anyone gets this to compile on
Solaris, please post your patches!

Thanks

Michael Kimsal wrote:
> 
> George Schlossnagle wrote:
> 
> > I'd like to announce the release of the APC Alternative PHP Cache
> > http://apc.communityconnect.com/ .  APC works by caching the scripts in
> > shared memory post-compilation to effectively eliminate the overhead of
> > parsing and compilation.  APC was developed as a completely free and
> > open alternative to the Zend Cache, and is extremely robust and
> > flexible.  Performance increases are very significant (100-200% on many
> > of our scripts, which admittedly have lengthy includes.  You results may
> > vary. :)
> >
> > george
> >
> 
> Wanted to just post a quick thanks to George and the other developer(s)
> of this product.  Couple teething problems last night, and we have to plan the 
>upgrade for a couple live boxes, but it worked *quite* well - the tests I did so far 
>showed 10-20%
> improvement on the low end and up to 200% increase.
> 
> Admittedly it's 'just' apachebench 'blast' testing, but going to 34 pps to 104pps is 
>quite remarkable.
> 
> Thanks guys.  :)
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]




Hello list,

I'm having a problem with Exec and Sendmail, on PHP-4 running under Apache
1.3.14 on Windows NT.

When I go to a DOS prompt and enter

d:\sendmail\sendmail -t -messagefile=d:\sendmail\msg.txt

it works fine. When I have any of the lines

exec ("d:\sendmail\sendmail.exe -t -messagefile=d:\sendmail\msg.txt");
exec ("d:\\sendmail\\sendmail.exe -t -messagefile=d:\\sendmail\\msg.txt");
$foo = exec ("d:\sendmail\sendmail.exe -t
-messagefile=d:\sendmail\msg.txt");
$foo = exec ("d:\\sendmail\\sendmail.exe -t
-messagefile=d:\\sendmail\\msg.txt");

all that happens is my PHP script times out. If I remove this line,
everything works fine. I'm sure I'm missing something simple but I'm *very*
tired. Any ideas?


Cheers
Jon






Alex Black ...
> yes:
>
> if you have ever worked in a fast paced production environment, where html
> is changed sometimes 5 times a day, digging through hundreds of lines of:
>
> echo "<input type=\"text\" name=\"hello\" size=\"20\" value=\"$value\">"
>
> starts to make you insane.

Well, i suggest you to write that kind of lines this way instead:

echo "<input type='text' name='hello' size='20' value='$value'>"

Works very fine for me, doesn't make any trouble with any browser (as i know so far), 
and the code is readable.

> speaking as an html author, and a lover of php, _please_:
>
> <input type="text" name="hello" size="20" value="<?=$value?>">
>
> it makes the code useable.

And yes, i believe that that kind of code is also good. But if you're putting more 
than one PHP variable into the HTML, i suggest to
use the upper piece of code.

> : _never_ and I do mean that _never_ use echo for printing html.
>
> it makes your apps impossible to change, and in a production environment,
> that's not ok.
>
> what if I find a problem in your table code? etc.

Well, i still think that using simple quotes is a good readable way...








Philip Olson ...
> You know what's annoying?  This (yes, it happens)  :
>
>     echo ("<table bgcolor=\"#ffffff\">");
>     echo ("<tr>");
>     echo ("<td bgcolor=\"#eeeeee\" width=\"300\">");
>     print("Name :");
>     $name = 'johnny';
>     printf("%s %s %s","<b>","$name","</b>");
>     echo ("</td>");
>     echo ("<td bgcolor=\"#eeeeee\" width=\"300\">");
>     print("Title :");
>     $title = 'smith';
>     printf("%s %s %s","<b>","$title","</b>");
>     echo("</td>");
>     echo("</tr>");
>     echo("</table>");

I'd suggest:


    echo "<table bgcolor='#ffffff'>
    <tr>
    <td bgcolor='eeeeee' width='300'>
    Name : ";

    $name = 'johnny';

    echo "<B>$name</B>
    </td>
    <td bgcolor='#eeeeee' width='300'>
    Title : ";

    $title = 'smith';

    echo"<B>$title</B>
    </td>
    </tr>
    </table>");

This way, the code IS readable, for small-medium size echoing.






i used to think

     <table bgcolor="#ffffff">
     <tr>
     <td bgcolor="#eeeeee" width="300">
     Name :
    <?php
     $name = 'johnny';
     printf("%s %s %s","<b>","$name","</b>");?>
     </td>
     <td bgcolor="#eeeeee" width="300">
     Title :
    <?php
     $title = 'smith';
     printf("%s %s %s","<b>","$title","</b>");?>
     </td>
     </tr>
     </table>

or more like :

     <table bgcolor="#ffffff">
     <tr>
     <td bgcolor="#eeeeee" width="300">
     Name :
    <b><?php
     $name = 'johnny';
     echo $name; ?></b>
     </td>
     <td bgcolor="#eeeeee" width="300">
     Title :
    <b><?php
     $title = 'smith';
     echo $title; ?></b>
     </td>
     </tr>
     </table>


-------------------------------------------
Yeah, there are more important things in life than money, but they won't go
out with you if you don't have any.





On Fri, 12 Jan 2001, MR wrote:

> Philip Olson ...
> > You know what's annoying?  This (yes, it happens)  :
> >
> >     echo ("<table bgcolor=\"#ffffff\">");
> >     echo ("<tr>");
> >     echo ("<td bgcolor=\"#eeeeee\" width=\"300\">");
> >     print("Name :");
> >     $name = 'johnny';
> >     printf("%s %s %s","<b>","$name","</b>");
> >     echo ("</td>");
> >     echo ("<td bgcolor=\"#eeeeee\" width=\"300\">");
> >     print("Title :");
> >     $title = 'smith';
> >     printf("%s %s %s","<b>","$title","</b>");
> >     echo("</td>");
> >     echo("</tr>");
> >     echo("</table>");
> 
> I'd suggest:
>
>     echo "<table bgcolor='#ffffff'>
>     <tr>
>     <td bgcolor='eeeeee' width='300'>
>     Name : ";
> 
>     $name = 'johnny';
> 
>     echo "<B>$name</B>
>     </td>
>     <td bgcolor='#eeeeee' width='300'>
>     Title : ";
> 
>     $title = 'smith';
> 
>     echo"<B>$title</B>
>     </td>
>     </tr>
>     </table>");
> 
> This way, the code IS readable, for small-medium size echoing.
> 

I on the other hand suggest something like this:

<?
 $name = 'Johnny';
 $title= 'Smith';
?>

<table bgcolor='#ffffff'>
  <tr>
   <td bgcolor='eeeeee' width='300'>
     Name : <B><?=$name?></B>
   </td>
   <td bgcolor='#eeeeee' width='300'>
     Title : <B><?=$title?></B>
   </td>
  </tr>
</table>

or this:

<?
 $name = 'Johnny';
 $title= 'Smith';

 echo "
<table bgcolor='#ffffff'>
  <tr>
   <td bgcolor='eeeeee' width='300'>
     Name : <B> $name </B>
   </td>
   <td bgcolor='#eeeeee' width='300'>
     Title : <B> $title </B>
   </td>
  </tr>
</table>";
?>

  I think is better (when possible) to format the data and then put it on
their way :)

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Antonio S. Martins Jr. - System Analist |  "Only The Shadow Knows   |
| WorldNet Internet Maringa - PR - Brasil |   what evil lurks in the  |
| E-Mail: [EMAIL PROTECTED]              |       Heart of Men!"      |
|         [EMAIL PROTECTED]                   | !!! Linux User: 52392 !!! |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
               This e-mail message is 100% Microsoft free!

                         /"\
                         \ /  CAMPANHA DA FITA ASCII - CONTRA MAIL HTML
                          X   ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
                         / \








that may work for you, but it created a lot of overhead in your
applications, and anyone that doesn't know about you special "html api" will
be screwed...

by all means use whatever techniques you like in-house, but that would be
completely useless to someone in the "outside world"

-alex

> (comments)
> 
> (include files)
> 
> (page specific variables)
> 
> html();
> 
> head($title);
> head_css('stylesheet.css');
> head_script('script.js);
> x('head');
> 
> body($style)
> table(0, 0, 0, '100%', '', BLACK);
> tr('top'); td(); image('fire.jpg'); x('td'); x('tr');
> x('table');
> 
> x('body');
> x('html');


--
Alex Black, Head Monkey
[EMAIL PROTECTED]

The Turing Studio, Inc.
http://www.turingstudio.com

vox+510.666.0074
fax+510.666.0093

Saul Zaentz Film Center
2600 Tenth St Suite 433
Berkeley, CA 94710-2522









> No.
> 
> <input type="text" name="hello" size="20" value="{value}">
> 
> makes the code usable, and your HTML can even be edited with a
> graphical HTML-editor.
> 
> There is no reason to mix up HTML and PHP, except for very small
> projects.
> 
> regards
> Wagner

and the problem with that, is you're not paring tons of html through a
search-replace function, which also created unnecessary overheead, and
forces you (once again) to make a spec that says "here's how this template
system works)

part of the point was for _PHP_ to be embedded html, in my opinion your
example above takes the "don't mix logic with markup" much too far:


<input type="text" name="hello" size="20" value="<?=$value?>">

is really not that much harder to write.

html people can ignore it, php can find their code, and those that know both
can reap the benefits.

what about loops?

etc...

you start building your own little template language constructs, which is
dumb because php already has them!

:)

_alex




--
Alex Black, Head Monkey
[EMAIL PROTECTED]

The Turing Studio, Inc.
http://www.turingstudio.com

vox+510.666.0074
fax+510.666.0093

Saul Zaentz Film Center
2600 Tenth St Suite 433
Berkeley, CA 94710-2522







> Coding standards are being created (via PEAR) and a few recent articles
> exist but point is we're teaching differently, everywhere.  PHP is loose
> as a goose!  print 'foo'; print("foo");  print "foo"; printf("%s","foo");
> ... all being taught, all being read, all being (mis)used.

!

http://www.binarycloud.com/code_standard.html


> Am looking forward to the in-progress PEAR Standards, which can partially
> be seen here :
> 
> http://marc.theaimsgroup.com/?l=php-pear&m=97603413001842&w=2
> 
> Once this comes about we'll start teaching _GOOD_ coding techniques and
> after awhile many more will become pretty little coders writing (and
> copying) pretty little recognizable scripts.  Looking forward to it.
> Looking forward to picking up a PHP book and seeing concepts shown through
> standards and not through the authors preferred style at the moment.  This
> is especially true regarding articles/tutorials.  Learn the standards
> first!   Then you may be free to roam about the isles.

absolutely :)


> 
> Go here, be sure to sift through the user comments   :
>
> Best Practices: PHP Coding Style                 :
> http://phpbuilder.com/columns/tim20010101.php3
> 
> Smart Architectures in PHP                       :
> http://phpbuilder.com/columns/tim20001010.php3
> 
> A few humble thoughts.
> 
> Happily yours,
> 
> Philip
> 
> 
> On Fri, 12 Jan 2001, Alexander Wagner wrote:
> 
>> Alex Black wrote:
>>> echo "<input type=\"text\" name=\"hello\" size=\"20\"
>>> value=\"$value\">"
>>> 
>>> starts to make you insane.
>> 
>> If it is done wrong spread over the whole project hidden between lines
>> of PHP-code, it sure does.
>> 
>>> speaking as an html author, and a lover of php, _please_:
>>> 
>>> <input type="text" name="hello" size="20" value="<?=$value?>">
>>> 
>>> it makes the code useable.
>> 
>> No.
>> 
>> <input type="text" name="hello" size="20" value="{value}">
>> 
>> makes the code usable, and your HTML can even be edited with a
>> graphical HTML-editor.
>> 
>> There is no reason to mix up HTML and PHP, except for very small
>> projects.
>> 
>> regards
>> Wagner
>> 
>> -- 
>> Sanity is calming, but madness is more interesting.
>> 
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 





> or more like :
> 
> <table bgcolor="#ffffff">
> <tr>
> <td bgcolor="#eeeeee" width="300">
> Name :
> <b><?php
> $name = 'johnny';
> echo $name; ?></b>
> </td>
> <td bgcolor="#eeeeee" width="300">
> Title :
> <b><?php
> $title = 'smith';
> echo $title; ?></b>
> </td>
> </tr>
> </table>

yes, uhhzakkly :)

> 
> -------------------------------------------
> Yeah, there are more important things in life than money, but they won't go
> out with you if you don't have any.

heh. now come on... that's not supposed to be true.... (noink)

_a





Alex Black wrote:
> > <input type="text" name="hello" size="20" value="{value}">
>
> and the problem with that, is you're not paring tons of html through a
> search-replace function, which also created unnecessary overheead, and

You have a point here. Template-systems are slow.

> forces you (once again) to make a spec that says "here's how this template
> system works)

There are "standard"-template-systems like FastTemplates or PHPLIB templates.

> part of the point was for _PHP_ to be embedded html, in my opinion your

It was created that way. It still is possible. Is can be quite handy, 
sometimes (or often, depends on what you do). That doesn't mean you have to 
use it.

> example above takes the "don't mix logic with markup" much too far:

I don't think I crossed a border here. When execution-speed doesn't matter 
that much (wich often is the case), there is only one rule: Get it done as 
fast and reusable as possible.

Code that uses templates tends to be very reusable, at least it is VERY easy 
to change the design.
And if the design is done by a designer who doesn't know PHP, it may also be 
done faster.

> <input type="text" name="hello" size="20" value="<?=$value?>">
>
> is really not that much harder to write.

With a HTML-editor? It probably would HTML-encode this, so you end up with 
&lt;=$value&gt;

> html people can ignore it, 

almost

> php can find their code, and those that know
> both can reap the benefits.
>
> what about loops?

Templates can do loops, with so called "blocks".
Your system can't. Not whithout mixing PHP and HTML in a way that will make a 
designer throw hardware at you.

> etc...
>
> you start building your own little template language constructs, which is
> dumb because php already has them!

There are clean (but slow) template-solutions out there. Maybe this will 
change some day.

Anyway, from a designers point of view, your system is far messier 
(especially with loops) than templates. But faster, both for you to write and 
to execute for PHP. Well, this is a world of tradeoffs.

Wagner

-- 
One maniac alone can do what 20 together cannot




>http://www.binarycloud.com/code_standard.html

>> http://marc.theaimsgroup.com/?l=php-pear&m=97603413001842&w=2

>> Best Practices: PHP Coding Style                 :
>> http://phpbuilder.com/columns/tim20010101.php3

>> Smart Architectures in PHP                       :
>> http://phpbuilder.com/columns/tim20001010.php3

These are all just opinions, none of these are official Php style
guidelines, so there's no real reason to follow them.

- Mark





> that may work for you, but it created a lot of overhead in your
> applications, and anyone that doesn't know about you special "html api"
will
> be screwed...

That I prefer to call it "investment" instead of overhead because it has
given us a system we vastly prefer.

> by all means use whatever techniques you like in-house, but that would be
> completely useless to someone in the "outside world"

That's fine. I just wanted to show people how we did it. I don't expect this
to be useful in a all situations.

In our experience PHP programmers who work with us don't have any
problem figuring out how our system works. Without knowing anything
about our system tell me you can't look at that code and "get it"

Jade

> > (comments)
> >
> > (include files)
> >
> > (page specific variables)
> >
> > html();
> >
> > head($title);
> > head_css('stylesheet.css');
> > head_script('script.js);
> > x('head');
> >
> > body($style)
> > table(0, 0, 0, '100%', '', BLACK);
> > tr('top'); td(); image('fire.jpg'); x('td'); x('tr');
> > x('table');
> >
> > x('body');
> > x('html');
>







Christian Reiniger ...

> One reason why I don't like the "echo" route: I lose the syntax
> highlighting for the HTML that way. String constants should be
> highlighted as, well, string constants normally, but when they contain
> HTML code that's just plain ugly.

Well, that's the point about using a better or worse editor... better editors detect 
when HTML becomes PHP and viceversa - i mean,
some editors DO detect
HTML <? PHP ?> HTML
and
PHP echo " HTML "; PHP

AND highlight syntax according to that.

(the editor's programmers should look after that!)







Alex Black ...
> <input type="text" name="hello" size="20" value="<?=$value?>">
>
> is really not that much harder to write.
>
> html people can ignore it, php can find their code, and those that know both
> can reap the benefits.
>
> what about loops?

You mean that this code


<?
connect_to_database();
parse_query();
execute_query();

echo "<TABLE>";

while (fetch_row_from_query())
    {
    $output = data_from_fetched_row();
    $more_output = more_data_from_fetched_row();

    echo "<TR><TD> $output </TD><TD> $more_output </TD></TR>";

    }
echo "</TABLE>";
?>



would be better if it were written this way? :


<?
connect_to_database();
parse_query();
execute_query();
?>
<TABLE>
<? while (fetch_row_from_query()) : ?>

<?    $output = data_from_fetched_row();
    $more_output = more_data_from_fetched_row();    ?>

    <TR><TD><?=$output?></TD><TD><?=$more_output?></TD></TR>

<? endwhile; ?>
</TABLE>



I _personally_ prefer the upper implementation, as all my web developing team (that 
is, only me :-) know both PHP and HTML and don't
like the code to be *plagued* of <? ?> <? ?> <? ?> as in above example.






I think you missed something:

<?
connect_to_database();
parse_query();
execute_query();
?>

<TABLE>
<?
while (fetch_row_from_query()){
   $output = data_from_fetched_row();
   $more_output = more_data_from_fetched_row();?>
   <TR>
      <TD><?echo $output?></TD>
      <TD><?echo $more_output?></TD>
   </TR>
<?}?>
</TABLE>

tell me that's not easier on your eyes :) Another nice thing about
doing it this way is you can work with a web designer who uses a
visual tool like dreamweaver.



On Fri, 12 Jan 2001 22:10:08 +0100, MR ([EMAIL PROTECTED])
wrote:
>Alex Black ...
>> <input type="text" name="hello" size="20" value="<?=$value?>">
>>
>> is really not that much harder to write.
>>
>> html people can ignore it, php can find their code, and those that
>>know both
>> can reap the benefits.
>>
>> what about loops?
>
>You mean that this code
>
>
><?
>connect_to_database();
>parse_query();
>execute_query();
>
>echo "<TABLE>";
>
>while (fetch_row_from_query())
>    {
>    $output = data_from_fetched_row();
>    $more_output = more_data_from_fetched_row();
>
>    echo "<TR><TD> $output </TD><TD> $more_output </TD></TR>";
>
>    }
>echo "</TABLE>";
>?>
>
>
>
>would be better if it were written this way? :
>
>
><?
>connect_to_database();
>parse_query();
>execute_query();
>?>
><TABLE>
><? while (fetch_row_from_query()) : ?>
>
><?    $output = data_from_fetched_row();
>    $more_output = more_data_from_fetched_row();    ?>
>
>    <TR><TD><?=$output?></TD><TD><?=$more_output?></TD></TR>
>
><? endwhile; ?>
></TABLE>
>
>
>
>I _personally_ prefer the upper implementation, as all my web
>developing team (that is, only me :-) know both PHP and HTML and
>don't
>like the code to be *plagued* of <? ?> <? ?> <? ?> as in above
>example.
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: php-list-
>[EMAIL PROTECTED]






In Dreamtime, we'd just have a template that looks like this:

<table>
{:each:output}
  <tr>
     <td>{output}</td><td>{more_output}</td>
  </tr>
  {:next:more_output}
{:end}
</table>

Even a pot-smoking mac-using hippie web designer can understand that. :-)
And it's readable in Dreamweaver or GoLive or any of those visual HTML
tools.  For Dreamweaver I added a little custom definition that makes a nice
icon wherever it sees a template tag in the HTML file.

...and our PHP geeks just stuff a results array into the template.  Too
easy.

- Tim
  http://www.phptemplates.org

> <TABLE>
> <?
> while (fetch_row_from_query()){
>    $output = data_from_fetched_row();
>    $more_output = more_data_from_fetched_row();?>
>    <TR>
>       <TD><?echo $output?></TD>
>       <TD><?echo $more_output?></TD>
>    </TR>
> <?}?>
> </TABLE>






>> and the problem with that, is you're not paring tons of html through a
>> search-replace function, which also created unnecessary overheead, and
> 
> You have a point here. Template-systems are slow.

yeppers...

that's why I didn't implement one of those keyword things in binarycloud.
ergh.

>> forces you (once again) to make a spec that says "here's how this template
>> system works)
> 
> There are "standard"-template-systems like FastTemplates or PHPLIB templates.

that's true.

>> part of the point was for _PHP_ to be embedded html, in my opinion your
> 
> It was created that way. It still is possible. Is can be quite handy,
> sometimes (or often, depends on what you do). That doesn't mean you have to
> use it.

I'm not implying that there are rules etched in stone somewhere, but I am
trying to prove a point, because I see many people making the "echo"
mistake, which makes their otherwise great code much less useful.

>> example above takes the "don't mix logic with markup" much too far:
> 
> I don't think I crossed a border here. When execution-speed doesn't matter
> that much (wich often is the case), there is only one rule: Get it done as
> fast and reusable as possible.

Ok, execution speed does matter to me. I run webserver installations, and
anything over about 2 tenths of a second starts to get annoying when you
send a lot of users to a site.

> Code that uses templates tends to be very reusable, at least it is VERY easy
> to change the design.
> And if the design is done by a designer who doesn't know PHP, it may also be
> done faster.

The code I have to maintain (single-handedly when it comes to html) for even
very large stuff inside of binarycloud is pretty simple.

One of the core team is actually working on a feature for form builder that
will further simplify the markup files.

>> <input type="text" name="hello" size="20" value="<?=$value?>">
>> 
>> is really not that much harder to write.
> 
> With a HTML-editor? It probably would HTML-encode this, so you end up with
> &lt;=$value&gt;

Maybe if you have a badang-crap html editor :) Try using emacs, BBEdit,
HomeSite, or any of the other quality editors out there.

I don't think that's a consideration.

>> html people can ignore it,
> 
> almost

yes, come on.

>> php can find their code, and those that know
>> both can reap the benefits.
>> 
>> what about loops?
> 
> Templates can do loops, with so called "blocks".
> Your system can't. Not whithout mixing PHP and HTML in a way that will make a
> designer throw hardware at you.

eh?

my system does loops with php code.

it is very important to note that that code need not be embeddedin the same
file as the markup.

for example, I need a "style" for an individual record coming out of a
database. so I make that html, put a little function "tag" around it"

<? fucntion hello($stuff) { ?>
<font color="#999999"><b><?=$stuff?></b></font>
<? } ?>

That is an intentionally simplistic example, but you can obviously see that
if a php coder tells the html coder "that bit of html is going to be looped
for as many records as we get out of the database - they html coder should
think accordingly.

After all, we really aren't talking about "rocket science".

>> etc...
>> 
>> you start building your own little template language constructs, which is
>> dumb because php already has them!
> 
> There are clean (but slow) template-solutions out there. Maybe this will
> change some day.

This is true - some of the parsed-template systems use nicely clean code.
But they cost cpu cycles, bigtime. And, ok, hardware is commodity, but you
can actually do more cool things if you use simple php in html, with
controlling logic.

> Anyway, from a designers point of view, your system is far messier
> (especially with loops) than templates. But faster, both for you to write and
> to execute for PHP. Well, this is a world of tradeoffs.

Absolutely not.

under my system, we don't end u splitting html into billions of little
chunks, we make a "page" of html which is associated with a piece of
controlling logic in a separate file, then insert discreet function "tags"
which allows the controlling logic to do its stuff.

_alex





yeah, but it's good to agree on something so that people can use each
other's code...


--
Alex Black, Head Monkey
[EMAIL PROTECTED]

The Turing Studio, Inc.
http://www.turingstudio.com

vox+510.666.0074
fax+510.666.0093

Saul Zaentz Film Center
2600 Tenth St Suite 433
Berkeley, CA 94710-2522




> From: [EMAIL PROTECTED] (Mark Maggelet)
> Newsgroups: php.general
> Date: 12 Jan 2001 11:40:32 -0800
> Subject: Re: [PHP] mixing HTML and PHP code
> 
>> http://www.binarycloud.com/code_standard.html
> 
>>> http://marc.theaimsgroup.com/?l=php-pear&m=97603413001842&w=2
> 
>>> Best Practices: PHP Coding Style                 :
>>> http://phpbuilder.com/columns/tim20010101.php3
> 
>>> Smart Architectures in PHP                       :
>>> http://phpbuilder.com/columns/tim20001010.php3
> 
> These are all just opinions, none of these are official Php style
> guidelines, so there's no real reason to follow them.
> 
> - Mark
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 





> That I prefer to call it "investment" instead of overhead because it has
> given us a system we vastly prefer.

hehe, I like that. I still disagree, but that was good :)

>> by all means use whatever techniques you like in-house, but that would be
>> completely useless to someone in the "outside world"
> 
> That's fine. I just wanted to show people how we did it. I don't expect this
> to be useful in a all situations.
> 
> In our experience PHP programmers who work with us don't have any
> problem figuring out how our system works. Without knowing anything
> about our system tell me you can't look at that code and "get it"


that's true of all of these systems. I'm not implying that one is hard to
understand as opposed to the other, I'm arguing for efficiency and
portability.

_alex


> Jade
> 
>>> (comments)
>>> 
>>> (include files)
>>> 
>>> (page specific variables)
>>> 
>>> html();
>>> 
>>> head($title);
>>> head_css('stylesheet.css');
>>> head_script('script.js);
>>> x('head');
>>> 
>>> body($style)
>>> table(0, 0, 0, '100%', '', BLACK);
>>> tr('top'); td(); image('fire.jpg'); x('td'); x('tr');
>>> x('table');
>>> 
>>> x('body');
>>> x('html');
>> 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 





> <?
> connect_to_database();
> parse_query();
> execute_query();
> 
> echo "<TABLE>";
> 
> while (fetch_row_from_query())
> {
> $output = data_from_fetched_row();
> $more_output = more_data_from_fetched_row();
> 
> echo "<TR><TD> $output </TD><TD> $more_output </TD></TR>";
> 
> }
> echo "</TABLE>";
> ?>

Well, this may be a bit specific, but that is probably part of your problem.
You have no structure associated with your application design:

what are you doing making a connection to a database on the same page you
spit out the results from?

You should be including a wrapper file, and calling a function which talks
to the database.

Also, all of that logic should be in a file that is separate from the markup
_anyway_


 
> <?
> connect_to_database();
> parse_query();
> execute_query();
> ?>
> <TABLE>
> <? while (fetch_row_from_query()) : ?>
> 
> <?    $output = data_from_fetched_row();
> $more_output = more_data_from_fetched_row();    ?>
> 
> <TR><TD><?=$output?></TD><TD><?=$more_output?></TD></TR>
> 
> <? endwhile; ?>
> </TABLE>

<table>

<? function html_table_row($output, $more_output) { ?>
<tr>
<td valign="middle" bgcolor="#CCCCCC"><?=$output?></td>
<td valign="middle" bgcolor="#CCCCCC"><?=$more_output?></td>
</tr>
<? } ?>


</table>


> 
> 
> I _personally_ prefer the upper implementation, as all my web developing team
> (that is, only me :-) know both PHP and HTML and don't
> like the code to be *plagued* of <? ?> <? ?> <? ?> as in above example.

I digress.

_alex

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





> <table>
> {:each:output}
> <tr>
> <td>{output}</td><td>{more_output}</td>
> </tr>
> {:next:more_output}
> {:end}
> </table>
> 
> Even a pot-smoking mac-using hippie web designer can understand that. :-)
> And it's readable in Dreamweaver or GoLive or any of those visual HTML
> tools.  For Dreamweaver I added a little custom definition that makes a nice
> icon wherever it sees a template tag in the HTML file.

Speaking as a not-pot-smoking mac-using only partially hippie web designer:

why bother with creating your own syntax?

why not just explain some _super_basic_ php syntax to the "html dude" and
have him do the code himself?

also, dreamweaver nicely ignores <? ?>

etc.

-a

> ...and our PHP geeks just stuff a results array into the template.  Too
> easy.
> 
> - Tim
> http://www.phptemplates.org
> 
>> <TABLE>
>> <?
>> while (fetch_row_from_query()){
>> $output = data_from_fetched_row();
>> $more_output = more_data_from_fetched_row();?>
>> <TR>
>> <TD><?echo $output?></TD>
>> <TD><?echo $more_output?></TD>
>> </TR>
>> <?}?>
>> </TABLE>
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 





He is installing on OS X Server, which has been out for a year.  Poster: Try 
http://www.xclave.com/ for more info on PHP/MySQL on OS X S.  If you get the 
PHP/MySQL/Apache source they should compile out of the box on OS X Server.

Michael

On Thursday, January 11, 2001, at 06:25 PM, Alex Black wrote:

> eh? 
>  
> on OS X? 
>  
> what is your (pardon, insane) justification for having pressure to get a 
> piece of software on a yet-to-be-released operating system? 
>  
> go download freeBSD it works! OSX is just beta... 
>  
> -a 
>  
>  
> -- 
> Alex Black, Head Monkey 
> [EMAIL PROTECTED] 
>  
> The Turing Studio, Inc. 
> http://www.turingstudio.com 
>  
> vox+510.666.0074 
> fax+510.666.0093 
>  
> Saul Zaentz Film Center 
> 2600 Tenth St Suite 433 
> Berkeley, CA 94710-2522 
>  
>  
>  
>  
> > From: [EMAIL PROTECTED] (MacTrom) 
> > Newsgroups: php.general 
> > Date: 11 Jan 2001 11:06:26 -0800 
> > Subject: Re: [PHP] apple-macintosh 
> >  
> > I've downloaded the MySql package from Lightyear, and also an OSX version 
> > from NuSphere to an OSX server for my client. UNFortunately, the Lightyear 
> > tar refuses to unpack (it is meant to be dropped onto the Desktop and the 
> > OSX server doesn't have a Desktop folder) and the NuSphere installs fine 
> > except that it fails to find libpthread.A.??lib (I'm not at the server and 
> > not sure of the extension). So then setting up the grant table fails and 
> > MySql won't run. 
> >  
> > We are in critical mode to get MySql up and running on this, and I could use 
> > some help/direction. 
> >  
> > Terry 
> >  
> >> From: Terry Romine <[EMAIL PROTECTED]> 
> >> Date: Thu, 11 Jan 2001 03:37:19 -0600 
> >> To: terry romine <[EMAIL PROTECTED]> 
> >> Subject: FW: [PHP] apple-macintosh 
> >>  
> >> From: lou <[EMAIL PROTECTED]> 
> >> Date: Thu, 28 Dec 2000 09:33:47 -0800 
> >> To: EaTrom <[EMAIL PROTECTED]>, Jerry <[EMAIL PROTECTED]>, 
> >> <[EMAIL PROTECTED]> 
> >> Subject: Re: [PHP] apple-macintosh 
> >>  
> >> http://homepage.mac.com/LightyearDesign/MacOSX/Packages/ 
> >>  
> >> Apache 1.3.12 compiled with PHP4 Support and mysql for Mac OS X 
> >>  
> >>  
> >>> I would presume that PHP would be usable under OS X -- 
> >>>  
> >>> Terry 
> >  
> >  
> > --  
> > PHP General Mailing List (http://www.php.net/) 
> > To unsubscribe, e-mail: [EMAIL PROTECTED] 
> > For additional commands, e-mail: [EMAIL PROTECTED] 
> > To contact the list administrators, e-mail: [EMAIL PROTECTED] 
> >  
>  
>  
> --  
> PHP General Mailing List (http://www.php.net/) 
> To unsubscribe, e-mail: [EMAIL PROTECTED] 
> For additional commands, e-mail: [EMAIL PROTECTED] 
> To contact the list administrators, e-mail: [EMAIL PROTECTED] 
>  
>  
>  




pardon.

sorry original poster.

rhapsody... I had completely forgotten it exists :)

-a


--
Alex Black, Head Monkey
[EMAIL PROTECTED]

The Turing Studio, Inc.
http://www.turingstudio.com

vox+510.666.0074
fax+510.666.0093

Saul Zaentz Film Center
2600 Tenth St Suite 433
Berkeley, CA 94710-2522




> From: [EMAIL PROTECTED] (Michael Stearne)
> Newsgroups: php.general
> Date: 12 Jan 2001 08:18:44 -0800
> Subject: Re: [PHP] apple-macintosh
> 
> He is installing on OS X Server, which has been out for a year.  Poster: Try
> http://www.xclave.com/ for more info on PHP/MySQL on OS X S.  If you get the
> PHP/MySQL/Apache source they should compile out of the box on OS X Server.
> 
> Michael
> 
> 
> On Thursday, January 11, 2001, at 06:25 PM, Alex Black wrote:
> 
>> eh? 
>> 
>> on OS X? 
>> 
>> what is your (pardon, insane) justification for having pressure to get a
>> piece of software on a yet-to-be-released operating system?
>> 
>> go download freeBSD it works! OSX is just beta...
>> 
>> -a 
>> 
>> 
>> -- 
>> Alex Black, Head Monkey
>> [EMAIL PROTECTED]
>> 
>> The Turing Studio, Inc.
>> http://www.turingstudio.com
>> 
>> vox+510.666.0074
>> fax+510.666.0093
>> 
>> Saul Zaentz Film Center
>> 2600 Tenth St Suite 433
>> Berkeley, CA 94710-2522
>> 
>> 
>> 
>> 
>>> From: [EMAIL PROTECTED] (MacTrom)
>>> Newsgroups: php.general
>>> Date: 11 Jan 2001 11:06:26 -0800
>>> Subject: Re: [PHP] apple-macintosh
>>> 
>>> I've downloaded the MySql package from Lightyear, and also an OSX version
>>> from NuSphere to an OSX server for my client. UNFortunately, the Lightyear
>>> tar refuses to unpack (it is meant to be dropped onto the Desktop and the
>>> OSX server doesn't have a Desktop folder) and the NuSphere installs fine
>>> except that it fails to find libpthread.A.??lib (I'm not at the server and
>>> not sure of the extension). So then setting up the grant table fails and
>>> MySql won't run.
>>> 
>>> We are in critical mode to get MySql up and running on this, and I could use
>>> some help/direction.
>>> 
>>> Terry 
>>> 
>>>> From: Terry Romine <[EMAIL PROTECTED]>
>>>> Date: Thu, 11 Jan 2001 03:37:19 -0600
>>>> To: terry romine <[EMAIL PROTECTED]>
>>>> Subject: FW: [PHP] apple-macintosh
>>>> 
>>>> From: lou <[EMAIL PROTECTED]>
>>>> Date: Thu, 28 Dec 2000 09:33:47 -0800
>>>> To: EaTrom <[EMAIL PROTECTED]>, Jerry <[EMAIL PROTECTED]>,
>>>> <[EMAIL PROTECTED]>
>>>> Subject: Re: [PHP] apple-macintosh
>>>> 
>>>> http://homepage.mac.com/LightyearDesign/MacOSX/Packages/
>>>> 
>>>> Apache 1.3.12 compiled with PHP4 Support and mysql for Mac OS X
>>>> 
>>>> 
>>>>> I would presume that PHP would be usable under OS X --
>>>>> 
>>>>> Terry 
>>> 
>>> 
>>> --  
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>>> 
>> 
>> 
>> --  
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>> 
>> 
>> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 





Title: Blank
GD config problem,  Windows problem,  browser Options issue,
or something else? I can't seem to figure this one out.
(I'm still newbie to php, trying to learn on my Win98 pc at home. )
 
                                    * * * * * * *
 
GD is properly showing up on the phpinfo page as enabled.
 
But when I click on several different test files (one from Weblogs,
and one a test file for a particular class of graphs), the result
is either:
 
 
 
a) the Windows download dialog box launches for some
    reason  (this happened for two different test graphic files,
    one being the Weblogs test file posted on their site)
 
                                        OR
 
b) the following 2 errors occur (this happened for a particular
    graphics class test page):
 
               " Warning: Could not find/open font
                in classcoxcomb.php on line 462 "
 
              " Warning: Cannot add header information -
                headers already sent by (output started at
                classcoxcomb.php:462) in classcoxcomb.php
                on line 153 ‰PNG  IHDRhðy}?PLTEÿ
                ÿÿ€€€€€€€€€€ÿÿÿÿÿÿÿÿÿðððîîîÝÝÝÌÌÌ333f
                ...etc.... "
 
Most oddly, at one point after hitting the refresh button, the Weblogs
test graphic all of a sudden DID appear. So I clicked refresh
once again immediately  (because I couldn't finally believe my eyes!)
and, heck, once again the download dialog box launched, rather
than the graphic appearing again. Now that was weird.  
 
Does anyone have a clue what I am doing wrong?
 
 
[Three weeks now trying to figure this out on my own.
I have (hopefully very carefully) checked all the
windows archive mentions of "GD" and have perused same
at other php forums. Nothing has yet hinted at my partcular
GD goofup.   By way of proof of newbieness, let me note for
amusement sake that much of those 2 weeks was spent 
figuring out why php would hang every time I uncommented the
php_gd.dll.  Naturally....the cause was a bonehead typo  
done when typing my extensions directory path in php.ini---
i.e., I forgot to include the subdirectory name "/extensions" at 
the end of the extensions address on my pc--the extensions
path in php.ini should have been  c:/mystuff/php/extensions 
rather than  c:/mystuff/php    i hate that].

 





Hello,
I'm trying to connect to Informix 7.30 using PHP 4 and IIS 4, but I receive
a "-461: unable to load locale categories" error.

I have already set INFORMIXDIR, INFORMIXSERVER, PATH variables.

May I have some help?

Thanks 
Riccardo Vitella



-------------------------
Riccardo Vitella
-------------------------
[EMAIL PROTECTED]
-------------------------





I need to find the number of days between a date in the past and todays date. Does PHP 
have a function to do this, or do I need to write my own?

-- Random (non-anti-Microsoft) fortune





Just subtract the Unix timestamps.

ie.  $past_date = mktime(12,45,0,5,6,1994);
     $diff = time() - $past_date;
     $days = $diff/86400;  // number of seconds in a day
     echo (int)$days;      // truncate to an integer

-Rasmus

On 12 Jan 2001, Matthew Brealey wrote:

> I need to find the number of days between a date in the past and todays date. Does 
>PHP have a function to do this, or do I need to write my own?
>
> -- Random (non-anti-Microsoft) fortune
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





I have a 2-d array:

$list[$ctr]["username"]
$list[$ctr]["county"]
$list[$ctr]["age"]
$list[$ctr]["id"]
$list[$ctr]["days"]

I need to sort by days, which is an integer. What function should I use?

E.g.,
$list[0][mark]
$list[0][somewhere]
$list[0][12]
$list[0][1]
$list[0][200]

$list[1][andy]
$list[1][somewherefurther]
$list[1][18]
$list[1][2]
$list[1][100]

$list[2][sam]
$list[2][somewhereelse]
$list[2][15]
$list[2][3]
$list[2][150]

should sort to:

$list[0][mark]
$list[0][somewhere]
$list[0][12]
$list[0][1]
$list[0][100]

$list[1][andy]
$list[1][somewherefurther]
$list[1][18]
$list[1][2]
$list[1][150]


$list[2][sam]
$list[2][somewhereelse]
$list[2][15]
$list[2][3]
$list[2][150]
-- Random (non-anti-Microsoft) fortune





http://www.php.net/manual/function.array-multisort.php

Matthew Brealey wrote:
> 
> I have a 2-d array:
> 
> $list[$ctr]["username"]
> $list[$ctr]["county"]
> $list[$ctr]["age"]
> $list[$ctr]["id"]
> $list[$ctr]["days"]
> 
> I need to sort by days, which is an integer. What function should I use?
> 
> E.g.,
> $list[0][mark]
> $list[0][somewhere]
> $list[0][12]
> $list[0][1]
> $list[0][200]
> 
> $list[1][andy]
> $list[1][somewherefurther]
> $list[1][18]
> $list[1][2]
> $list[1][100]
> 
> $list[2][sam]
> $list[2][somewhereelse]
> $list[2][15]
> $list[2][3]
> $list[2][150]
> 
> should sort to:
> 
> $list[0][mark]
> $list[0][somewhere]
> $list[0][12]
> $list[0][1]
> $list[0][100]
> 
> $list[1][andy]
> $list[1][somewherefurther]
> $list[1][18]
> $list[1][2]
> $list[1][150]
> 
> $list[2][sam]
> $list[2][somewhereelse]
> $list[2][15]
> $list[2][3]
> $list[2][150]
> -- Random (non-anti-Microsoft) fortune
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
Monte Ohrt <[EMAIL PROTECTED]>
http://www.ispi.net/




phpinfo reports that XML is 'active' but i thought xml was a client side
language? what does it have to do with the server?

thanks!


- Noah






grrr.

XML means 'eXtended Markup Language' and is not a client side language, but
a language specification - say: standard. Many 'languages' derrive this
standard, such as WML, XHTML and many other data exchange file-types.

XML active means, that the XML-parsing functions will work with your PHP.

read more about XML on http://www.w3c.org

Mo.

> -----Original Message-----
> From: Noah Spitzer-Williams [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 12, 2001 6:13 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Question about phpinfo() and XML
>
>
> phpinfo reports that XML is 'active' but i thought xml was a client side
> language? what does it have to do with the server?
>
> thanks!
>
>
> - Noah
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





Hi,
 
I have got a problem that I canot connect to mssql 7.0 tables with PHP if it 
contains field in "money" data type. When I change the "monty" type to 
interger or other types, everything fine.  The fact is that I have to 
use "money" data type.
 
Can somebody help me please?
 
Thanks in advance.
 
Michael Luk

________________________________________________________________

This message was sent using i-Office Webmail - Powered by i-Server.
For more information visit http://www.i-serverbox.com





Why not use float?

--Joe

On Fri, Jan 12, 2001 at 05:19:59PM -0000, [EMAIL PROTECTED] wrote:
> Hi,
>  
> I have got a problem that I canot connect to mssql 7.0 tables with PHP if it 
> contains field in "money" data type. When I change the "monty" type to 
> interger or other types, everything fine.  The fact is that I have to 
> use "money" data type.
>  
> Can somebody help me please?
>  
> Thanks in advance.
>  
> Michael Luk
> 
> ________________________________________________________________
> 
> This message was sent using i-Office Webmail - Powered by i-Server.
> For more information visit http://www.i-serverbox.com
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

Joe Stump, PHP Hacker
[EMAIL PROTECTED]
http://www.miester.org/





I found one but it's written in German and I have enough trouble with
English (my native language).

Any suggestions?

John Guynn

This email brought to you by RFCs 821 and 1225.





Did you try freshmeat.net ???

--Joe

On Fri, Jan 12, 2001 at 11:14:45AM -0600, John Guynn wrote:
> I found one but it's written in German and I have enough trouble with
> English (my native language).
> 
> Any suggestions?
> 
> John Guynn
> 
> This email brought to you by RFCs 821 and 1225.
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

Joe Stump, PHP Hacker
[EMAIL PROTECTED]
http://www.miester.org/





No luck there...perl based one but not PHP.  I've also tried hotscripts.com.

John Guynn

This email brought to you by RFCs 821 and 1225.


-----Original Message-----
From: Joe Stump [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 12, 2001 11:17 AM
To: John Guynn
Cc: Php (E-mail)
Subject: Re: [PHP] Looking for a freeware PHP/MySQL classifieds script


Did you try freshmeat.net ???

--Joe

On Fri, Jan 12, 2001 at 11:14:45AM -0600, John Guynn wrote:
> I found one but it's written in German and I have enough trouble with
> English (my native language).




Hi everyone,

My name's Kenneth Zink and I'm a newbie here.  I just started working with
PHP on Wednesday, but with the help of John Guynn, I think I'm getting the
hang of it pretty quickly.

I joined the list so that I have more resources available to me as I
continue learning how to program in PHP.  My main website that I work on
right now is www.s-series.org .  please check it out and let me know what
you think.

BTW, if you know of a good PHP based classifieds script, please let me know,
because I want to get away from the CGI based classifieds that we currently
have.

Thanks.

Kenneth R Zink II     [EMAIL PROTECTED]    ICQ# 5095094
'87 2.8L TBI GMC S-15 Ext. Cab (Hurricane) ...524 in the works !!!
http://www.s-series.org/htm/windstorm/project-windstorm.htm
'85 3.4L Carbed Chevy S-10 Blazer (FireStorm) ...Soon to be 3.4L SFI DIS !!!
http://www.s-series.org/htm/firestorm/firestorm.htm
Racing by the Grace of God!!





Ok,

I recently upgraded to 4.0.4 (i am aware that pl1 is out, but there is no
note of the fix in NEWS).

Since that upgrade, when returning data from MySQL that begins with a `$',
it munges the $ and the first two characters following. This change has
only been since my upgrade from 4.0.3pl1 to 4.0.4.

Any ideas?

Cameron S. Watters
[EMAIL PROTECTED]







Sorry bout that. Fixed it myself. This is the preg_replace bug w/ $ that
hit the list a while ago. Template engine uses preg_replace.

-c

> Ok,
> 
> I recently upgraded to 4.0.4 (i am aware that pl1 is out, but there is no
> note of the fix in NEWS).
> 
> Since that upgrade, when returning data from MySQL that begins with a `$',
> it munges the $ and the first two characters following. This change has
> only been since my upgrade from 4.0.3pl1 to 4.0.4.
> 
> Any ideas?
> 
> Cameron S. Watters
> [EMAIL PROTECTED]






Haven't tried it.  My guess is that it doesn't work, but could be made
to.





No idea.  :) Haven't tried it.  I'll check and write back to the list.  

Michael Kimsal wrote:
> 
> You mean 'eval' doesn't work at all, or doing an 'eval' on a particular
> file?
> 
> George Schlossnagle wrote:
> 
> > Haven't tried it.  My guess is that it doesn't work, but could be made
> > to.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]





Guess I should look at the code/try it out before I respond to things. 
:)

eval()'d code works fine, though it won't be cached (the file calling it
will be of course, but no eval()'d bit won't be.)



Michael Kimsal wrote:
> 
> You mean 'eval' doesn't work at all, or doing an 'eval' on a particular
> file?
> 
> George Schlossnagle wrote:
> 
> > Haven't tried it.  My guess is that it doesn't work, but could be made
> > to.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]





I'm currently working on an installation
of rosenet's MyCart and I am curious if
anyone has used this cart and modified it
to include product options, size color etc..
my intended end product is an online ordering system
for a pizza place, so essentially my options
will be pizza sizes and toppings, if anyone has
any ideas on how to go about what I'm trying I'd
appreciate it.

Jerry Lake 





How can I correctly register session vars on a recursive form?

If I call a page repeatedly using:

<FORM ACTION="<?php echo $PHP_SELF ?>" METHOD="POST">

The earlier variables keep getting lost.

How can I register the session variables correctly?  Each subsequent
page should set its own variable while remembering all those previously
set.

Right now the top of the page says:

-----------
session_start();

$thevals=array(alpha,beta,gamma,delta,epsilon);
while (list($key, $val) = each($thevals)) {
  if (!session_is_registered($val) ) {
    session_register("$val");
  }
}
----------

thanks,

bill





This is probably due to the fact that form values don't override session
values... this is a feature, not a bug.  (imagine if i could do:
http://www.yourdomain.com/highsecurity.php?user=admin and magically
become admin... very broken security)

-jm

-----Original Message-----
From: bill [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 12, 2001 11:25 AM
To: [EMAIL PROTECTED]
Subject: [PHP] session vars with recursive form


How can I correctly register session vars on a recursive form?

If I call a page repeatedly using:

<FORM ACTION="<?php echo $PHP_SELF ?>" METHOD="POST">

The earlier variables keep getting lost.

How can I register the session variables correctly?  Each subsequent
page should set its own variable while remembering all those previously
set.

Right now the top of the page says:

-----------
session_start();

$thevals=array(alpha,beta,gamma,delta,epsilon);
while (list($key, $val) = each($thevals)) {
  if (!session_is_registered($val) ) {
    session_register("$val");
  }
}
----------

thanks,

bill


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




O.K., this seems to work:

-------------------
$thevals=array(alpha,beta,gamma,delta,epsilon);
while (list($key, $val) = each($thevals)) {
  if ($HTTP_POST_VARS["$val"] && (!session_is_registered("$val"))) {
    session_register("$val");
  }
}
-------------------

bill wrote:

> How can I correctly register session vars on a recursive form?
>
> If I call a page repeatedly using:
>
> <FORM ACTION="<?php echo $PHP_SELF ?>" METHOD="POST">
>
> The earlier variables keep getting lost.
>
> How can I register the session variables correctly?  Each subsequent
> page should set its own variable while remembering all those previously
> set.
>
> Right now the top of the page says:
>
> -----------
> session_start();
>
> $thevals=array(alpha,beta,gamma,delta,epsilon);
> while (list($key, $val) = each($thevals)) {
>   if (!session_is_registered($val) ) {
>     session_register("$val");
>   }
> }
> ----------
>
> thanks,
>
> bill
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]





In article <Pine.BSF.4.10.10101112007430.77660-100000@localhost>,
[EMAIL PROTECTED]  wrote:
> when was <?= 'enabled' in php?  4.0.0 ?

4.0, although it actually existed for php 3 a long time ago for a short
while and was then removed.

http://cvs.php.net/viewcvs.cgi/php3/language-scanner.lex.diff?r1=1.3&r2=1.4
http://cvs.php.net/viewcvs.cgi/php3/language-scanner.lex.diff?r1=1.6&r2=1.7

jim





the main reason to follow guidelines like this is to make your code legible
and modifiable.

i come to PHP from HTML via Perl/CGI, and have inherited some nasty code on
sites i have worked on.  i've always appreciated code that is structurally
formatted.

Perl is notorious for its intrinsic flexiblity and default global variables,
which allows for programmers to write statements that are very hard to
comprehend while reading the code.  this follows for other scripted
languages like JavaScript and PHP.

using braces and indents are a part of authoring legible code in almost any
programming language, and should be exercised whenever possible if you are
writing code that others will work on, or if you intend for your code to be
portable.

i do think that the code standard has some good elements to it, but it goes
too far to specify a 4-space indent and to specify no spaces within if
(condition) statements.

we all benefit from writing legible code, plain and simple.

DanO


-----Original Message-----
From: Mark Maggelet [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 12, 2001 11:40 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] mixing HTML and PHP code


>http://www.binarycloud.com/code_standard.html

>> http://marc.theaimsgroup.com/?l=php-pear&m=97603413001842&w=2

>> Best Practices: PHP Coding Style                 :
>> http://phpbuilder.com/columns/tim20010101.php3

>> Smart Architectures in PHP                       :
>> http://phpbuilder.com/columns/tim20001010.php3

These are all just opinions, none of these are official Php style
guidelines, so there's no real reason to follow them.

- Mark


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






>i do think that the code standard has some good elements to it, but
>it goes
>too far to specify a 4-space indent and to specify no spaces within
>if
>(condition) statements.

I don't think it goes too far (I think it should be 3 spaces tho),
but until the php guys publish some official style guidelines, I'll
do it my own way.







actually, that's a good separate point:

I dislike the PEAR coding standard's inflexibility. I _fully_ dig coding
standards, but that feels a little too "iron fisted" to me... who cares if
someone uses 4 spaces instead of a tab?

hopefully I'm not putting my foot in my mouth and have that somewhere in the
binarycloud code standard... maybe I should go look :)

_alex


--
Alex Black, Head Monkey
[EMAIL PROTECTED]

The Turing Studio, Inc.
http://www.turingstudio.com

vox+510.666.0074
fax+510.666.0093

Saul Zaentz Film Center
2600 Tenth St Suite 433
Berkeley, CA 94710-2522




> From: [EMAIL PROTECTED] ("DanO")
> Newsgroups: php.general
> Date: 12 Jan 2001 12:14:44 -0800
> Subject: [PHP] on style (was mixing PHP and HTML code)
> 
> 
> the main reason to follow guidelines like this is to make your code legible
> and modifiable.
> 
> i come to PHP from HTML via Perl/CGI, and have inherited some nasty code on
> sites i have worked on.  i've always appreciated code that is structurally
> formatted.
> 
> Perl is notorious for its intrinsic flexiblity and default global variables,
> which allows for programmers to write statements that are very hard to
> comprehend while reading the code.  this follows for other scripted
> languages like JavaScript and PHP.
> 
> using braces and indents are a part of authoring legible code in almost any
> programming language, and should be exercised whenever possible if you are
> writing code that others will work on, or if you intend for your code to be
> portable.
> 
> i do think that the code standard has some good elements to it, but it goes
> too far to specify a 4-space indent and to specify no spaces within if
> (condition) statements.
> 
> we all benefit from writing legible code, plain and simple.
> 
> DanO
> 
> 
> -----Original Message-----
> From: Mark Maggelet [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 12, 2001 11:40 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP] mixing HTML and PHP code
> 
> 
>> http://www.binarycloud.com/code_standard.html
> 
>>> http://marc.theaimsgroup.com/?l=php-pear&m=97603413001842&w=2
> 
>>> Best Practices: PHP Coding Style                 :
>>> http://phpbuilder.com/columns/tim20010101.php3
> 
>>> Smart Architectures in PHP                       :
>>> http://phpbuilder.com/columns/tim20001010.php3
> 
> These are all just opinions, none of these are official Php style
> guidelines, so there's no real reason to follow them.
> 
> - Mark
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 





Just curious. I tried accessing MySQL through ODBC using 
a system DSN (MyODBC driver ver. myodbc-2.50.36-nt.zip)
and a script as simple as this one crashes Apache at the 
odbc_fetch_row() call. I actually don't know much about 
ODBC related stuff inside PHP... or generally, for that 
matter, so I don't know whether this is unsupported, or 
whether a more stable state is possible / desirable.


$conn = odbc_connect( $dsn , $usr , $pwd );
$res = odbc_tables( $conn ) ;
while( $r = odbc_fetch_row( $res ) ) {
        for( $i = 0 ; $i < count( $r ) ; $i++ ) {
                echo $r[ $i ] , '|' ;
        }
        echo "\n" ;
}




____________________________________________________________
Cynic:

A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.

[EMAIL PROTECTED]






Hi! I was wondering if someone knows, or can think of a way to go around
this problem i have.

The thing is i am working with a form with a field array. Each field is
something like:
<input name="myfields[]" type="text">

When i receive the posted data, I can access the "myfields" array. This is
fine.

The problem is within my form i have client JavaScript code to validate the
form data. But I can't make reference to a form object called myfields[] or
myfields[5] or just myfields. The property name of the javascript object is
set to "myfields[]", but reference to myfields[][5] or
document.myform.fields["myfields[]"] doesn't work either.

Any suggestions will be greatly appreciated.
Thanks in advance.







Does anyone know if CodeCharge create SQL dump
files as well as the code, or do you have to
create them for your specific needs?

Jerry Lake 





How do I store a jpg within a table?

I want for a user to be able to pull a jpg from either their HD and store it
in a table with some other information for a classifieds section.  That way
when the ad is deleted, the picture goes with it instead of remaining on my
HD.

Kenneth R Zink II     [EMAIL PROTECTED]    ICQ# 5095094
'87 2.8L TBI GMC S-15 Ext. Cab (Hurricane) ...524 in the works !!!
http://www.s-series.org/htm/windstorm/project-windstorm.htm
'85 3.4L Carbed Chevy S-10 Blazer (FireStorm) ...Soon to be 3.4L SFI DIS !!!
http://www.s-series.org/htm/firestorm/firestorm.htm
Racing by the Grace of God!!





Kenneth,

I store the path to the image in the table. I am unsure if you can actually
write an image to a table.
When the item is deleted, I run an "exec" command to remove the actual file.

Here's some snippets:

The actual html to create the upload file text box within a <form>:

        <INPUT type="file" name="picture" size=30>

This is the code for the page that is called using the form action. I added
a timestamp to the filename to avoid anyone accidentially overwriting a
file. (and hacking - you know a picture of a naked lady where a picture of a
garden rack is supposed to be):

    // Creates the image file with a timestamp
    $timestamp = time();
    $image= $timestamp.$picture_name;
    exec("mv $picture /path/to/your/directory/$image");

The "exec" command is what you really want to pay attenetion to. Also, this
example is assuming you are running Linux and MySQL. This is the delete
routine that removes the file and the record from the table:

   //Remove File from server
  $sol_1 = "SELECT * FROM featured WHERE image = '$sell_record'";
  $sol_result = myself_query($sol_1, $connection) or die ("SQL_RESULT");
  $row = myself_fetch_array($sol_result) or die ("Couldn't execute $sol_1");
  $image = $row["image"];
  exec("rm $picture /path/to/your/directory/'$image'");

Please note that you must use the actual path to the directory, not the
httpd path. I hope this helps you. Let me know.....

Shane

----- Original Message -----
From: "Kenneth R Zink II" <[EMAIL PROTECTED]>
To: "PHP" <[EMAIL PROTECTED]>
Sent: Friday, January 12, 2001 4:35 PM
Subject: [PHP] How do I store a pic?


> How do I store a jpg within a table?
>
> I want for a user to be able to pull a jpg from either their HD and store
it
> in a table with some other information for a classifieds section.  That
way
> when the ad is deleted, the picture goes with it instead of remaining on
my
> HD.
>
> Kenneth R Zink II     [EMAIL PROTECTED]    ICQ# 5095094
> '87 2.8L TBI GMC S-15 Ext. Cab (Hurricane) ...524 in the works !!!
> http://www.s-series.org/htm/windstorm/project-windstorm.htm
> '85 3.4L Carbed Chevy S-10 Blazer (FireStorm) ...Soon to be 3.4L SFI DIS
!!!
> http://www.s-series.org/htm/firestorm/firestorm.htm
> Racing by the Grace of God!!
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





Hello,

I just added the translated versions of the manual in WinHelp format to
http://www.php.net/docs.php I hope you all find it usefull.

Regards,

Derick Rethans

---------------------------------------------------------------------
      PHP: Scripting the Web - www.php.net - [EMAIL PROTECTED]
---------------------------------------------------------------------





Hi Monte,

I saw your post on php-general.  I don't have access to a Solaris7 box,
but to get the shm version to compile under Solaris8, just make the
following change to apc_sem.c:


17:10:57(root@bp6)> diff apc_sem.c apc_sem.c.new 
33c33
< #ifdef APC_HOST_LINUX
---
> #ifndef       APC_HOST_BSD

The mmap version seems to compile straight out of the box.  Let me know
if you have any other problems.  This change will be incorporated into
the first bug-fix release, which should be out in a couple days.

George

Monte Ohrt wrote:
> 
> It works for me now... last night I was downloading it to windows, then
> ftp'ing it to my linux box... something wasn't working right.
> 
> Thanks
> Monte
> 
> George Schlossnagle wrote:
> >
> > Hi.  Hmmm... unzips fine for me.  I've attached a freshly tarred copy.
> >
> > Monte Ohrt wrote:
> > >
> > > Hey guys, this tgz archive seems to be incomplete.. one messed up file
> > > called "GORY_DETAILS"
> >
> > --
> > $_ = 'George Schlossnagle';
> > 
>s#.#(ord$')-(ord$&)+((index($_,$')-$&)?1002:0)#ego;s#-#((substr($],4,1)-6)?67:$-[0])#eog;$:=$_;print
> > join('',(map chr$_,reverse
> > 
>map{substr($:,(3*$_),3)+(11,-109,-14,94,-894,-28,-61,-202,-417,83,-20,-678,53,96,4,-494,82,-869,-826,24,16,-684,-450,-27)[$_]}(0...length($_)/3)),chr(length($_)/2+ord$/),$/);
> >
> >   ------------------------------------------------------------------------
> >                   Name: apc-1.0.tgz
> >    apc-1.0.tgz    Type: unspecified type (application/octet-stream)
> >               Encoding: base64
> 
> --
> Monte Ohrt <[EMAIL PROTECTED]>
> http://www.ispi.net/





hi list,

sorry, but we cant manage 

a Load Data Infile


cause we always get:
Can't get stat of '/tmp/phpNNAQSM' (Errcode: 2)

OUR Code is working fine in different project where safe_mode = OFF



=============================

heres the line where we try to move the file to a webfolder in our directory

move_uploaded_file ($textfile, "/home/sites/site2/web/Tango/tmp/mySql.txt");
chmod("/home/sites/site2/web/Hafele/tmp/mySql.txt", 0644);

=============================



any ideas for us ?



is there a way that we can set the upload_tmp_dir  path in a .htaccess file ?



thank you



andreas


















I am trying to compile PHP 4.0.4pl1 as a CGI on my FreeBSD 3.4-STABLE box
and I seem
to be having problems for some reason. My configure line reads:


                                               /'^'\
                                              ( o o )
------------------------------------------oOOO--(_)--OOOo----
    Devin Atencio
    ArosNet Systems Administration         .oooO
    EMail: [EMAIL PROTECTED]               (   )   Oooo.
--------------------------------------------\ (----(   )-----
                                             \_)    ) /
                                                   (_/







I am trying to get PHP 4.0.4pl1 to run on my FreeBSD 3.4-STABLE box and
every time I run
the binary file and do "./php -v" it core dumps and gives me "Floating Point
Exception"
error. It does this as well on my FreeBSD 3.5-STABLE boxes. I tried 3
machines and the
same thing happens on all 3 of them. My configure line reads:

./configure --with-mysql --disable-debug --enable-trans-sid --with-ftp --wit
h-gd=/usr/local --enable-discard-path

Anyone have any Idea why It might be doing this. I noticed this started
since 4.0.4,
release. I got 4.0.3 to compile as CGI just fine but not since then.

                                               /'^'\
                                              ( o o )
------------------------------------------oOOO--(_)--OOOo----
    Devin Atencio
    ArosNet Systems Administration         .oooO
    EMail: [EMAIL PROTECTED]               (   )   Oooo.
--------------------------------------------\ (----(   )-----
                                             \_)    ) /
                                                   (_/






PHP gurus,

I am having a page named scene1.php, which got link to
playvoice.php, one drop down list box and a submit
button. I will try to explain what i want from this
page as much clearly as possible with the following
points.
1. Scene1.php appears on the user screen after it gets
redirected from a page named redirect1.php
2. Initially there won't be any submit button and the
page will have only link to playvoice.php and the
dropdown list box.
3. After the user clicks on the 'Play voice file' link
which leads to playvoice.php, he will go to
phpvoice.php which shows just one line like 'Played a
voice file' for about 3 seconds on the user screen and
he will be redirected back to scene1.php
4. Now the latest scene1.php won't have a 'Play voice
file' link but just a text 'Play voice file', dropdown
box and now the submit button appears on the screen.
5. As the user clicks on the submit button, the
opinion will enter into the database and a link 'Go to
the next scenario' appears on his screen, after he
clicks it he will go to redirect2.php.

Now what my problem is the logic which i wrote within
the if statement(code is below) is not working, but
directly the logic within the else statement is
appearing on the user screen(step 4 is coming directly
instead of step 2 coming first), which is preventing
the user from clicking on the link 'Play voice
file'(as there is no link at all, just text). So what
i feel is the $HTTP_REFERER variable is not catching
redirect1.php into it. I want to know where i am going
wrong in using that. 

Thanks a lot to whoever responds
Chakravarthy K Sannedhi

<html>
<head>
<title>Scenario 1 Best Effort</title>
</head>
<body>
<?php
print ("<body>");
mysql_connect('localhost','user','password') or die
('<b>unable to connect to the database.</b>');
mysql_select_db ('nimitztest') or die ('<b>unable to
select the database.</b>');
if (!$submit || !$error) {
?>
<center><h2><font face=Times New Roman
color=#3399ff>Scenario 1</font></h2></center>
<p>This scenario includes best effort network, without
any congestion. The queing is set to First In First
Out(FIFO) and there is no reservation made for voice.
Now please click on the link below to play the voice
file and later submit your opinion on the quality of
voice.</p>
<form action=<?php echo $PHP_SELF ?> method=post>
<?php
global $HTTP_REFERER;
if ($HTTP_REFERER ==
"http://www.myserver.com/redirect1.php") {
print ('<a href=playvoice.php>Play voice file</a>');
print ('<p>');
print ('<select name=opinion>');
print ('<option value=rate>(Rate it!)</option>');
print ('<option value=1>1</option>');
print ('<option value=2>2</option>');
print ('<option value=3>3</option>');
print ('<option value=4>4</option>');
print ('<option value=5>5</option>');
print ('</select>');
}
else {
print ('Play voice file');
print ('<p>');
print ('<select name=opinion>');
print ('<option value=rate>(Rate it!)</option>');
print ('<option value=1>1</option>');
print ('<option value=2>2</option>');
print ('<option value=3>3</option>');
print ('<option value=4>4</option>');
print ('<option value=5>5</option>');
print ('</select>');
print ('<center><input type=submit name=submit
value=submit your opionion></center>');
flush();
print ('</form>');
}
}

if ($submit) {
if ($opinion=='rate') {
$error="Please select the rating";
echo $error;
}
else {
$result = mysql_query("select * from testtakerinfo
order by userid desc limit 1");
$myrow = mysql_fetch_array ($result);
$id = $myrow["userid"];
$query = "update testtakerinfo set scene1='$opinion'
where userid=$id";
mysql_query ($query);
echo "<a href=redirect2.php>Go to next scenario</a>";
}
}
include ('includefile.php');
?>
</body>
</html>

__________________________________________________
Do You Yahoo!?
Yahoo! Photos - Share your holiday photos online!
http://photos.yahoo.com/




is it possible with regex to
change one or more text characters
followed by a space into the same
characters followed by a tab?

Jerry Lake 





yes

At 23:54 12.1. 2001, Jerry Lake wrote the following:
-------------------------------------------------------------- 
>is it possible with regex to
>change one or more text characters
>followed by a space into the same
>characters followed by a tab?
>
>Jerry Lake 
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
------end of quote------ 



____________________________________________________________
Cynic:

A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.

[EMAIL PROTECTED]






and how would I go about that?

Jerry Lake

-----Original Message-----
From: Cynic [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 12, 2001 3:10 PM
To: Jerry Lake; [EMAIL PROTECTED]
Subject: Re: [PHP] regex


yes

At 23:54 12.1. 2001, Jerry Lake wrote the following:
-------------------------------------------------------------- 
>is it possible with regex to
>change one or more text characters
>followed by a space into the same
>characters followed by a tab?
>
>Jerry Lake 
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
------end of quote------ 



____________________________________________________________
Cynic:

A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.

[EMAIL PROTECTED]







depends. is the set of strings preceeding the space limited 
and known, or is it something like [^abc]{3,12} ?


At 00:13 13.1. 2001, Jerry Lake wrote the following:
-------------------------------------------------------------- 
>and how would I go about that?
>
>Jerry Lake
>
>-----Original Message-----
>From: Cynic [mailto:[EMAIL PROTECTED]]
>Sent: Friday, January 12, 2001 3:10 PM
>To: Jerry Lake; [EMAIL PROTECTED]
>Subject: Re: [PHP] regex
>
>
>yes
>
>At 23:54 12.1. 2001, Jerry Lake wrote the following:
>-------------------------------------------------------------- 
>>is it possible with regex to
>>change one or more text characters
>>followed by a space into the same
>>characters followed by a tab?
>>
>>Jerry Lake 
>>
>>
>>-- 
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>------end of quote------ 
>
>
>
>____________________________________________________________
>Cynic:
>
>A member of a group of ancient Greek philosophers who taught
>that virtue constitutes happiness and that self control is
>the essential part of virtue.
>
>[EMAIL PROTECTED]
>
>
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
------end of quote------ 



____________________________________________________________
Cynic:

A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.

[EMAIL PROTECTED]






At 02:54 PM 1/12/01 , Jerry Lake wrote:
>is it possible with regex to
>change one or more text characters
>followed by a space into the same
>characters followed by a tab?
>
>Jerry Lake


For example -

         $NewString = ereg_replace("([[:alpha:]]+) ", "\\1".chr(9), $String);

This will convert a sequence of one or more alphabetic characters followed 
by one space to the same set of characters followed by a tab (that's the 
chr(9) part).

If you want to match only a specific set of text characters - say, a, e, i, 
o and u - then you can use

         $NewString = eregi_replace("([aeiou]+) ", "\\1".chr(9), $String);

Notice i used eregi_replace() instead of ereg_replace(); the 'i' means case 
INsensitive.

Of course, there are other ways of doing this with preg_replace and 
str_replace, both of which are faster than ereg_replace (str_replace is the 
fastest); I happen to use ereg becaouse I'm most familiar with it, since it 
came along before the preg_ functions. As always, you can check out the docs:

         http://www.php.net/ereg_replace
         http://www.php.net/eregi_replace
         http://www.php.net/str_replace
         http://www.php.net/preg_replace


         -steve

(The usual off-the-top-of-my-head-untested-code-snippet caveats apply)



+------------------------------------------------------------------------+
| Steve Edberg                           University of California, Davis |
| [EMAIL PROTECTED]                                     (530)754-9127 |
| http://aesric.ucdavis.edu/                  http://pgfsun.ucdavis.edu/ |
+---------------------- Gort, Klaatu barada nikto! ----------------------+




I have a small phone directory
bust the name listings are combined
for example
Schwartz Bob & Amelia   555-1212        Oxford
Scirkin Bill    555-1213        Brooks

I need to add a tab or a comma after the
lastname so I can have as a separate field
when I dump it into MySQL and there is about
3500 records and I'd hate to have to do it by hand
any ideas?

Jerry Lake            - [EMAIL PROTECTED]

-----Original Message-----
From: Cynic [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 12, 2001 3:25 PM
To: Jerry Lake; [EMAIL PROTECTED]
Subject: RE: [PHP] regex


depends. is the set of strings preceeding the space limited 
and known, or is it something like [^abc]{3,12} ?


At 00:13 13.1. 2001, Jerry Lake wrote the following:
-------------------------------------------------------------- 
>and how would I go about that?
>
>Jerry Lake
>
>-----Original Message-----
>From: Cynic [mailto:[EMAIL PROTECTED]]
>Sent: Friday, January 12, 2001 3:10 PM
>To: Jerry Lake; [EMAIL PROTECTED]
>Subject: Re: [PHP] regex
>
>
>yes
>
>At 23:54 12.1. 2001, Jerry Lake wrote the following:
>-------------------------------------------------------------- 
>>is it possible with regex to
>>change one or more text characters
>>followed by a space into the same
>>characters followed by a tab?
>>
>>Jerry Lake 
>>
>>
>>-- 
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>------end of quote------ 
>
>
>
>____________________________________________________________
>Cynic:
>
>A member of a group of ancient Greek philosophers who taught
>that virtue constitutes happiness and that self control is
>the essential part of virtue.
>
>[EMAIL PROTECTED]
>
>
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
------end of quote------ 



____________________________________________________________
Cynic:

A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.

[EMAIL PROTECTED]



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






looks like you need to find all the spaces _before_ the _first_ 
digit on the row, and _after_ the _last_ digit on the row. 
does that fit your data? are there no other numbers than the 
telephone ones?

At 00:29 13.1. 2001, Jerry Lake wrote the following:
-------------------------------------------------------------- 
>I have a small phone directory
>bust the name listings are combined
>for example
>Schwartz Bob & Amelia   555-1212        Oxford
>Scirkin Bill    555-1213        Brooks
>
>I need to add a tab or a comma after the
>lastname so I can have as a separate field
>when I dump it into MySQL and there is about
>3500 records and I'd hate to have to do it by hand
>any ideas?
>
>Jerry Lake            - [EMAIL PROTECTED]
>
>-----Original Message-----
>From: Cynic [mailto:[EMAIL PROTECTED]]
>Sent: Friday, January 12, 2001 3:25 PM
>To: Jerry Lake; [EMAIL PROTECTED]
>Subject: RE: [PHP] regex
>
>
>depends. is the set of strings preceeding the space limited 
>and known, or is it something like [^abc]{3,12} ?
>
>
>At 00:13 13.1. 2001, Jerry Lake wrote the following:
>-------------------------------------------------------------- 
>>and how would I go about that?
>>
>>Jerry Lake
>>
>>-----Original Message-----
>>From: Cynic [mailto:[EMAIL PROTECTED]]
>>Sent: Friday, January 12, 2001 3:10 PM
>>To: Jerry Lake; [EMAIL PROTECTED]
>>Subject: Re: [PHP] regex
>>
>>
>>yes
>>
>>At 23:54 12.1. 2001, Jerry Lake wrote the following:
>>-------------------------------------------------------------- 
>>>is it possible with regex to
>>>change one or more text characters
>>>followed by a space into the same
>>>characters followed by a tab?
>>>
>>>Jerry Lake 
>>>
>>>
>>>-- 
>>>PHP General Mailing List (http://www.php.net/)
>>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>For additional commands, e-mail: [EMAIL PROTECTED]
>>>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>>------end of quote------ 
>>
>>
>>
>>____________________________________________________________
>>Cynic:
>>
>>A member of a group of ancient Greek philosophers who taught
>>that virtue constitutes happiness and that self control is
>>the essential part of virtue.
>>
>>[EMAIL PROTECTED]
>>
>>
>>
>>
>>-- 
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>------end of quote------ 
>
>
>
>____________________________________________________________
>Cynic:
>
>A member of a group of ancient Greek philosophers who taught
>that virtue constitutes happiness and that self control is
>the essential part of virtue.
>
>[EMAIL PROTECTED]
>
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
------end of quote------ 



____________________________________________________________
Cynic:

A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.

[EMAIL PROTECTED]






Bolgrihn Michael        555-5566        142 Hillyer St  Oxford
Bollenbach Gary V       555-5078        315 Freedom Rd  Oxford
Bonaguidi Daniel        555-5155        N4663 10th Av   Montello
Bonnett Agatha & John   555-5363        547 Fawn Ct     Oxford
Bonnett Bernard & Norma 555-4360        116 E Ormsby St Oxford
Bonnett Bob & Eleanor   555-5627        527 Fern Av     Oxford

Here is a sample from the listing there are numbers in the address
as well. 
$NewString = ereg_replace("([[:alpha:]]+) ", "\\1".",", $test);
that works to an extent, except that it adds the comma after
every word that is followed by one space and not just the first occurance

Jerry Lake 

-----Original Message-----
From: Cynic [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 12, 2001 3:41 PM
To: Jerry Lake; [EMAIL PROTECTED]
Subject: RE: [PHP] regex


looks like you need to find all the spaces _before_ the _first_ 
digit on the row, and _after_ the _last_ digit on the row. 
does that fit your data? are there no other numbers than the 
telephone ones?

At 00:29 13.1. 2001, Jerry Lake wrote the following:
-------------------------------------------------------------- 
>I have a small phone directory
>bust the name listings are combined
>for example
>Schwartz Bob & Amelia   555-1212        Oxford
>Scirkin Bill    555-1213        Brooks
>
>I need to add a tab or a comma after the
>lastname so I can have as a separate field
>when I dump it into MySQL and there is about
>3500 records and I'd hate to have to do it by hand
>any ideas?
>
>Jerry Lake            - [EMAIL PROTECTED]
>
>-----Original Message-----
>From: Cynic [mailto:[EMAIL PROTECTED]]
>Sent: Friday, January 12, 2001 3:25 PM
>To: Jerry Lake; [EMAIL PROTECTED]
>Subject: RE: [PHP] regex
>
>
>depends. is the set of strings preceeding the space limited 
>and known, or is it something like [^abc]{3,12} ?
>
>
>At 00:13 13.1. 2001, Jerry Lake wrote the following:
>-------------------------------------------------------------- 
>>and how would I go about that?
>>
>>Jerry Lake
>>
>>-----Original Message-----
>>From: Cynic [mailto:[EMAIL PROTECTED]]
>>Sent: Friday, January 12, 2001 3:10 PM
>>To: Jerry Lake; [EMAIL PROTECTED]
>>Subject: Re: [PHP] regex
>>
>>
>>yes
>>
>>At 23:54 12.1. 2001, Jerry Lake wrote the following:
>>-------------------------------------------------------------- 
>>>is it possible with regex to
>>>change one or more text characters
>>>followed by a space into the same
>>>characters followed by a tab?
>>>
>>>Jerry Lake 
>>>
>>>
>>>-- 
>>>PHP General Mailing List (http://www.php.net/)
>>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>For additional commands, e-mail: [EMAIL PROTECTED]
>>>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>>------end of quote------ 
>>
>>
>>
>>____________________________________________________________
>>Cynic:
>>
>>A member of a group of ancient Greek philosophers who taught
>>that virtue constitutes happiness and that self control is
>>the essential part of virtue.
>>
>>[EMAIL PROTECTED]
>>
>>
>>
>>
>>-- 
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>------end of quote------ 
>
>
>
>____________________________________________________________
>Cynic:
>
>A member of a group of ancient Greek philosophers who taught
>that virtue constitutes happiness and that self control is
>the essential part of virtue.
>
>[EMAIL PROTECTED]
>
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
------end of quote------ 



____________________________________________________________
Cynic:

A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.

[EMAIL PROTECTED]







Hello,

I was going to use sessions to save a logged in variable so if the user
logged in with a username and password I checked for the session variable
and if it existed then I could continue.

Is there a way for the loggedin session variable to automatically be
destroyed after 5 minutes for example?  If not what would be another way I
could implement the above.


thanks,

Randy





Is it faster and more efficient to have smaller scripts that only do one
specific thing when it is executed or can I have a script perform to
different tasks based on a variable sent to it?  It will be a high user
website so I am thinking that the smaller the script the better?  Am I
right?

Randy





depends on the underlying FS - you might find yourself bitten 
by disk hits that could've been avoided...

How about writing a small test suite and benching the server?


At 00:29 13.1. 2001, Randy Johnson wrote the following:
-------------------------------------------------------------- 
>Is it faster and more efficient to have smaller scripts that only do one
>specific thing when it is executed or can I have a script perform to
>different tasks based on a variable sent to it?  It will be a high user
>website so I am thinking that the smaller the script the better?  Am I
>right?
>
>Randy
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
------end of quote------ 



____________________________________________________________
Cynic:

A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.

[EMAIL PROTECTED]






sort of.

if you will always need the same functions for every page, it is probably
faster to put them all in one file (where pure speed is concerned)

in binarycloud, everything that makes sense to logically separate into
separate files.

I though that would be kind of "ok" re speed until zend cache, but it turns
out to be rippin' fast, so I'd say put stuff in different files, because
it's easy to use.

btw, if you're building something big, have a look at binarycloud.com, it
will save you a lot of time.

-alex


--
Alex Black, Head Monkey
[EMAIL PROTECTED]

The Turing Studio, Inc.
http://www.turingstudio.com

vox+510.666.0074
fax+510.666.0093

Saul Zaentz Film Center
2600 Tenth St Suite 433
Berkeley, CA 94710-2522




> From: [EMAIL PROTECTED] ("Randy Johnson")
> Newsgroups: php.general
> Date: 12 Jan 2001 15:24:53 -0800
> Subject: [PHP] Script execution Speed
> 
> Is it faster and more efficient to have smaller scripts that only do one
> specific thing when it is executed or can I have a script perform to
> different tasks based on a variable sent to it?  It will be a high user
> website so I am thinking that the smaller the script the better?  Am I
> right?
> 
> Randy
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 





The code below does not work. What could be causing
this?? php pages do come up, and I can retrieve SQL
data. The header seems okay: test.php?name=Bob and if
I define a variable on the same page I can use it.

Please enter user name here: 
<FORM>
  <INPUT TYPE=text NAME=name>
  <INPUT TYPE=submit VALUE=Submit>
</FORM><BR>

you typed: 
<?
 echo ($name);
?>

Linux  2.2.14
PHP/4.0.3pl1
'./configure' '--without-gd' '--with-apxs'
'--with-mysql=/usr' '--with-pgsql' '--with-imap'

Ideas??

__________________________________________________
Do You Yahoo!?
Yahoo! Photos - Share your holiday photos online!
http://photos.yahoo.com/




you have register_globals off in your php.ini or httpd.conf 
or .htaccess. either use $HTTP_GET_VARS['name'] or turn the 
setting on.

At 00:36 13.1. 2001, jeff fitzmyers wrote the following:
-------------------------------------------------------------- 
>The code below does not work. What could be causing
>this?? php pages do come up, and I can retrieve SQL
>data. The header seems okay: test.php?name=Bob and if
>I define a variable on the same page I can use it.
>
>Please enter user name here: 
><FORM>
>  <INPUT TYPE=text NAME=name>
>  <INPUT TYPE=submit VALUE=Submit>
></FORM><BR>
>
>you typed: 
><?
> echo ($name);
>?>
>
>Linux  2.2.14
>PHP/4.0.3pl1
>'./configure' '--without-gd' '--with-apxs'
>'--with-mysql=/usr' '--with-pgsql' '--with-imap'
>
>Ideas??
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! Photos - Share your holiday photos online!
>http://photos.yahoo.com/
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
------end of quote------ 



____________________________________________________________
Cynic:

A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.

[EMAIL PROTECTED]






I looked around the web for templates and founf FastTemplates. Not exactly 
what i was looking for thoug
lets say I have 
$file = "111"
and there is a template "template.txt"
and it contains 
"file #$file is blahlah"

how can I make that a template?

Thanks
- Peter


Reply via email to