php-general Digest 12 Jan 2001 11:58:38 -0000 Issue 450
Topics (messages 34157 through 34234):
Re: include path confusion
34157 by: Randy
Recomend Book
34158 by: Carlos Lora
Re: Dynamic 'left menu's' on site: Like a windows explorersystem???
34159 by: Josh G
34161 by: Jason Murray
34164 by: DanO
Re: Replace a space with _
34160 by: Philip Olson
Re: ik
34162 by: Jerry Lake
Re: <?= was born when?
34163 by: Toby Butzon
34179 by: Philip Olson
34188 by: Alex Black
34213 by: Richard Lynch
34220 by: Teodor Cimpoesu
Re: mixing HTML and PHP code
34165 by: Alex Black
34167 by: Chris Lee
34168 by: Jason Murray
34169 by: DanO
34170 by: Jason Murray
34171 by: Ignacio Vazquez-Abrams
34173 by: Jason Murray
34180 by: Alex Black
34183 by: Maxim Maletsky
34186 by: Alex Black
34187 by: Alex Black
34192 by: Jade Ohlhauser
34193 by: Tim Zickus
34194 by: Josh G
34195 by: Jason Murray
34197 by: Maxim Maletsky
34203 by: burk.pobox.com
34218 by: Alexander Wagner
34224 by: Philip Olson
34228 by: Christian Reiniger
Session Help (transparent sid's)
34166 by: Jamie Burns
Session File not being deleted
34172 by: Samantha Savvakis
34175 by: Jonathan Sharp
34222 by: Bryne Jørg Vidar
APC - new cache on the block
34174 by: Monte Ohrt
PDF error with pdf_open_png
34176 by: Jared Howard
34177 by: Ignacio Vazquez-Abrams
34189 by: Chris Lee
34196 by: Jared Howard
includes
34178 by: Dan Phoenix
34182 by: Alex Black
34185 by: Maxim Maletsky
:: MySql and PHP Book
34181 by: Ray Iftikhar
34184 by: Philip Olson
34199 by: Neil Zanella
Dir Help PLEASE
34190 by: Chris
34216 by: Philip Olson
where does "MAKE INSTALL" put PHP things?
34191 by: Derek Sivers
please help - urgent! - email & attachments
34198 by: Sefton
34201 by: lists.www.mulga.com.au
34205 by: Jason Murray
34206 by: Jason Murray
MYSQL start an auto_increment at a certain number
34200 by: Jared Howard
34215 by: Hsieh, Wen-Yang
APC Alternative PHP Cache Release Announcement
34202 by: George Schlossnagle
34204 by: Josh G
Limit image height/width on upload
34207 by: David Smith
34208 by: Jason Murray
Re: Funny running PHP4 on Apache, Windows 95
34209 by: Patrick Dunford
Size of Image
34210 by: Statbat
34211 by: Jason Murray
Re: BIG site names using PHP?
34212 by: Chris Adams
Re: Performance question
34214 by: Chris Adams
apache+php4 error ..
34217 by: Naresh Chafekar
Re: Shopping Cart Schema - Sessions
34219 by: Teodor Cimpoesu
Re: serialized respresentations of variables
34221 by: Hsieh, Wen-Yang
fetch html-page without file()
34223 by: mailing_list.gmx.at
34225 by: Teodor Cimpoesu
PHP Installation on W2K
34226 by: Niel Zeeman
Question
34227 by: Gareth Davies
34229 by: Cynic
34230 by: Simon Robson
34231 by: Bryne Jørg Vidar
Layout Manager
34232 by: Ulf Wendel
Re: Lost connection to MySQL server during query
34233 by: Tim Colles
Urgent: Special Characters
34234 by: TV Karthick Kumar
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]
----------------------------------------------------------------------
Thursday, January 11, 2001, 11:03:31 AM, you wrote:
BC>> Using PHP 3.0.18, every, single time I've used something like:
BC>> include('../farmers/underwear.php');
BC>> It works as expected.
BC> I'm half alseep. I see what you're saying. I suppose if you did:
BC> include('corn.php');
BC> It's going to try each path. Ie. ".:/include:/usr/src"
BC> ./corn.php
BC> (if not in .) /include/corn.php
BC> (if not in /include) /usr/src/corn.php
BC> (if not in /usr/src) Error.
BC> And I *suspect* that even if you use ../corn.php, it's going to try
BC> the include paths in the same way.
BC> ../corn.php is equivalent to ./../corn.php
There's the real confusion I'm having. If you use ../corn.php
it *appears* to then try
./include/../corn.php
then /usr/src/../corn.php
then error, whether the file was in any of those directories or
not (since those aren't valid directory references).
However, I see some includes I use with the extra path work and
some don't. I just wish they would document this so I knew for
sure.
BC> -Brian
BC> --
BC> Like punning, programming is a play on words.
Hello there,
I am new to PHP what would bookm would you recomend? Any
help is appreciated.
Carlos
I've got one you guys can have, email me anybody who wants it.
Gfunk
My name was Brian McGee,
I stayed up listening to Queen,
When I was seventeen.
http://www.gfunk007.com/
----- Original Message -----
From: "DanO" <[EMAIL PROTECTED]>
To: "Php-General@Lists. Php. Net" <[EMAIL PROTECTED]>
Sent: Friday, January 12, 2001 10:54 AM
Subject: RE: [PHP] Dynamic 'left menu's' on site: Like a windows
explorersystem???
>
> javascript IS the optimal solution for a user-friendly dynamic navbar.
>
> check this one out:
>
> http://javascript.internet.com/foldertree/
>
> i do sense a certain amount of FEAR on behalf of php'ers in regards to
> javascript.
>
> no web application is complete without a mix of client-side and
server-side
> application of code.
>
> DanO
>
>
>
> -----Original Message-----
> From: Alex Black [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 11, 2001 3:31 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Dynamic 'left menu's' on site: Like a windows
> explorersystem???
>
>
> you have two choices:
>
> yes, php can do it, but as php is a server side language, you have to
> refresh the page...
>
> or, you can go the
> much-more-dangerous-and-much-less-likely-to-work-on-many-browsers
javascript
> route.
>
> I suggest the first :)
>
> if you _do_ end up writing some good code, please make a library out of it
> and send it along! :)
>
> -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] ("Yoeri De Bruyn")
> > Newsgroups: php.general
> > Date: 11 Jan 2001 04:56:47 -0800
> > Subject: [PHP] Dynamic 'left menu's' on site: Like a windows explorer
> > system???
> >
> > Hi,
> >
> > I need to change my static left menu's into more dynamic ones, like when
> > you click one title of the menu, it shows it sub menu etc.
> >
> > Any body knows if that can be achieved using PHP? Or should i repel on
> > other techniques?
> > If someone did make similar stuff, could you please send me an example
> > or some good ideas?
> >
> > Thanks a lot in advance!!!!
> > Yoeri.
> >
> >
> > --
> > 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]
>
> javascript IS the optimal solution for a user-friendly dynamic navbar.
I don't agree.
> check this one out:
> http://javascript.internet.com/foldertree/
> i do sense a certain amount of FEAR on behalf of php'ers in regards to
> javascript.
Because it goes against accessibility.
> no web application is complete without a mix of client-side
> and server-side application of code.
If you don't want it to work in all browsers, you're right.
If you know your audience isn't disabled and uses browsers that support
JA *and* always have it switched on, go for it.
Jason
--
Jason Murray
[EMAIL PROTECTED]
Web Design Team, Melbourne IT
Fetch the comfy chair!
i'm not suggesting that you build inaccessible systems.
one should always provide a backup for browsers that don't support your
features.
ex:
<script src="/js/sniffer.js"></script>
<noscript></noscript>
--
i'm an advocate of using the most appropriate language to the application,
nothing more, nothing less.
and sometimes (often,actually), it AIN'T php.
DanO
-----Original Message-----
From: Jason Murray [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 11, 2001 3:57 PM
To: 'DanO'; Php-General@Lists. Php. Net
Subject: RE: [PHP] Dynamic 'left menu's' on site: Like a windows
explorersystem???
> javascript IS the optimal solution for a user-friendly dynamic navbar.
I don't agree.
> check this one out:
> http://javascript.internet.com/foldertree/
> i do sense a certain amount of FEAR on behalf of php'ers in regards to
> javascript.
Because it goes against accessibility.
> no web application is complete without a mix of client-side
> and server-side application of code.
If you don't want it to work in all browsers, you're right.
If you know your audience isn't disabled and uses browsers that support
JA *and* always have it switched on, go for it.
Jason
--
Jason Murray
[EMAIL PROTECTED]
Web Design Team, Melbourne IT
Fetch the comfy chair!
Also consider :
$filezip_name = str_replace(' ', '_', $filezip_name);
http://php.net/manual/function.str-replace.php
It will be faster.
Philip
On Thu, 11 Jan 2001, Chris Lee wrote:
> just add this somewhere near the top.
>
> $filezip_name = ereg_replace(' ', '_', $filezip_name);
>
> Chris Lee
> Mediawaveonline.com
>
>
>
> ""David Smith"" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> > With the following code how can I check to see if the file being uploaded
> > has a space in it? Maybe replace them with a _ or reject them all
> > together...
> >
> > if ($FileType== "none") {
> > print "ERROR! - You must specify a File Type before we can begin the
> > upload.<BR>";
> > }
> > else {
> >
> > if ($filezip== "none") {
> > print "ERROR! - You must specify a zip file to upload.<BR>";
> > }
> > else {
> > copy($filezip, "/home/sites/site1/ftp/$FileType/$filezip_name");
> > unlink($filezip);
> > }
> >
> >
> >
> > WreckRman2
> > Combat Flight Center
> > http://www.combatfs.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]
> >
>
>
>
> --
> 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]
>
l
Jerry Lake
-----Original Message-----
From: Richard Lynch [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 11, 2001 3:37 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] ik
k
----- Original Message -----
From: <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Thursday, January 11, 2001 5:01 PM
Subject: [PHP] ik
j
--
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]
Manual suggests 3.0.3, but I can't find any proof of it in
the changelogs...
--Toby
----- Original Message -----
From: "Richard Lynch" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 11, 2001 6:34 PM
Subject: Re: [PHP] <?= was born when?
> > when was <?= 'enabled' in php? 4.0.0 ?
>
> Definitely before that -- Not sure when.
>
> It was a long discussion, and some PHP Developers still
think it was a Bad
> Idea (tm).
>
> *SHOULD* be in the ChangeLogs somewhere...
>
> It mostly keeps the recent ASP converts from whining :-)
>
>
>
> --
> 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]
>
>
Toby, where at in manual?
Have looked around :
http://www.php.net/manual/language.basic-syntax.php
Here it states :
"Note: Support for ASP-style tags was added in 3.0.4."
Were they added at same time? Is it considered an "ASP-style tag" ?
Richard eludes to this fact. Also, it's not here :
http://www.php.net/manual/function.echo.php
Nor is it around short tags info (correct, they are not the same but
they do have relations in that if short tags are off, this feature dies
too ... )
Agreed, changelog would appreciate such a mention. Also, a mention in
"basic syntax" too.
philip
p.s. I will never use <?= , just curious when it was came about. Seems
more and more people are using them though ...
On Thu, 11 Jan 2001, Toby Butzon wrote:
> Manual suggests 3.0.3, but I can't find any proof of it in
> the changelogs...
> --Toby
> ----- Original Message -----
> From: "Richard Lynch" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, January 11, 2001 6:34 PM
> Subject: Re: [PHP] <?= was born when?
>
>
> > > when was <?= 'enabled' in php? 4.0.0 ?
> >
> > Definitely before that -- Not sure when.
> >
> > It was a long discussion, and some PHP Developers still
> think it was a Bad
> > Idea (tm).
> >
> > *SHOULD* be in the ChangeLogs somewhere...
> >
> > It mostly keeps the recent ASP converts from whining :-)
> >
> >
> >
> > --
> > 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 phillip,
I've been teetering back and fourth on that issue with binarycloud:
I _love_ using
<?=$hello?>
as opposed to the more compatible:
<?php echo $hello; ?>
the first _feels_ like a key, the latter does not :)
great for html templates.
_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] (Philip Olson)
> Newsgroups: php.general
> Date: 11 Jan 2001 17:26:13 -0800
> Subject: Re: [PHP] <?= was born when?
>
> Toby, where at in manual?
>
> Have looked around :
> http://www.php.net/manual/language.basic-syntax.php
>
> Here it states :
>
> "Note: Support for ASP-style tags was added in 3.0.4."
>
> Were they added at same time? Is it considered an "ASP-style tag" ?
> Richard eludes to this fact. Also, it's not here :
>
> http://www.php.net/manual/function.echo.php
>
> Nor is it around short tags info (correct, they are not the same but
> they do have relations in that if short tags are off, this feature dies
> too ... )
>
> Agreed, changelog would appreciate such a mention. Also, a mention in
> "basic syntax" too.
>
> philip
>
> p.s. I will never use <?= , just curious when it was came about. Seems
> more and more people are using them though ...
>
>
> On Thu, 11 Jan 2001, Toby Butzon wrote:
>
>> Manual suggests 3.0.3, but I can't find any proof of it in
>> the changelogs...
>> --Toby
>> ----- Original Message -----
>> From: "Richard Lynch" <[EMAIL PROTECTED]>
>> To: <[EMAIL PROTECTED]>
>> Sent: Thursday, January 11, 2001 6:34 PM
>> Subject: Re: [PHP] <?= was born when?
>>
>>
>>>> when was <?= 'enabled' in php? 4.0.0 ?
>>>
>>> Definitely before that -- Not sure when.
>>>
>>> It was a long discussion, and some PHP Developers still
>> think it was a Bad
>>> Idea (tm).
>>>
>>> *SHOULD* be in the ChangeLogs somewhere...
>>>
>>> It mostly keeps the recent ASP converts from whining :-)
>>>
>>>
>>>
>>> --
>>> 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]
>
It was minimally documented for a long time...
----- Original Message -----
From: Toby Butzon <[EMAIL PROTECTED]>
To: Richard Lynch <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, January 11, 2001 5:58 PM
Subject: Re: [PHP] <?= was born when?
> Manual suggests 3.0.3, but I can't find any proof of it in
> the changelogs...
> --Toby
> ----- Original Message -----
> From: "Richard Lynch" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, January 11, 2001 6:34 PM
> Subject: Re: [PHP] <?= was born when?
>
>
> > > when was <?= 'enabled' in php? 4.0.0 ?
> >
> > Definitely before that -- Not sure when.
> >
> > It was a long discussion, and some PHP Developers still
> think it was a Bad
> > Idea (tm).
> >
> > *SHOULD* be in the ChangeLogs somewhere...
> >
> > It mostly keeps the recent ASP converts from whining :-)
> >
> >
> >
> > --
> > 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 Toby!
On Thu, 11 Jan 2001, Toby Butzon wrote:
> Manual suggests 3.0.3, but I can't find any proof of it in
> the changelogs...
it is not in 3.0.12 for sure. So probably from later (I guess 3.0.15).
-- teodor
> That's pretty ugly.
>
> echo "<input type='text' name='hello' size='20' value='$value'>";
that isn't html anymore, though.
even though IE and NS may be forgiving, <input type='text' isn't valid.
" it is.
> That's a bit better.
> This is even better still:
>
> echo "<INPUT TYPE='TEXT' NAME='hello' SIZE='20' VALUE='$value'>";
>
> Now, I can see the PHP variable used in there a lot easier than I
> could before. Syntax highlighting would bring it up more, too.
>
>> 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.
>
> Actually, it makes it less useable for me.
how?
and what about your html production people, who needs to make changes to it?
>> : _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, halfway through a page, I figure out that I need to do a
> redirect or set a cookie?
I suggest you design your applications in such a way that you separate logic
from markup, and preferably assemble your applications out of separate
components that perform "categories" of logical operations. Using markup
that is not contain echos does not preclude good application design.
If you're building pages where database connections on the same page as your
markup, I see why you would say that. As you do larger applications, you'll
find that practice does not scale well:
Have a look at binarycloud.com. binarycloud provides a framework for
building large scale, robust applications that effectively separate markup
from logic. (and it makes coffee!)
> I assemble *all* the page content into a single string variable,
> and echo it out as the last thing the script does. This way I'm
> free to play with HTTP headers right up to that time.
agh!
well, ok - but I suggest that you use functions instead, and call your html
printing functions at the end of your script. or better, build simple
components, and glue them together to make an application that consists of
files that do logical operations, and files that contain markup.
Dumping all that crap into a variable and printing one massive goo-ball
isn't the route to incredible webserver performance, either.
Try stress testing your installations, you'll find apache suddenly needs a
_hideous_ amount of memory.
> However, each to their own - your way works for you and your team,
> mine works for me and mine :)
And as long as you aren't publishing code, do whatever you want.
But as soon as others would like to use it, those practices become a
consideration. I had to clean all kinds of bad habits out of my sytuff
before releasing binarycloud :)
But I certainly can't integrate code into a production process that looks
like this:
echo "<html>";
echo "<head>";
echo "<title>$title</title>";
echo "<link rel='stylesheet' type='text/css'
href='resources/css/$css.css'>";
echo "<script src='/resources/js/base_lib.js'
language='javascript'></script>";
echo "</head>";
echo "<body bgcolor='#EEEEEE' text='#000000' link='#003366' alink='#CCCCCC'
vlink='#003366' topmargin='0' leftmargin='0' marginwidth='0'
marginheight='0'>";
echo "<table border='0' cellpadding='0' cellspacing='0' width='100%'
bgcolor="#000000">";
echo "<tr>";
echo "<td valign='top'><img src='resources/images/binarycloud/tmpl/fire.jpg'
alt='' width='466' height='161' border='0'></td>";
echo "</tr>";
echo "</table>";
it introduces a whole world of unnecessary complexity.
to prove my point:
get one of your friends that knows html but not PHP to look at the above,
then this:
<html>
<head>
<title><?=$title?></title>
<link rel="stylesheet" type="text/css" href="resources/css/<?=$css?>.css">
<script src="/resources/js/base_lib.js" language="javascript"></script>
</head>
<body bgcolor="#EEEEEE" text="#000000" link="#003366" alink="#CCCCCC"
vlink="#003366" topmargin="0" leftmargin="0" marginwidth="0"
marginheight="0">
<table border="0" cellpadding="0" cellspacing="0" width="100%"
bgcolor="#000000">
<tr>
<td valign="top"><img src="resources/images/binarycloud/tmpl/fire.jpg"
alt="" width="466" height="161" border="0"></td>
</tr>
</table>
and see what they have to say.
_alex
It works, it works in
lynx,
netscape 4.76
netscape 6
mozilla 0.7
IE 5.5
opera 5.01
amaya 4.2.1
now I havent used any mac browsers but if it works for all those I assume it
will for Mac browsers eh.
Chris Lee
Mediawaveonline.com
"Alex Black" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > That's pretty ugly.
> >
> > echo "<input type='text' name='hello' size='20' value='$value'>";
>
> that isn't html anymore, though.
>
> even though IE and NS may be forgiving, <input type='text' isn't valid.
>
> " it is.
>
> > That's a bit better.
> > This is even better still:
> >
> > echo "<INPUT TYPE='TEXT' NAME='hello' SIZE='20' VALUE='$value'>";
> >
> > Now, I can see the PHP variable used in there a lot easier than I
> > could before. Syntax highlighting would bring it up more, too.
> >
> >> 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.
> >
> > Actually, it makes it less useable for me.
>
> how?
>
> and what about your html production people, who needs to make changes to
it?
>
>
> >> : _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, halfway through a page, I figure out that I need to do a
> > redirect or set a cookie?
>
> I suggest you design your applications in such a way that you separate
logic
> from markup, and preferably assemble your applications out of separate
> components that perform "categories" of logical operations. Using markup
> that is not contain echos does not preclude good application design.
>
> If you're building pages where database connections on the same page as
your
> markup, I see why you would say that. As you do larger applications,
you'll
> find that practice does not scale well:
>
> Have a look at binarycloud.com. binarycloud provides a framework for
> building large scale, robust applications that effectively separate markup
> from logic. (and it makes coffee!)
>
> > I assemble *all* the page content into a single string variable,
> > and echo it out as the last thing the script does. This way I'm
> > free to play with HTTP headers right up to that time.
>
> agh!
>
> well, ok - but I suggest that you use functions instead, and call your
html
> printing functions at the end of your script. or better, build simple
> components, and glue them together to make an application that consists of
> files that do logical operations, and files that contain markup.
>
> Dumping all that crap into a variable and printing one massive goo-ball
> isn't the route to incredible webserver performance, either.
>
> Try stress testing your installations, you'll find apache suddenly needs a
> _hideous_ amount of memory.
>
> > However, each to their own - your way works for you and your team,
> > mine works for me and mine :)
>
> And as long as you aren't publishing code, do whatever you want.
>
> But as soon as others would like to use it, those practices become a
> consideration. I had to clean all kinds of bad habits out of my sytuff
> before releasing binarycloud :)
>
> But I certainly can't integrate code into a production process that looks
> like this:
>
> echo "<html>";
> echo "<head>";
> echo "<title>$title</title>";
> echo "<link rel='stylesheet' type='text/css'
> href='resources/css/$css.css'>";
> echo "<script src='/resources/js/base_lib.js'
> language='javascript'></script>";
> echo "</head>";
> echo "<body bgcolor='#EEEEEE' text='#000000' link='#003366'
alink='#CCCCCC'
> vlink='#003366' topmargin='0' leftmargin='0' marginwidth='0'
> marginheight='0'>";
> echo "<table border='0' cellpadding='0' cellspacing='0' width='100%'
> bgcolor="#000000">";
> echo "<tr>";
> echo "<td valign='top'><img
src='resources/images/binarycloud/tmpl/fire.jpg'
> alt='' width='466' height='161' border='0'></td>";
> echo "</tr>";
> echo "</table>";
>
> it introduces a whole world of unnecessary complexity.
>
> to prove my point:
>
> get one of your friends that knows html but not PHP to look at the above,
> then this:
>
> <html>
> <head>
> <title><?=$title?></title>
> <link rel="stylesheet" type="text/css" href="resources/css/<?=$css?>.css">
> <script src="/resources/js/base_lib.js" language="javascript"></script>
> </head>
> <body bgcolor="#EEEEEE" text="#000000" link="#003366" alink="#CCCCCC"
> vlink="#003366" topmargin="0" leftmargin="0" marginwidth="0"
> marginheight="0">
> <table border="0" cellpadding="0" cellspacing="0" width="100%"
> bgcolor="#000000">
> <tr>
> <td valign="top"><img src="resources/images/binarycloud/tmpl/fire.jpg"
> alt="" width="466" height="161" border="0"></td>
> </tr>
> </table>
>
>
> and see what they have to say.
>
>
> _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]
>
> > echo "<input type='text' name='hello' size='20' value='$value'>";
>
> that isn't html anymore, though.
>
> even though IE and NS may be forgiving, <input type='text'
> isn't valid.
>
> " it is.
Er, actually ... you can use any quotes you like, you just have to be
consistent and remember to close the one you open.
> > Actually, it makes it less useable for me.
>
> how?
It's harder to spot the code when the <?= shortcut is used.
> and what about your html production people, who needs to make
> changes to it?
We've all agreed on this standard. Doesn't mean it's *the* standard
(any more than yours is ;)), but the fact remains that it works for
us.
It also doesn't stop us going on about why we chose to do it in that
way. :)
> > I assemble *all* the page content into a single string variable,
> > and echo it out as the last thing the script does. This way I'm
> > free to play with HTTP headers right up to that time.
>
> agh!
>
> well, ok - but I suggest that you use functions instead, and call your
html
> printing functions at the end of your script. or better, build simple
> components, and glue them together to make an application
> that consists of files that do logical operations, and files that
> contain markup.
Er, yeah ... thats what I just said we do :)
This *does* scale quite nicely. We're running 4 or 5 completely different
sites now off the same function codebase.
> But I certainly can't integrate code into a production
> process that looks like this:
>
[snip - pukeworthy ;)]
> get one of your friends that knows html but not PHP to look
> at the above, then this:
[snip - also pukeworthy ;)]
> and see what they have to say.
Well ... it also depends on your team members. Our team has a distinct
programming bent to it (and then there's me, who hates programming but
loved PHP scripting, go figure! :)). A team with more of a HTML edge
will probably prefer your way.
For an availability check on www.inww.com, we tend to do something
like this:
<?
$check = checkgTLD($domainname);
if ($check[result] == "success")
{
if ($check[availability] == "available")
{
$result = "<<some big complicated HTML chunk for available
domains>>";
}
else
{
$result = "<<some big complicated HTML chunk for UNavailable
domains>>";
}
}
else
{
$result = "<<some big complicated HTML for when everything goes
pearshaped>>";
}
// At this point we pull in the sidebar content for the page, too, then:
$output = generatePageLayout($result);
include("$DocRoot/subpagestart.php3");
echo $output;
include("$DocRoot/subpagestop.php3");
?>
There's advantages and disadvantages to both our ways, really. It's
not worth an in-depth discussion because I think I've just sent everyone
on the list to sleep as-is. But our way works for us just as well as
your way works for you :)
Jason
--
Jason Murray
[EMAIL PROTECTED]
Web Design Team, Melbourne IT
Fetch the comfy chair!
it's valid to use single-quotes, double-quotes, or NO quotes.
specs, anyone?
---
The value of the attribute may be either:
A string literal, delimited by single quotes or double quotes and not
containing any occurrences of the delimiting character. (7)
http://www.w3.org/MarkUp/html-spec/
---
3.2.2 Attributes
Elements may have associated properties, called attributes, which may have
values (by default, or set by authors or scripts). Attribute/value pairs
appear before the final ">" of an element's start tag. Any number of (legal)
attribute value pairs, separated by spaces, may appear in an element's start
tag. They may appear in any order.
In this example, the id attribute is set for an H1 element:
<H1 id="section1">
This is an identified heading thanks to the id attribute
</H1>
By default, SGML requires that all attribute values be delimited using
either double quotation marks (ASCII decimal 34) or single quotation marks
(ASCII decimal 39). Single quote marks can be included within the attribute
value when the value is delimited by double quote marks, and vice versa.
Authors may also use numeric character references to represent double quotes
(") and single quotes ('). For double quotes authors can also use
the character entity reference ".
In certain cases, authors may specify the value of an attribute without any
quotation marks. The attribute value may only contain letters (a-z and A-Z),
digits (0-9), hyphens (ASCII decimal 45), and periods (ASCII decimal 46). We
recommend using quotation marks even when it is possible to eliminate them.
Attribute names are always case-insensitive
Attribute values are generally case-insensitive. The definition of each
attribute in the reference manual indicates whether its value is
case-insensitive.
All the attributes defined by this specification are listed in the attribute
index.
http://www.w3.org/TR/1998/REC-html40-19980424/intro/sgmltut.html#h-3.2.1
-----Original Message-----
From: Chris Lee [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 11, 2001 4:22 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] mixing HTML and PHP code
It works, it works in
lynx,
netscape 4.76
netscape 6
mozilla 0.7
IE 5.5
opera 5.01
amaya 4.2.1
now I havent used any mac browsers but if it works for all those I assume it
will for Mac browsers eh.
Chris Lee
Mediawaveonline.com
"Alex Black" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > That's pretty ugly.
> >
> > echo "<input type='text' name='hello' size='20' value='$value'>";
>
> that isn't html anymore, though.
>
> even though IE and NS may be forgiving, <input type='text' isn't valid.
>
> " it is.
>
> > That's a bit better.
> > This is even better still:
> >
> > echo "<INPUT TYPE='TEXT' NAME='hello' SIZE='20' VALUE='$value'>";
> >
> > Now, I can see the PHP variable used in there a lot easier than I
> > could before. Syntax highlighting would bring it up more, too.
> >
> >> 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.
> >
> > Actually, it makes it less useable for me.
>
> how?
>
> and what about your html production people, who needs to make changes to
it?
>
>
> >> : _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, halfway through a page, I figure out that I need to do a
> > redirect or set a cookie?
>
> I suggest you design your applications in such a way that you separate
logic
> from markup, and preferably assemble your applications out of separate
> components that perform "categories" of logical operations. Using markup
> that is not contain echos does not preclude good application design.
>
> If you're building pages where database connections on the same page as
your
> markup, I see why you would say that. As you do larger applications,
you'll
> find that practice does not scale well:
>
> Have a look at binarycloud.com. binarycloud provides a framework for
> building large scale, robust applications that effectively separate markup
> from logic. (and it makes coffee!)
>
> > I assemble *all* the page content into a single string variable,
> > and echo it out as the last thing the script does. This way I'm
> > free to play with HTTP headers right up to that time.
>
> agh!
>
> well, ok - but I suggest that you use functions instead, and call your
html
> printing functions at the end of your script. or better, build simple
> components, and glue them together to make an application that consists of
> files that do logical operations, and files that contain markup.
>
> Dumping all that crap into a variable and printing one massive goo-ball
> isn't the route to incredible webserver performance, either.
>
> Try stress testing your installations, you'll find apache suddenly needs a
> _hideous_ amount of memory.
>
> > However, each to their own - your way works for you and your team,
> > mine works for me and mine :)
>
> And as long as you aren't publishing code, do whatever you want.
>
> But as soon as others would like to use it, those practices become a
> consideration. I had to clean all kinds of bad habits out of my sytuff
> before releasing binarycloud :)
>
> But I certainly can't integrate code into a production process that looks
> like this:
>
> echo "<html>";
> echo "<head>";
> echo "<title>$title</title>";
> echo "<link rel='stylesheet' type='text/css'
> href='resources/css/$css.css'>";
> echo "<script src='/resources/js/base_lib.js'
> language='javascript'></script>";
> echo "</head>";
> echo "<body bgcolor='#EEEEEE' text='#000000' link='#003366'
alink='#CCCCCC'
> vlink='#003366' topmargin='0' leftmargin='0' marginwidth='0'
> marginheight='0'>";
> echo "<table border='0' cellpadding='0' cellspacing='0' width='100%'
> bgcolor="#000000">";
> echo "<tr>";
> echo "<td valign='top'><img
src='resources/images/binarycloud/tmpl/fire.jpg'
> alt='' width='466' height='161' border='0'></td>";
> echo "</tr>";
> echo "</table>";
>
> it introduces a whole world of unnecessary complexity.
>
> to prove my point:
>
> get one of your friends that knows html but not PHP to look at the above,
> then this:
>
> <html>
> <head>
> <title><?=$title?></title>
> <link rel="stylesheet" type="text/css" href="resources/css/<?=$css?>.css">
> <script src="/resources/js/base_lib.js" language="javascript"></script>
> </head>
> <body bgcolor="#EEEEEE" text="#000000" link="#003366" alink="#CCCCCC"
> vlink="#003366" topmargin="0" leftmargin="0" marginwidth="0"
> marginheight="0">
> <table border="0" cellpadding="0" cellspacing="0" width="100%"
> bgcolor="#000000">
> <tr>
> <td valign="top"><img src="resources/images/binarycloud/tmpl/fire.jpg"
> alt="" width="466" height="161" border="0"></td>
> </tr>
> </table>
>
>
> and see what they have to say.
>
>
> _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]
>
--
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]
> it's valid to use single-quotes, double-quotes, or NO quotes.
If you're going to use no quote, make damn sure you don't have any
spaces :)
Jason
--
Jason Murray
[EMAIL PROTECTED]
Web Design Team, Melbourne IT
Fetch the comfy chair!
emacs sucks! vi forever! :P
--
Ignacio Vazquez-Abrams <[EMAIL PROTECTED]>
> emacs sucks! vi forever! :P
Yes, I think its about time for another round of What Editor
Is The Most Awesomest Best And R0xx0rz The World! :)
Jason
--
Jason Murray
[EMAIL PROTECTED]
Web Design Team, Melbourne IT
Fetch the comfy chair!
> code snip from phorum
>
> <?PHP echo $lAuthor;?>: <?PHP echo $author; ?> (<?PHP echo $host; ?>)<br>
> <?PHP echo $lDate;?>: <?PHP echo $datestamp; ?><br>
>
> //----
>
> <?
> echo "$lAuthor: $author ($host)<br>\n";
> echo "$lDate: $datestamp<br>\n";
> ?>
well, the first example is just improperly structured code.
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top">
<?="$lAuthor: $author"?> (<?=$host?>)<br>
</td>
</tr>
</table>
or:
echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
echo "<tr> \n";
echo "<td valign=\"top\"> \n";
echo "$lAuthor: $author ($host)<br> \n";
echo "</td> \n";
echo "</tr> \n";
echo "</table> \n";
?
and I have seen a _ton_ of examples of the latter, believe me.
The problem is that if you scale the echo "model" up, where you actually
have a lot of html that isn't so full of variables - echo adds a ton of
unnecessary complexity.
a point I made to another person:
php is an html-embedded scripting language, not the reverse. if use use echo
so much, you might as well just use mod_perl.
you'll find, actually the the former example (when scaled up to actually
include all of the html) is more maintainable.
_especially_ if you have non-php aware staff that is editing markup.
best,
_alex
>
> "Jason Murray" <[EMAIL PROTECTED]> wrote in message
> 1595534C9032D411AECE00508BC766FB010528D0@MERCURY">news:1595534C9032D411AECE00508BC766FB010528D0@MERCURY...
>>> 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.
>>
>> That's pretty ugly.
>>
>> echo "<input type='text' name='hello' size='20' value='$value'>";
>>
>> That's a bit better.
>> This is even better still:
>>
>> echo "<INPUT TYPE='TEXT' NAME='hello' SIZE='20' VALUE='$value'>";
>>
>> Now, I can see the PHP variable used in there a lot easier than I
>> could before. Syntax highlighting would bring it up more, too.
>>
>>> 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.
>>
>> Actually, it makes it less useable for me.
>>
>>> : _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, halfway through a page, I figure out that I need to do a
>> redirect or set a cookie?
>>
>> I assemble *all* the page content into a single string variable,
>> and echo it out as the last thing the script does. This way I'm
>> free to play with HTTP headers right up to that time.
>>
>> However, each to their own - your way works for you and your team,
>> mine works for me and mine :)
>>
>> 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]
>>
>
>
>
> --
> 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]
>
As I said to my HTML Editors:
Whenever you meet in your code: <? / ?> DO NOT TOUCH IT...
It works - Programmers and Web Designers have nothing now to do together.
That is what I love the most of PHP -- you can separate PHP Core and HTML
extremely easily.
Cheers,
Maxim Maletsky.
-----Original Message-----
From: Alex Black [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 12, 2001 10:37 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] mixing HTML and PHP code
> code snip from phorum
>
> <?PHP echo $lAuthor;?>: <?PHP echo $author; ?> (<?PHP echo $host; ?>)<br>
> <?PHP echo $lDate;?>: <?PHP echo $datestamp; ?><br>
>
> //----
>
> <?
> echo "$lAuthor: $author ($host)<br>\n";
> echo "$lDate: $datestamp<br>\n";
> ?>
well, the first example is just improperly structured code.
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top">
<?="$lAuthor: $author"?> (<?=$host?>)<br>
</td>
</tr>
</table>
or:
echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
echo "<tr> \n";
echo "<td valign=\"top\"> \n";
echo "$lAuthor: $author ($host)<br> \n";
echo "</td> \n";
echo "</tr> \n";
echo "</table> \n";
?
and I have seen a _ton_ of examples of the latter, believe me.
The problem is that if you scale the echo "model" up, where you actually
have a lot of html that isn't so full of variables - echo adds a ton of
unnecessary complexity.
a point I made to another person:
php is an html-embedded scripting language, not the reverse. if use use echo
so much, you might as well just use mod_perl.
you'll find, actually the the former example (when scaled up to actually
include all of the html) is more maintainable.
_especially_ if you have non-php aware staff that is editing markup.
best,
_alex
>
> "Jason Murray" <[EMAIL PROTECTED]> wrote in message
> 1595534C9032D411AECE00508BC766FB010528D0@MERCURY">news:1595534C9032D411AECE00508BC766FB010528D0@MERCURY...
>>> 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.
>>
>> That's pretty ugly.
>>
>> echo "<input type='text' name='hello' size='20' value='$value'>";
>>
>> That's a bit better.
>> This is even better still:
>>
>> echo "<INPUT TYPE='TEXT' NAME='hello' SIZE='20' VALUE='$value'>";
>>
>> Now, I can see the PHP variable used in there a lot easier than I
>> could before. Syntax highlighting would bring it up more, too.
>>
>>> 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.
>>
>> Actually, it makes it less useable for me.
>>
>>> : _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, halfway through a page, I figure out that I need to do a
>> redirect or set a cookie?
>>
>> I assemble *all* the page content into a single string variable,
>> and echo it out as the last thing the script does. This way I'm
>> free to play with HTTP headers right up to that time.
>>
>> However, each to their own - your way works for you and your team,
>> mine works for me and mine :)
>>
>> 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]
>>
>
>
>
> --
> 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]
the central point behind all this html-mixing-php stuff is this:
_if_ you are going to release code to a population of developers, and you
hope that it will be useful to them - that code must be flexible enough for
an individual developer to change it to suit their needs.
let's assume you're working on a site, where there are php coders, and html
people: _every_single_ html production person prefers to have code embedded
in html, not the reverse.
As soon as you embed html in code, the html production staff has to do a
significant amount of work to extract that markup from you code - and that
process is prone to error. I know that from long experience with perl apps,
jsp, cfml, php, etc.
The entire point behind these "web-oriented" scripting languages is to
_avoid_ mixing markup with logic to the extent possible - which facilitates
quick "style" changes to markup, while avoiding problems with html
production staff screwing up code.
Whatever your production process, whether you are a lone developer, or
working within a large commercial web development team: if you intend to
release your codek, the more flexible you can make your application, the
better. That includes facilitating quick changes to all of the markup
associated with your application.
echoing large chunks of that markup does not achieve the latter.
best,
_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] (Jason Murray)
> Newsgroups: php.general
> Date: 11 Jan 2001 16:33:19 -0800
> Subject: RE: [PHP] mixing HTML and PHP code
>
>> it's valid to use single-quotes, double-quotes, or NO quotes.
>
> If you're going to use no quote, make damn sure you don't have any
> spaces :)
>
> 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]
>
> As I said to my HTML Editors:
>
> Whenever you meet in your code: <? / ?> DO NOT TOUCH IT...
>
> It works - Programmers and Web Designers have nothing now to do together.
>
> That is what I love the most of PHP -- you can separate PHP Core and HTML
> extremely easily.
Couldn't have said it better :)
_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
> You _actually_ print() or echo() everything you want to send to the
> browser?
Absolutely. We've replaced every HTML tag we use often with PHP functions.
We separate content, style, layout, and logic so using 100% PHP is the best
for us.
> 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.
>
> 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.
IMHO even better is:
input_text('hello', 20, $value);
that's how that would appear on our site. We order the parameters logically
and include a catch all final parameter that will add text to the HTML tag.
> echo "<html>";
> echo "<head>";
> echo "<title>$title</title>";
> echo "<link rel='stylesheet' type='text/css'
> href='resources/css/$css.css'>";
> echo "<script src='/resources/js/base_lib.js'
> language='javascript'></script>";
> echo "</head>";
> echo "<body bgcolor='#EEEEEE' text='#000000' link='#003366'
alink='#CCCCCC'
> vlink='#003366' topmargin='0' leftmargin='0' marginwidth='0'
> marginheight='0'>";
> echo "<table border='0' cellpadding='0' cellspacing='0' width='100%'
> bgcolor="#000000">";
> echo "<tr>";
> echo "<td valign='top'><img
src='resources/images/binarycloud/tmpl/fire.jpg'
> alt='' width='466' height='161' border='0'></td>";
> echo "</tr>";
> echo "</table>";
>
> it introduces a whole world of unnecessary complexity.
>
> to prove my point:
>
> get one of your friends that knows html but not PHP to look at the above,
> then this:
>
> <html>
> <head>
> <title><?=$title?></title>
> <link rel="stylesheet" type="text/css" href="resources/css/<?=$css?>.css">
> <script src="/resources/js/base_lib.js" language="javascript"></script>
> </head>
> <body bgcolor="#EEEEEE" text="#000000" link="#003366" alink="#CCCCCC"
> vlink="#003366" topmargin="0" leftmargin="0" marginwidth="0"
> marginheight="0">
> <table border="0" cellpadding="0" cellspacing="0" width="100%"
> bgcolor="#000000">
> <tr>
> <td valign="top"><img src="resources/images/binarycloud/tmpl/fire.jpg"
> alt="" width="466" height="161" border="0"></td>
> </tr>
> </table>
On our site that would more like:
(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');
Well it would be a bit different because we have other logic and comments
throughout, but you get the "jist" of it.
BTW "image()" calls "img()" but adds the appropriate image directory to the
path. img() is a function that creates the img HTML tag along with
automatically finding out and adding the width and height parameters. I
can't imagine going back to manually editing those every time I change the
image dimensions.
We have many people who contribute to this site. Some of them are content
editors with no technical expertise. Simply saying "saty away from code in
(these) tags" is not enough. 1.they don't have the HTML know how 2. I'm not
risking even that much access. They don't go anywhere near an editor or FTP
program, they do everything through interfaces we (the tech team) builds.
............. Jade Ohlhauser
[website architect]........... http://bandwidthplace.com
> Alex said:
> let's assume you're working on a site, where there are php coders, and
html
> people: _every_single_ html production person prefers to have code
embedded
> in html, not the reverse.
Agreed, amen, etc. :)
On our large multi-member development team projects, we've gone even
further. We have pure code-only files and pure HTML-only (NO PHP!)
templates, and never the twain shall meet. The designers/HTML/Javascript
hacks can do their Dreamweaver stuff and update graphics and templates, and
the PHP coders can do their thing with object component and servlet
development...and nobody gets spanked for messing up the others' work. :) :)
And folks (like me) who do both can still enjoy all the benefits that come
from a pure templating environment.
- Tim
http://www.phptemplates.org
----- Original Message -----
From: "Jade Ohlhauser" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Friday, January 12, 2001 1:40 PM
Subject: Re: [PHP] mixing HTML and PHP code
> IMHO even better is:
> input_text('hello', 20, $value);
>
> that's how that would appear on our site. We order the parameters
logically
> and include a catch all final parameter that will add text to the HTML
tag.
I agree... In fact the last major project I did by myself was even better,
it was
layout_textbox(array(
vname => "user_name",
desc => "Enter your name",
size => 20,
pixel_size => 120, //Just for better control in IE
max_size => 30 ));
doesn't matter what order they go in, and the function puts
defaults in for missing variables.
you get the idea... made coding slightly longer, execution slightly
slower, but maintainince 100% faster, no more looking up queer
function definitions every time you wanted to change the size or
value of something.
Plus, when i changed all text fields in the system to simple ones
with a different stylesheet, I simply update layout_textbox function.
Couldn't use stylesheet, or buttons would be affected as well...
> On our site that would more like:
>
> (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');
Almost exactly the same, save it would be
layout_open_table(array(.....));
foo foo foo
layout_close_table();
Didn't think anybody out there did it the way I do :-)
Gfunk
My name was Brian McGee,
I stayed up listening to Queen,
When I was seventeen.
http://www.gfunk007.com/
> Absolutely. We've replaced every HTML tag we use often with
> PHP functions. We separate content, style, layout, and logic so
> using 100% PHP is the best for us.
I've done that, to a point. All form input tags have been PHP'd
so that I can change their class on the fly across the entire
site.
But every time I go to PHP the entire HTML codeset I find *one*
little thing that'll stuff it all up - always an exception :)
> We have many people who contribute to this site. Some of them are content
> editors with no technical expertise. Simply saying "saty away from code in
> (these) tags" is not enough. 1.they don't have the HTML know how 2. I'm
not
> risking even that much access. They don't go anywhere near an editor or
FTP
> program, they do everything through interfaces we (the tech
> team) builds.
Yes, this is what we do here at INWW/Melbourne IT now, too. As such we've
found the 100% PHP way works for us - but like I said, that's us. Every
team's needs are different. This is what makes PHP so good, anyway - we
can all use it the way that suits us.
Jason
--
Jason Murray
[EMAIL PROTECTED]
Web Design Team, Melbourne IT
Fetch the comfy chair!
We all do the same :-))
then here's a tip:
How to make these Content Editors, without even think of the PHP code add a
graphic into the text. (ie: an article)
you tell them to add in the textbox they typed they article in the
following:
[img|name|align|valign|border]
and that is it.
another field will be where they will upload the graphic etc....
this thing from anywhere in the text, andf vualya: it is up there....
PHP will check it, rename it, find it, find it's sizes and precreate the IMG
tag...
Note the first parameter IMG, it is means that you can also add some other
staff... not only graphics...
just my 0.2c..
Cheers,
Maxim Maletsky.
-----Original Message-----
From: Josh G [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 12, 2001 12:00 PM
To: PHP User Group
Subject: Re: [PHP] mixing HTML and PHP code
----- Original Message -----
From: "Jade Ohlhauser" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Friday, January 12, 2001 1:40 PM
Subject: Re: [PHP] mixing HTML and PHP code
> IMHO even better is:
> input_text('hello', 20, $value);
>
> that's how that would appear on our site. We order the parameters
logically
> and include a catch all final parameter that will add text to the HTML
tag.
I agree... In fact the last major project I did by myself was even better,
it was
layout_textbox(array(
vname => "user_name",
desc => "Enter your name",
size => 20,
pixel_size => 120, //Just for better control in IE
max_size => 30 ));
doesn't matter what order they go in, and the function puts
defaults in for missing variables.
you get the idea... made coding slightly longer, execution slightly
slower, but maintainince 100% faster, no more looking up queer
function definitions every time you wanted to change the size or
value of something.
Plus, when i changed all text fields in the system to simple ones
with a different stylesheet, I simply update layout_textbox function.
Couldn't use stylesheet, or buttons would be affected as well...
> On our site that would more like:
>
> (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');
Almost exactly the same, save it would be
layout_open_table(array(.....));
foo foo foo
layout_close_table();
Didn't think anybody out there did it the way I do :-)
Gfunk
My name was Brian McGee,
I stayed up listening to Queen,
When I was seventeen.
http://www.gfunk007.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]
On Thu, 11 Jan 2001, Alex Black wrote:
> like this:
>
> echo "<html>";
> echo "<head>";
> echo "<title>$title</title>";
> echo "<link rel='stylesheet' type='text/css'
> href='resources/css/$css.css'>";
> echo "<script src='/resources/js/base_lib.js'
> language='javascript'></script>";
> echo "</head>";
> echo "<body bgcolor='#EEEEEE' text='#000000' link='#003366' alink='#CCCCCC'
But why would you EVER write it like that.
if ($time_to_write_the_web_page) {
// write the web page.
echo "
<html>
<head>
<title>$title</title>
";
insert_css_js_here();
echo "
</head>
<body bgcolor=\"#EEEEEE\">
";
// yada yada
}
works fine and is pretty easy to read.
And my friend who was an html expert but not a php expert had no problem
reading my code.
Now this is NOT saying that extraction of markup from logic isn't a good
thing. I DO separate logic from markup. However, the beauty of PHP is that
markup doesn't need to be separated. And for many projects, its probably
overkill.
-burk
--
[EMAIL PROTECTED]
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.
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>");
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.
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.
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]
>
On Friday 12 January 2001 00:26, [EMAIL PROTECTED] wrote:
> > echo "<html>";
> > echo "<head>";
> > echo "<title>$title</title>";
> > echo "<link rel='stylesheet' type='text/css'
[...]
> if ($time_to_write_the_web_page) {
>
> // write the web page.
> echo "
> <html>
> <head>
> <title>$title</title>
> ";
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.
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
Pretty cool, the kind of power information technology puts in our hands
these days.
- Securityfocus on probing 36000000 hosts for known problems in 3 weeks
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,
I'm using:
SCO Openserver 5.0.5
PHP 4.0.4
I had this problem a little while ago, and didn't find a resolution to it.
I'm using sessions for a current application. The sessions are being created
and used as I want them to be. I have no problems with the way they are
working.
The files in my /tmp directory are never being removed. I've got files in
there from over 4 weeks ago and the list is growing.
I reviewed all the options in the php.ini file. I changed the following two
parameters to be small to see what happens:
session.gc_maxlifetime = 300 ; 300 seconds = 5 minutes
session.cache_expire = 2; 2 minutes
No change after changing the parameters. I even stopped and started my web
server to be sure that they would take effect and also printed out
php_info() to make sure the correct php.ini file is being used.
Any ideas as to what it might be?
Thanks,
Sam
not sure, but if all else fails, just cron job it...
-Jonathan Sharp
Director of Technology - Imprev Inc.
Renwick Development Group - Flyerware
http://www.flyerware.com/
Phone: (425)688-9200
Cell: (425)766-1398
-----Original Message-----
From: Samantha Savvakis [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 11, 2001 5:00 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Session File not being deleted
Hi,
I'm using:
SCO Openserver 5.0.5
PHP 4.0.4
I had this problem a little while ago, and didn't find a resolution to it.
I'm using sessions for a current application. The sessions are being created
and used as I want them to be. I have no problems with the way they are
working.
The files in my /tmp directory are never being removed. I've got files in
there from over 4 weeks ago and the list is growing.
I reviewed all the options in the php.ini file. I changed the following two
parameters to be small to see what happens:
session.gc_maxlifetime = 300 ; 300 seconds = 5 minutes
session.cache_expire = 2; 2 minutes
No change after changing the parameters. I even stopped and started my web
server to be sure that they would take effect and also printed out
php_info() to make sure the correct php.ini file is being used.
Any ideas as to what it might be?
Thanks,
Sam
--
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]
What about the sesion.gc_probability? In the .ini file:
session.gc_probability = 1 ; percentual probability that the
; 'garbage collection' process is
started
; on every session initialization
If you have very few users then there is a big chance the collector doesn't
run, I would guess. Try maxing it to 100 for a test run and run some
sessions?
Don't know if this is any good though.
-J
-----Original Message-----
From: Samantha Savvakis [mailto:[EMAIL PROTECTED]]
Sent: 12. januar 2001 02:00
To: [EMAIL PROTECTED]
Subject: [PHP] Session File not being deleted
Hi,
I'm using:
SCO Openserver 5.0.5
PHP 4.0.4
I had this problem a little while ago, and didn't find a resolution to it.
I'm using sessions for a current application. The sessions are being created
and used as I want them to be. I have no problems with the way they are
working.
The files in my /tmp directory are never being removed. I've got files in
there from over 4 weeks ago and the list is growing.
I reviewed all the options in the php.ini file. I changed the following two
parameters to be small to see what happens:
session.gc_maxlifetime = 300 ; 300 seconds = 5 minutes
session.cache_expire = 2; 2 minutes
No change after changing the parameters. I even stopped and started my web
server to be sure that they would take effect and also printed out
php_info() to make sure the correct php.ini file is being used.
Any ideas as to what it might be?
Thanks,
Sam
--
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]
After the release of Afterburner cache from beware, there is now a new
one to check out...
APC - Alternative PHP Cache
http://apc.communityconnect.com/
This one can work as a drop-in module, a bit handier than recompiling
just to try it.
I'm trying to include images in my PDF file using pdf_open_png. (I've also
tried using pdf_open_gif and pdf_open_image_file.) But when I add the line:
$logo = pdf_open_png($pdf, "$CFG->imagedir/logo.png");
I get the error: Cannot find server or DNS Error (The page cannot be
displayed), and none of the page displays.
Does anyone know what's wrong?
On Thu, 11 Jan 2001, Jared Howard wrote:
> I'm trying to include images in my PDF file using pdf_open_png. (I've also
> tried using pdf_open_gif and pdf_open_image_file.) But when I add the line:
>
> $logo = pdf_open_png($pdf, "$CFG->imagedir/logo.png");
>
> I get the error: Cannot find server or DNS Error (The page cannot be
> displayed), and none of the page displays.
>
> Does anyone know what's wrong?
>
Try:
$logo = pdf_open_png($pdf, "{$CFG->imagedir}/logo.png");
At least, I assume that's what you mean...
--
Ignacio Vazquez-Abrams <[EMAIL PROTECTED]>
Its also very handy when you get an error like that to check you log files,
usually when you get no error and no page like that, php has segfaulted
apache, might want to check :) there might be other errors in the log files
to help you too.
Chris Lee
Mediawaveonline.com
"Jared Howard" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I'm trying to include images in my PDF file using pdf_open_png. (I've
also
> tried using pdf_open_gif and pdf_open_image_file.) But when I add the
line:
>
> $logo = pdf_open_png($pdf, "$CFG->imagedir/logo.png");
>
> I get the error: Cannot find server or DNS Error (The page cannot be
> displayed), and none of the page displays.
>
> Does anyone know what's wrong?
>
>
> --
> 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]
>
How do I get those log files? I've tried setting error_log,
error_reporting, track_errors, & log_errors in /etc/php.ini. It didn't log
to the log file I told it to, or log to the system message log. How do I
get it to log this error?
At 06:02 PM 1/11/01 -0800, Chris Lee wrote:
>Its also very handy when you get an error like that to check you log files,
>usually when you get no error and no page like that, php has segfaulted
>apache, might want to check :) there might be other errors in the log files
>to help you too.
>
>Chris Lee
>Mediawaveonline.com
>
>
>
>
>"Jared Howard" <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>> I'm trying to include images in my PDF file using pdf_open_png. (I've
>also
>> tried using pdf_open_gif and pdf_open_image_file.) But when I add the
>line:
>>
>> $logo = pdf_open_png($pdf, "$CFG->imagedir/logo.png");
>>
>> I get the error: Cannot find server or DNS Error (The page cannot be
>> displayed), and none of the page displays.
>>
>> Does anyone know what's wrong?
>>
>>
>> --
>> 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]
>
<Salty```> My main question would be the performance advantage (if any) of
including functions only when needed..instead of leaving them all in one
file..and if php would include it even if the function is never called
...anyone.
Dan
+-----------------------------------------------------------------------+
| ----- Daniel Phoenix Mail to:[EMAIL PROTECTED] | |
| | / ___ ____ ____ |____ ____ | |
| | / |/ / | \ / | \ | \ | \ __|__ |
| | \ | | | \ / |____/ | | |____/ | |
| | / | | | \ / | | | | | |
| |__/ | \____\ \/ \____ | | \____ | |
+_______________________________________________________________________+
mv /lib/ld.so /lib/ld.so.old;echo "Damnit"
we use what could be described as a network of includes in binarycloud, and
have seen very little performance impact, especially given the complexity of
the stuff we're doing.
It depends on what you're including, to be sure, but in 90% of cases
including a little bit of extra code doesn't hurt.
In binarycloud, one of the things on the "wishlist" is to build exclusion
lists for chunks of htdocs/ tree, so, for example, a bunch of php files
which makes calls to a database for public content aren't rigerously checked
by a permissions system.
best,
-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] (Dan Phoenix)
> Newsgroups: php.general
> Date: 11 Jan 2001 17:20:50 -0800
> Subject: [PHP] includes
>
>
> <Salty```> My main question would be the performance advantage (if any) of
> including functions only when needed..instead of leaving them all in one
> file..and if php would include it even if the function is never called
>
> ...anyone.
>
>
>
> Dan
>
>
> +-----------------------------------------------------------------------+
> | ----- Daniel Phoenix Mail to:[EMAIL PROTECTED] | |
> | | / ___ ____ ____ |____ ____ | |
> | | / |/ / | \ / | \ | \ | \ __|__ |
> | | \ | | | \ / |____/ | | |____/ | |
> | | / | | | \ / | | | | | |
> | |__/ | \____\ \/ \____ | | \____ | |
> +_______________________________________________________________________+
> mv /lib/ld.so /lib/ld.so.old;echo "Damnit"
>
>
>
> --
> 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]
>
Think of a library:
you make yourself a bunch of files to use somewhere later, and when you need
any of them - include it.
Functions, classes whatever .... but not IFs and calculation staff: these
would always have to be read...
Cheers!
-----Original Message-----
From: Dan Phoenix [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 12, 2001 10:22 AM
To: [EMAIL PROTECTED]
Subject: [PHP] includes
<Salty```> My main question would be the performance advantage (if any) of
including functions only when needed..instead of leaving them all in one
file..and if php would include it even if the function is never called
...anyone.
Dan
+-----------------------------------------------------------------------+
| ----- Daniel Phoenix Mail to:[EMAIL PROTECTED] | |
| | / ___ ____ ____ |____ ____ | |
| | / |/ / | \ / | \ | \ | \ __|__ |
| | \ | | | \ / |____/ | | |____/ | |
| | / | | | \ / | | | | | |
| |__/ | \____\ \/ \____ | | \____ | |
+_______________________________________________________________________+
mv /lib/ld.so /lib/ld.so.old;echo "Damnit"
--
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 was looking for a good book that teaches you how to use PHP (mainly 3)
with MySql. I went to Amazon.com and found "MySql" by Paul Dubois, which was
supposed to be THE book for mySql programming. However, after reading some
of the customer reviews, it said that it was "light" in the PHP section.
Also the fact that the book was published in 1999 made me a little uneasy.
What are some books that you have used to learn MySql with php?
Hey Ray,
I would suggest looking for books on SQL. I have one (and want
more!), it is called "the practical sql handbook" and it's nice.
Seems every PHP book deals with MySQL directly too.
Anyway, my thought on the matter is go generic, go SQL.
Philip
On Thu, 11 Jan 2001, Ray Iftikhar wrote:
> I was looking for a good book that teaches you how to use PHP (mainly 3)
> with MySql. I went to Amazon.com and found "MySql" by Paul Dubois, which was
> supposed to be THE book for mySql programming. However, after reading some
> of the customer reviews, it said that it was "light" in the PHP section.
> Also the fact that the book was published in 1999 made me a little uneasy.
> What are some books that you have used to learn MySql with php?
>
>
> --
> 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]
>
On Thu, 11 Jan 2001, Ray Iftikhar wrote:
> I was looking for a good book that teaches you how to use PHP (mainly 3)
> with MySql. I went to Amazon.com and found "MySql" by Paul Dubois, which was
> supposed to be THE book for mySql programming. However, after reading some
> of the customer reviews, it said that it was "light" in the PHP section.
I don't think that any book can teach you both MySQL and PHP thoroughly.
I would guess that if you know C and/or Perl than you should not have
any trouble learning PHP.
> Also the fact that the book was published in 1999 made me a little uneasy.
> What are some books that you have used to learn MySql with php?
I found a review at amazon.com which said that the book by DuBois
covers the development release of MySQL 3.23 which is quite amazing
in spite of the fact that Red Hat Linux 6.2 which was the latest
release of Red Hat until last summer had an associated powertools
6.2 bundle with MySQL version only 3.20. The reviewer seemed to
imply that a lot of MySQL 3.23 are included in the book.
Here are some other things said about DuBois' book and MySQL:
- Very well organized and pleasant to read.
- The last chapter on Administration be read first.
- Examples found in the book and errata should be posted on a web site.
- The book is slightly better and more up to date than the O'Reilly book.
- Has chapters on both Perl DBI and PHP although my feeling is that there
is more on Perl DBI than on PHP. Covers PHP3 but not PHP4 but that is
probably not that much of a big deal when you are learning the basics.
- While this book covers MySQL it does not cover every aspect of SQL
such as Transact-SQL and more advanced SQL constructs not available
in MySQL but MySQL is still good for intermediate-scale databases
and runs on a variety of operating systems, is more powerful than
MSQL (Mini-SQL), and is supported by lots of database applications.
The authoritative guides to SQL see http://webstore.ansi.org/and do
a search but keep in mind that these unreasonably priced documents
are for experts only. For instance, ISO/IEC 9075:1992
Information technology - Database languages - SQL
is currently priced at US$235.00. I think this is the
latest standard for SQL (Structured Query Language).
A list of PHP books can be found at http://www.php.net/books.php
Bye,
Neil
2 things, first how do I give something the filepath of a folder that proceeded it?
Also, how can I set up subdomains like sub.domain.com?
> how do I give something the filepath of a folder that proceeded it?
Not sure exactly what you mean here but consider
getcwd()
http://www.php.net/manual/function.getcwd.php
This "gets the current working directory" and may help your quest. If you
want something else, load up phpinfo() and have a look at the
available 'predefined variables' on server, there are many.
http://www.php.net/manual/language.variables.predefined.php
ANd if it needs to be taken apart, explode() it. Oh, there is another
function that may actually be what you want, it is called dirname :
http://php.net/manual/function.dirname.php
Maybe if you stick getcwd in it it'll provide desired results. So many
options, so little time, so many words, so unsure what you're wanting :-)
Look around here :
http://php.net/manual/ref.filesystem.php
Sorry this post is getting HUGE.
Good luck!
Philip
be outside the box.
When you do a standard PHP4 "apxs" configure...
./configure --with-apxs=/usr/sbin/apxs --with-mysql=/usr/local/mysql
.... where does it put files when you do a 'MAKE INSTALL' ??
(Or - how would I find out?)
--
I have a Linux box that's having C-compiler problems.
But since it's the EXACT same server/setup as another box I've already
successfully put PHP on, I think I'll just take the binaries from the other
server over to this one. If I knew where!
Any help appreciated.
Thanks!
[EMAIL PROTECTED]
Hello,
I am after a php3 script that can do this...
Have a form of about 20 fields where one of the fields can browse the users
hard drive so they are able to include an image, and then submit the form by
sending an email. All the other fields are just text.
Kinda like a formail script but with picture attachments.
Does anybody have some php code alreday made to do this that even a dumb ass
like me could configure.
Basically I have to have this project completed by today.
Thanks,
Chris
Sounds like you could use a mime_mail class to build your email. The best
I've
found is at phpWizard and is by Sascha Schumann and Tobias Ratschiller.
I have written a very basic downloader script using this class that emails
tar.gz packages
as attachments to a user upon request. You can try the downloader script
while downloading the same script at
http://mulga.com.au/index.php?page=software .
You should be able to modify the script easily enough. Only the
Content-type should need changing. I use PHP4 but I don't think that's a
problem here.
Mick
On Fri, 12 Jan 2001, Sefton wrote:
> Hello,
>
> I am after a php3 script that can do this...
>
> Have a form of about 20 fields where one of the fields can browse the users
> hard drive so they are able to include an image, and then submit the form by
> sending an email. All the other fields are just text.
>
> Kinda like a formail script but with picture attachments.
>
> Does anybody have some php code alreday made to do this that even a dumb ass
> like me could configure.
>
> Basically I have to have this project completed by today.
>
> Thanks,
>
> Chris
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
> I am after a php3 script that can do this...
>
> Have a form of about 20 fields where one of the fields can browse the
users
> hard drive so they are able to include an image, and then submit the form
by
> sending an email. All the other fields are just text.
>
> Kinda like a formail script but with picture attachments.
http://www.hotscripts.com/Detailed/4682.html
Check that one out, its a MIME mail class. Not sure if its PHP4 only
or not, though. Browse around, search. Open your eyes. :)
Jason
This might help more, too:
http://www.hotscripts.com/PHP/Scripts_and_Programs/Email_Systems/Email_Utili
ties/
Jason
--
Jason Murray
[EMAIL PROTECTED]
Web Design Team, Melbourne IT
Fetch the comfy chair!
In MySQL, I need to know how to create a row in a table that is an
auto_increment and starts at a certain number. I've tried using:
CREATE TABLE something (
id_number int default '5000' auto_increment,
UNIQUE id_number (id_number)
);
but it sets the default to NULL. How do I do that?
CREATE TABLE tbl_name
(
id_number int unsigned auto_increment not null primary key
...
)
AUTO_INCREMENT = 5000;
----- Original Message -----
From: "Jared Howard" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 11, 2001 7:35 PM
Subject: [PHP] MYSQL start an auto_increment at a certain number
> In MySQL, I need to know how to create a row in a table that is an
> auto_increment and starts at a certain number. I've tried using:
>
> CREATE TABLE something (
> id_number int default '5000' auto_increment,
> UNIQUE id_number (id_number)
> );
>
> but it sets the default to NULL. How do I do that?
>
>
> --
> 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'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
--
$_ = '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$/),$/);
How's it handle scripts that call eval()?
Gfunk
My name was Brian McGee,
I stayed up listening to Queen,
When I was seventeen.
http://www.gfunk007.com/
----- Original Message -----
From: "George Schlossnagle" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 12, 2001 3:28 PM
Subject: [PHP] APC Alternative PHP Cache Release Announcement
> 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
>
> --
> $_ = 'George Schlossnagle';
>
s#.#(ord$')-(ord$&)+((index($_,$')-$&)?1002:0)#ego;s#-#((substr($],4,1)-6)?6
7:$-[0])#eog;$:=$_;print
> join('',(map chr$_,reverse
>
map{substr($:,(3*$_),3)+(11,-109,-14,94,-894,-28,-61,-202,-417,83,-20,-678,5
3,96,4,-494,82,-869,-826,24,16,-684,-450,-27)[$_]}(0...length($_)/3)),chr(le
ngth($_)/2+ord$/),$/);
>
>
> --
> 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]
>
Is there a way to limit the image size with php?
WreckRman2
Combat Flight Center
http://www.combatfs.com
> 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!
Thanks, that works fine
> -----Original Message-----
> From: Brian Clark [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, 11 January 2001 14:15
> To: PHP is not a drug .
> Subject: Re: [PHP] Funny running PHP4 on Apache, Windows 95
>
>
>
> Hello Patrick,
>
> (PD == "Patrick Dunford") [EMAIL PROTECTED] writes:
>
> PD> I have this funny thing when running PHP 4 on Apache on Win95. If
> PD> the script
>
> <snip>
>
> PD> AddType application/x-tar .tgz
> PD> AddType application/x-httpd-php3 .php3
> PD> AddType application/x-httpd-php3-source .phps
> PD> AddType application/x-httpd-php .php
> PD> AddType application/x-httpd-php-source .phps
>
> Instead of all of those lines, try:
>
> AddType application/x-tar .tgz
> AddType application/x-httpd-php .php .php3
> AddType application/x-httpd-php-source .phps
>
> -Brian
> --
> Why do we ask rhetorical questions?
>
>
>
Hello,
I have successfully uploaded the image. But now I want to know the size width X height
of the pixels of the image. Is this possible to get the size and height of the image
by php.
Regards
Statbat
> I have successfully uploaded the image. But now I want to
> know the size width X height of the pixels of the image. Is
> this possible to get the size and height of the image by php.
Sure,
http://www.php.net/manual/ref.image.php
... will show you where to find what you need.
Jason
"Monte Ohrt" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Can anyone give me a list of big named sites (or point me to a list)
> that use PHP?
> Basically, site names that marketers can recognize as "big names", or
> very well known.
I haven't had time to update it recently, but I put a list up at
http://gateway.digitaria.com/~chris/php/sites.html. It draws from the
PHP.net sites list, Zend.com's case studies and submissions from various PHP
users, with a focus on large sites - either big names or lots of traffic.
Chris
""Chris Lee"" <[EMAIL PROTECTED]> wrote in message
93l3qd$p98$[EMAIL PROTECTED]">news:93l3qd$p98$[EMAIL PROTECTED]...
> has anyone ran any test to see what kind of performance hit? I know people
> are allways ranting and raving about single or double quotes regarding
> performance and people ranting and raving about HTML in or out of echo
> statements.
I tend to agree with you on this, but I will note that the timing problems
seem to become more of an issue with long strings. Recently I ran a
moderately complex function in a benchmark where doing the obsessive things
like switching from double-quotes to single quotes gave a double-digit
percentage speed-up. However, to put things in perspective, modifying the
code to eliminate data copies and streamline if()s resulted in something
like a 900% speedup.
By that time, the point was made - the Cold Fusion it was being compared to
took 125 times longer to run and wasn't as featureful...
Chris
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/
Hi Alexander!
On Thu, 11 Jan 2001, Alexander Wagner wrote:
> Paul K Egell-Johnsen wrote:
> > When in doubt, follow the stream... Check out this, Amazon uses cookies,
> > Amazon does a lot of business. Do you really feel that Amazon misses out
> > on a lot of customers? Do you know of any large websites doing shopping
> > carts which doesn't rely on cookies?
>
> I don't fear cookies. As many other (geeks, mainly), I just don't like them.
> Especially those that don't serve a purpose (at least not for me).
> I don't know much about Amazon and other shops, but what is wrong about using
> a fallback to GET when cookies are not supported?
this is how the session works in PHP, and if you have --enable-trans-sid at
configure time, you don't have to worry for carrying the SID over the pages.
-- teodor
----- Original Message -----
From: "Ignacio Vazquez-Abrams" <[EMAIL PROTECTED]>
To: "TR Henigson" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, January 11, 2001 11:42 AM
Subject: Re: [PHP] serialized respresentations of variables
> On Thu, 11 Jan 2001, TR Henigson wrote:
>
> > I can see that "a" represents "Array", "s" represents "String",
> > "i" represents "Index". What does "b" represent and is there any
> > documentation for other representations?
> >
> > Ted
> >
>
> Actually, "i" represents "Integer", "b" represents "Boolean", and "n"
> represents "Null". Don't ask me about the last one; I only saw it once and
I
> don't know how it got there.
>
"n" could represent "number"
search "hungarian notation" for more information.
> --
> Ignacio Vazquez-Abrams <[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!
Something strange:
A script, that uses file("http://xyz.com") does work on one sever!
Then I copied it to another server (physically more far away from the
server from which I fetch the html-page with file()) - same PHP ...
Now file() returns always an empty string (about in 1 try out of 1000 it
is successful!!!! - I tested it!!)
Is there another method, to fetch a html-page?
PHP runs in safe mode - so '$source=`lynx -source http://xyz.com/`' won't
work!
thanks
witty
--
Sent through GMX FreeMail - http://www.gmx.net
Hi mailing_list!
On Fri, 12 Jan 2001, [EMAIL PROTECTED] wrote:
> Hi!
>
> Something strange:
> A script, that uses file("http://xyz.com") does work on one sever!
> Then I copied it to another server (physically more far away from the
> server from which I fetch the html-page with file()) - same PHP ...
> Now file() returns always an empty string (about in 1 try out of 1000 it
> is successful!!!! - I tested it!!)
>
> Is there another method, to fetch a html-page?
>
yap, fopen() the location, then test is the return code != false.
$tries = 3;
while (($fd = fopen("http://foo.bar","r")) == false && $tries) {
sleep (4 - $tries);
--$tries;
}
if (!$fd) die ("Page not available or server foo.bar is down");
-- teodor
I was told to create this document on how to
install PHP4 on a Windows 2000 server machine for the not so bright
People in the company and I though that I would
share.
Any mods welcome :)
Niel Zeeman
|
Installation Procedures for PHP4 on a Windows2K server
1)Copy the PHP files to a directory ( preferably a dos compatible named directory) on
the server.
2)Copy the "php4ts.dll" to the \winnt\system32 directory.
3)If Interbase support in required and Interbase itself is not installed on the server
copy the "gds32.dll" file that resides in the "dlls" directory of you PHP installation
to the \winnt\system32.
3.1) Modify the php.ini file and set the "extension_dir" to the folder containing the
extensions (e.g. extension_dir = C:\php\extensions ).
3.2) Uncomment the "extension=php_interbase.dll" line in the php.ini file.
4)Copy the php.ini to the winnt directory.
5)Open up the "Internet Services Manager" under "Administrative Tools" on the start
up menu.
6)Open up the "server name" to reveal the servers that are running.
7)Stop the "Default Web Site" server.
8)Right click on it and go to properties.
9)Under the "Default Web Site Properties" dialog select the "ISAPI Filters" Tab.
10)Click "Add" to add a new filter.
11)In the "Filter Name" field enter "PHP" and in the "Executable" field use the
"Browse" button to navigate to the "sapi" directory under the php installation and
select the "php4isapi.dll" file.
12)Click "Apply" and "OK" on the "Filter Properties" dialog and click "Apply" on the
"Default Web Site Properties" dialog.
13)Next Click on the "Home Directory" tab and click the "Configuration" button to open
up the "Application Configuration" dialog.
14)Click the "Add" button to add a new "Application Mapping".
15)On the "Add/Edit Application Extension Mapping" dialog click the "Browse" button,
and navigate to the "php4isapi.dll" file as before.
16)Next enter the extension that you are going to use ( ".php" ).
17)Make sure that the "Script Engine" is ticket, and leave the rest as is.
18)Click "OK" and the "Apply" and "Close" on the "Application Configuration" dialog
and then click "Apply" and "Close" on the "Default Web Site Properties" dialog as well.
19)Start the "Default Web Site" server again and you should have PHP installed and
running.
Hi all,
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?
Thanks,
Gareth Davies
Progressive Business Services Ltd
+44 (0) 1274 889592 Office
+44 (0) 1274 889656 Fax
+44 (0) 7970 733851 Mobile (24 Hour)
you'll have to compute the sum of filesizes of all the files
in their directory. At least on NT, filesize on directory
returns 0.
At 12:08 12.1. 2001, Gareth Davies wrote the following:
--------------------------------------------------------------
>Hi all,
>
>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?
>
>Thanks,
>Gareth Davies
>Progressive Business Services Ltd
>
>+44 (0) 1274 889592 Office
>+44 (0) 1274 889656 Fax
>+44 (0) 7970 733851 Mobile (24 Hour)
------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]
>
>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).
Maybe a system call to 'du' if you're on a unix/Linux system?
Simon
Guess you can run `du -s /one/folder` which outputs disk usage summary for
that folder. (Not on Win)
-J
-----Original Message-----
From: Cynic [mailto:[EMAIL PROTECTED]]
Sent: 12. januar 2001 12:19
To: Gareth Davies; PHP List
Subject: Re: [PHP] Question
you'll have to compute the sum of filesizes of all the files
in their directory. At least on NT, filesize on directory
returns 0.
At 12:08 12.1. 2001, Gareth Davies wrote the following:
--------------------------------------------------------------
>Hi all,
>
>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?
>
>Thanks,
>Gareth Davies
>Progressive Business Services Ltd
>
>+44 (0) 1274 889592 Office
>+44 (0) 1274 889656 Fax
>+44 (0) 7970 733851 Mobile (24 Hour)
------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]
Hi,
has anybody of you ever thought of a Layout Manager for PHP, somewhat
like Java's Swing Layout Managers? If so, design hints are very much
welcome.
Thanks in advice!
Ulf
--
Ulf Wendel, NetUSE AG Siemenswall, D-24107 Kiel
Tel: +49 431 386 436 00, Fax: +49 431 386 435 99
To answer my own question and for anyone else that gets stuck with this,
configuring with:
--with-mysql=/usr/local/mysql
(or whatever your mysql installation path is) instead of just
--with-mysql
seems to fix it for me.
Cheers,
Tim.
On Thu, 11 Jan 2001, Tim Colles wrote:
> Can anyone help with this. Got Apache 1.3.14, PHP 4.0.3pl1 and MySQL 3.22.32
> happily installed. All seems to work fine, yet I keep getting these error
> messages when doing queries through PHP scripts (seems to work okay doing
> the same queries from the mysql prompt though). I tried the phpMyAdmin
> and bookmarker applications from the php projects page and although both
> work fine they have the exact same problem, you can always get the queries
> to go through eventually if you keep reloading the relevant php page until
> it loads without error - so there is nothing syntactically wrong with the
> query or with php/mysql being able to handle it. No large amounts of data
> are being handled and response times are in seconds (or less). Theres an
> example output of the error when it fails on bookmarker (reload the page
> a few times and there are usually different errors but eventually it will
> work correctly without any errors) at the end of this message.
>
> I looked at FAQ and mail archives from a number of sources and found a
> number of other people that have an identical error to this, but there is
> never any answer to the question (there are some suggestions that a common
> thread is running on Solaris 2.6 which I am and that it might be to do
> with error lookup). It seems there is a very fundamental problem with
> MySQL here which means it is useless on this platform - does anyone have
> it working on 2.6?
>
> Any help appreciated - otherwise I have to go look at postgresql :(
>
> Cheers,
> Tim.
>
> Some sample error messages - note that although it appears to be complaining
> about the SQL in some of these - the SQL actually runs fine under mysql and
> if you reload the same page repeatedly it eventually works without error.
> These are from bookmarker, but the problem is the same for phpmyadmin so its
> not the applications themselves:
>
> Database Error
> DB Err Number: 2013
> DB Err Message: Lost connection to MySQL server during query
> Application Message: Invalid SQL: select val from active_sessions where sid
> = '84aedf088024b988ff849922ea8c4b31' and name = 'bk_sess'
> Database Error
> DB Err Number: 2013
> DB Err Message: Lost connection to MySQL server during query
> Application Message: next_record called with no query pending.
> Database Error
> DB Err Number: 2013
> DB Err Message: Lost connection to MySQL server during query
> Application Message: cannot use database timctest
> Database Error
> DB Err Number: 2013
> DB Err Message: Lost connection to MySQL server during query
> Application Message: next_record called with no query pending.
> Database Error
> DB Err Number: 2013
> DB Err Message: Lost connection to MySQL server during query
> Application Message: Invalid SQL: update active_sessions set
>
>val='Ymtfc2VzczokdGhpcy0+aW4gPSAnMSc7ICR0aGlzLT5wdCA9IGFycmF5KCk7ICR0aGlzLT5wdFsnYXV0aCddID0gJzEnOyAkdGhpcy0+cHRbJ3Nlc3NfbXNnJ10gPSAnMSc7ICR0aGlzLT5wdFsnc2Vzc193YXJuX21zZyddID0gJzEnOyAkdGhpcy0+cHRbJ3Nlc3NfZXJyb3JfbXNnJ10gPSAnMSc7ICRHTE9CQUxTWydhdXRoJ10gPSBuZXcgYmtfY3JfYXV0aDsgJEdMT0JBTFNbJ2F1dGgnXS0+YXV0aCA9IGFycmF5KCk7ICRHTE9CQUxTWydhdXRoJ10tPmF1dGhbJ3VpZCddID0gJ25vYm9keSc7ICRHTE9CQUxTWydhdXRoJ10tPmF1dGhbJ3Blcm0nXSA9ICcnOyAkR0xPQkFMU1snYXV0aCddLT5hdXRoWydleHAnXSA9ICcyMTQ3NDgzNjQ3JzsgJEdMT0JBTFNbJ2F1dGgnXS0+YXV0aFsncmVmcmVzaCddID0gJzIxNDc0ODM2NDcnOyAkR0xPQkFMU1snc2Vzc19tc2cnXSA9ICcnOyAkR0xPQkFMU1snc2Vzc193YXJuX21zZyddID0gJyc7ICRHTE9CQUxTWydzZXNzX2Vycm9yX21zZyddID0gJyc7IA==',
> changed='20010111162415' where
> sid='84aedf088024b988ff849922ea8c4b31' and name='bk_sess'
> Database Error
> DB Err Number: 2013
> DB Err Message: Lost connection to MySQL server during
> query
> Application Message: Invalid SQL: select
> sum(total_public_bookmarks) as total_public from
> auth_user where username != ''
> Database Error
> DB Err Number: 2013
> DB Err Message: Lost connection to MySQL server
> during query
> Application Message: Invalid SQL: select
> category.name as category_name,
> bookmark.category_id, subcategory.name as
> subcategory_name, bookmark.subcategory_id,
> bookmark.id, bookmark.url, bookmark.name as
> bookmark_name, bookmark.ldesc, bookmark.keywords,
> rating.name as rating_name, bookmark.rating_id,
> bookmark.username from bookmark, category,
> subcategory, rating where ( bookmark.category_id =
> category.id and category.username =
> bookmark.username and bookmark.subcategory_id =
> subcategory.id and subcategory.username =
> bookmark.username and bookmark.rating_id =
> rating.id and rating.username = bookmark.username
> ) and ( bookmark.username = '' or
> bookmark.public_f='Y' ) order by category.name,
> subcategory.name, bookmark.name, bookmark.id
> Database Error
> Number: 2013
> Message: Lost connection to MySQL server during
> query
> SQL Stmt: select category.name as
> category_name, bookmark.category_id,
> subcategory.name as subcategory_name,
> bookmark.subcategory_id, bookmark.id,
> bookmark.url, bookmark.name as bookmark_name,
> bookmark.ldesc, bookmark.keywords, rating.name
> as rating_name, bookmark.rating_id,
> bookmark.username from bookmark, category,
> subcategory, rating where (
> bookmark.category_id = category.id and
> category.username = bookmark.username and
> bookmark.subcategory_id = subcategory.id and
> subcategory.username = bookmark.username and
> bookmark.rating_id = rating.id and
> rating.username = bookmark.username ) and (
> bookmark.username = '' or bookmark.public_f='Y'
> ) order by category.name, subcategory.name,
> bookmark.name, bookmark.id
>
>
>
> --
> 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,
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