php-general Digest 21 Apr 2002 10:45:02 -0000 Issue 1299

Topics (messages 93846 through 93875):

Re: [PHP-DB] Re: [PHP] Re: Cross DB application
        93846 by: Manuel Lemos

Re: debugger
        93847 by: Evan

Re: Comments Display, with replies
        93848 by: Miguel Cruz
        93850 by: Rene Visser

variables
        93849 by: Jule Slootbeek
        93859 by: Justin Blake

I would like to get a script to display in a frame
        93851 by: Jeffrey D. Means

grab a number
        93852 by: Craig Westerman
        93868 by: Maxim Maletsky

Ming and/or libswf
        93853 by: Richard Lynch
        93854 by: Rasmus Lerdorf
        93867 by: Richard Lynch

Better standards in PHP-coding
        93855 by: Frank
        93857 by: Mark Charette
        93860 by: michael kimsal
        93861 by: michael kimsal
        93862 by: michael kimsal
        93863 by: michael kimsal
        93864 by: The_RadiX
        93865 by: The_RadiX
        93866 by: The_RadiX
        93869 by: PHP freak
        93871 by: Jason Wong
        93875 by: The_RadiX

Re: who added the damn slashes?
        93856 by: Justin French

Re: Registration Form
        93858 by: Justin French

constructor in php4?
        93870 by: bob

Re: Attachments
        93872 by: Jason Wong

Session Tutorial
        93873 by: Sebastian A.

Re: Strange need - "Repeater" appliation
        93874 by: jyrgen.gmx.de

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


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

Richard Ellerbrock wrote:
> > If you want to hear experiences of people that tried Metabase, try
> > asking in Metabase mailing list (
> > http://groups.yahoo.com/group/metabase-dev/ ) or BinaryCloud mailing
> > lists ( http://binarycloud.tigris.org/servlets/ProjectMailingListList ).
> > I think Alex Black (BinaryCloud project leader) has tried both MySQL and
> > Oracle with Metabase.
> 
> I have done MySQL (MyISAM, INNODB), PostgreSQL and Oracle 9i with AdoDB -
> see http://iptrack.sourceforge.net. Works just fine for me. The hardest
> part was to get around limitations of certain databases - like Oracle
> does no support record count. This is not impossible to get around, but

If you would have used Metabase you would not have that problem because
Metabase has a function that you may call any time after you execute a
select query that returns the number of rows contained in the result
set. That is a standard feature of Metabase that works with every
database including Oracle.

Regards,
Manuel Lemos
--- End Message ---
--- Begin Message ---
I need PHP because I made a site for my course at university and they use
only Linux so I learned PHP.
>> Seems that you´re lucky with M$ and their ek$pen$ive environments.
Zend Studio 2.0 ==> 195$
NusPhere ==> 299$

I used PHP Edit but if I need to test a script that get values from POST or
GET parameters I need first to recreate them within the IDE.

Does exists something to debug PHP within the browser, just like M$ Script
Debugger?
DBG listen some port and some host but I didn't found instructions that
explain to use it.

Thanks again,
Evan

<[EMAIL PROTECTED]> ha scritto nel messaggio
news:<[EMAIL PROTECTED]>...
At 20.04.2002  21:15, you wrote:
>Hi to all!!!
>Can anyone tell me how to debug in PHP?
>When I use ASP simply I write "stop" (VB) or "debugger" (JSCRIPT) to set a
>breakpoint and open the Microsoft Script Debugger.
>With PHP I can't find a way to do a similar thing.
>I downloaded the DBG PHP debugger but I don't understand how to use it like
>MSD.
>My config is:
>PHP 4.1.2 + IIS5 + WinXPpro
>
>I'm bored to use echo "$something" for debug :-(
>
>Thanks in advance for your help,
>Evan
I´m not shure, but ZEND offers some kind of IDE and nusphere has an IDE
which has a debugger built in , but who needs this??
Use an editor with macro functionality so u can set a macro which makes
something like if($debug){ echo something}, then you can set one var
to turn debugging on/off.
Are you shure you need PHP for your problems? Seems that you´re lucky
with M$ and their ek$pen$ive environments.

Oliver

----------



--- End Message ---
--- Begin Message ---
On Sat, 20 Apr 2002, Julio Nobrega wrote:
> I have maybe an easy to solve problem, but I haven't come with a logical
> way to do it. I am builing a discussion site (a la Kuro5hin.org), and
> there's a sql query to retrieve comments attached to an article. It grabs
> their titles, along with some more informatio. What I want is to display the
> comments and the replies below them. It's been implemented in thousands of
> other scripts, but I can't figure out how to do with only one sql query
> (even if it uses Joins). That's important, since I expect the site to be
> very popular here in Brazil (let's hope!)
> 
>   So, any advices about how to display the comments like this:
> 
> - Comment 1
>   - Comment 2
>     - Comment 3
> 
> Is greatly appreciated. I am thinking about storing all comments in an
> array and construct the layout from there. But still, I don't know if it's
> the best choice in performance terms.

Well, which database are you using? Oracle supports hierarchical queries 
which are a pretty easy way to accomplish it with just SQL.

If your RDBMS doesn't support that, you're probably stuck doing a select
order by parent_id and then shuffling the resulting clusters around in
PHP. Use a 3D array (parent/id/content).

miguel

--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] wrote:

> Hi list!

>   I have maybe an easy to solve problem, but I haven't come with a logical
> way to do it. I am builing a discussion site (a la Kuro5hin.org), and
> there's a sql query to retrieve comments attached to an article. It grabs
> their titles, along with some more informatio. What I want is to display the
> comments and the replies below them. It's been implemented in thousands of
> other scripts, but I can't figure out how to do with only one sql query
> (even if it uses Joins). That's important, since I expect the site to be
> very popular here in Brazil (let's hope!)

>   So, any advices about how to display the comments like this:

> - Comment 1
>   - Comment 2
>     - Comment 3

>   Is greatly appreciated. I am thinking about storing all comments in an
> array and construct the layout from there. But still, I don't know if it's
> the best choice in performance terms.

>   Thanks,

> --
> Julio Nobrega.

> Tô chegando:
> http://www.inerciasensorial.com.br



Hi Julio,

maybe you should give a new comment a unique index-number and store this
in your SQL-table with every comment. 

So when somebody is continueing the thread, you give his comment the same
index number as the toplevel comment.

When doing this you can receive all comments within a thread with the
following
SQL-query : SELECT * FROM <your comment table> WHERE index=...

Now you can get all seperated comments out of your SQL-result array using
a simple loop. 

Good luck!

René Visser




--- End Message ---
--- Begin Message ---
Hey guys,
i have this script that changes pages in a table with the include() command, 
but i ran into trouble when i tried to change the pages by linking to 
index.php?left=theband because it would feed it to the index.php, but 
index.php would just change left back to news which is the default, how do i 
make it that it opens the theband page in stead of the default, and when i go 
to plain index.php the defaults come back?
any help apreciated
thanks

Jule
---SCRIPT---
<?php

$top = "navbar";
$left = "news";
$righttop = "welcome";
$rightbottom = "pic";

$toptitle = "index";
$lefttitle = "index";
$righttoptitle = "index";
$rightbottomtitle ="index";

$extention = ".php";

print ("<table border=0>");
        print ("<tr>");
                print ("<td align=center colspan=3>");
                        include ("$top/$toptitle$extention");
                print ("</td>");
        print ("</tr>");
        print ("<tr>");
                print ("<td rowspan=2 align=center width=40%>");
                        include ("$left/$lefttitle$extention");
                print ("</td>");
                print ("<td align=center width=60% height=40%>");
                        include ("$righttop/$title$righttoptitle$extention");
                print ("</td>");
        print ("</tr>");
        print ("<tr>");
                print ("<td align=center width=60% height=55%>");
                                include ("rightbottom/$rightbottomtitle$extention");
                print ("</td>");
        print ("</tr>");
print ("</table>");
?>
---SCRIPT---
-- 
Jule Slootbeek
[EMAIL PROTECTED]
http://blindtheory.cjb.net
--- End Message ---
--- Begin Message ---
"Jule Slootbeek" wrote:
> Hey guys,
> i have this script that changes pages in a table with the include()
command,
> but i ran into trouble when i tried to change the pages by linking to
> index.php?left=theband because it would feed it to the index.php, but
> index.php would just change left back to news which is the default, how do
i
> make it that it opens the theband page in stead of the default, and when i
go
> to plain index.php the defaults come back?
> any help apreciated
> thanks
>
> Jule
> ---SCRIPT---
> <?php
>
> $top = "navbar";
> $left = "news";
> $righttop = "welcome";
> $rightbottom = "pic";
>
> $toptitle = "index";
> $lefttitle = "index";
> $righttoptitle = "index";
> $rightbottomtitle ="index";
>
> $extention = ".php";
>
> print ("<table border=0>");
> print ("<tr>");
> print ("<td align=center colspan=3>");
> include ("$top/$toptitle$extention");
> print ("</td>");
> print ("</tr>");
> print ("<tr>");
> print ("<td rowspan=2 align=center width=40%>");
> include ("$left/$lefttitle$extention");
> print ("</td>");
> print ("<td align=center width=60% height=40%>");
> include ("$righttop/$title$righttoptitle$extention");
> print ("</td>");
> print ("</tr>");
> print ("<tr>");
> print ("<td align=center width=60% height=55%>");
> include ("rightbottom/$rightbottomtitle$extention");
> print ("</td>");
> print ("</tr>");
> print ("</table>");
> ?>
> ---SCRIPT---

just check to see if $left is already set,
either:

$left = isset($left) ? $left : "news";

or:

if(empty($left)) $left = "news";

Justin

--- End Message ---
--- Begin Message ---
Does anyone have any experience with making script output display in a
frame??  I would like to get this to happen on an e-commerce site I am
designing and am stuck.  I have tried <form method=POST
action=myscript.php target=main> with no success.  Please help.
 
----
Jeff Means
CIO for PicoTech
http://www.picotech.net
 
--- End Message ---
--- Begin Message ---
I get the following report from Analog.

Daily Report
(Go To: Top: Monthly Report: Daily Report: Request Report)
This report lists the activity in each day.
Each unit () represents 3,000 requests for pages or part thereof.
     date:   reqs:  pages:
---------: -------: -------:
10/Mar/02: 1109810:  159291:
11/Mar/02: 1163018:  185106:

Dates removed

18/Apr/02: 1197460:  190362:
19/Apr/02: 1175128:  181756: <<< Need to grab this number daily
20/Apr/02:     188:     142:

Busiest day: 5/Feb/02 (130,779 requests for pages).

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

I need to grab the 19/Apr/02 count of 181756. But the date will change
daily. So it would need to always grab last number from second to last line.

Any suggestions?

Thanks

Craig ><>
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---

Try by doing something like:

$line = explode("\n", $text);



for($l=0; $l<sizeof($line); $l++) {
        $data = explode("\t", $line[$l]);       // was the TAB delimiter
        for($d=0; $d<sizeof($data); $d++) {     // see if you can avoid
sizeof
                if($data[0] == date("format_bla_bla")) {        // this
is if today
                        $number = $data[2];
                        Break;
                }
        }
}


Would this work for you?
If not then this is a suggestion :-)



Sincerely,

Maxim Maletsky
Founder, Chief Developer
[EMAIL PROTECTED]

PHPBeginner.com (Where PHP Begins)
www.phpbeginner.com





> -----Original Message-----
> From: Craig Westerman [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, April 21, 2002 2:05 AM
> To: php-general-list
> Subject: [PHP] grab a number
> 
> I get the following report from Analog.
> 
> Daily Report
> (Go To: Top: Monthly Report: Daily Report: Request Report)
> This report lists the activity in each day.
> Each unit () represents 3,000 requests for pages or part thereof.
>      date:   reqs:  pages:
> ---------: -------: -------:
> 10/Mar/02: 1109810:  159291:
> 11/Mar/02: 1163018:  185106:
> 
> Dates removed
> 
> 18/Apr/02: 1197460:  190362:
> 19/Apr/02: 1175128:  181756: <<< Need to grab this number daily
> 20/Apr/02:     188:     142:
> 
> Busiest day: 5/Feb/02 (130,779 requests for pages).
> 
> ---------------------------------------------------
> 
> I need to grab the 19/Apr/02 count of 181756. But the date will change
> daily. So it would need to always grab last number from second to last
line.
> 
> Any suggestions?
> 
> Thanks
> 
> Craig ><>
> [EMAIL PROTECTED]
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
Please Cc: me as well...

I'm having the devil of a time getting Ming and/or libswf to do a Bitmap...


Short version:
What's the most stable PHP+Ming version-compatible combo I can achieve?

I don't care about anything else for this build, not even MySQL, just 
PHP + Ming.  Or libswf, if it's better.




Moderate version:

In particular, I need SWFBitmap to do something other than segfault 
or spew out SWF error messages about SWFCharacter or not being able 
to understand perfectly valid JPEG/DBL files.

I'd also settle for "Use libswf" if I could get that to do a bitmap 
without segfaulting either.

Note that I *can* get non-bitmap Flash examples to work in Ming, so 
I'm not screwing everything up here.  And, yes, I did read the docs 
about the changes to SWFBitmap arguments of filename versus file 
handle/data-stream.  segfault or error messages, take your pick.



Long version:

Started with 4.1.2 (the one with the icky-looking phpinfo() bug) and Ming 0.2a

I'm not completely unsuccessful in getting them to "work" -- I can 
get the square red spinning example from, errr, the PHP Manual 
user-contributed notes to work.  So ming itself got compiled in okay 
(--with-ming = /usr/src/ming)

But then I plop in Rasmus' spinning PHP logo bitmap from slide 
30-something of the Spinal Injection at http://conf.php.net and I get 
a segfault. :-(

I've tried switching to/from the new/old style of handing SWFBitmap a 
file handle, or the actual contents of the file, or the *name* of the 
file, and can achieve a nice error message from Ming that it can't 
figure out what kind of file yoya (with umlats -- the first 4 chars 
in a JPEG) is, and similarly about "dbl2" for a DBL file, whatever 
that is.  (Never heard of a DBL file before today and don't know how 
to view one, but I used Ming's png2dbl utility on a PNG that looks 
okay to me...)

I've tried libswf, and it also seems to segfault on attempts to do a 
bitmap -- though I admit I'm not at all sure I'm calling the 
functions properly.  Am I supposed to just make up numbers for the 
unique objid inputs, or do they have some kind of internal meaning to 
Flash that I'm just supposed to intuit or what?  Neither library 
seems very PHP-ish, but I can at least grok the Ming lib.  At any 
rate, I can achieve valid Flash files without bitmaps in libswf as 
well, but as soon as I touch a bitmap, Bam!, segfault.

Anyway, the Ming docs mention that you have to have a standard 
0-frame JPEG or somesuch...  I've tried both JPEG 6.0 and QuickTime 
JPEG from GraphicConverter, and I verified that I did *not* do the 
progressive thang there...

Still, I don't claim to understand that buffer-0 JPEG bit of the Ming 
manual at all...

But, since I used Ming's png2dbl tool to generate the DBL file,. and 
it doesn't like that either:  Same results -- I can segfault or it 
can bitch it's not an SWFCharacter, or it can bitch that it doesn't 
know what kind of file that DBL2 file is.   So I'm pretty sure it's 
not just a bad JPEG, and there truly is something broken about 
SWFBitmap in 4.1.2 with Ming 0.2a

I've been trying to compile with 4.0.4pl1, mostly cuz I had it handy already.

After hand-editing the ~/ming/php_ext/Makefile to have the hard-coded 
include paths for /usr/local/include/php/[main|Zend|TSRM] I got it to 
compile, albeit with tons of some semi-serious compiler warnings. 
Must have been worse than semi-serious, though, as the resulting 
php_ming.so yields:
undefined symbol: VCWD_FOPEN

At this point, I'd be happy to have somebody just point me to what 
they consider the most stable versions of PHP+Ming, I think, but I'll 
take any advice at all...
-- 
Got Music? http://l-i-e.com/artists.htm
--- End Message ---
--- Begin Message ---
To prove that it works.  My infamous spinning logo example that everyone
has seen 10 times...

http://conf.php.net/pres/slides/intro/flash_ming.php

The phpinfo() with the configure flags are here:

http://conf.php.net/info.php

libswf is compiled in directly and ming.so is built externally and loaded
in via php.ini.

-Rasmus

On Sat, 20 Apr 2002, Richard Lynch wrote:

> Please Cc: me as well...
>
> I'm having the devil of a time getting Ming and/or libswf to do a Bitmap...
>
>
> Short version:
> What's the most stable PHP+Ming version-compatible combo I can achieve?
>
> I don't care about anything else for this build, not even MySQL, just
> PHP + Ming.  Or libswf, if it's better.
>
>
>
>
> Moderate version:
>
> In particular, I need SWFBitmap to do something other than segfault
> or spew out SWF error messages about SWFCharacter or not being able
> to understand perfectly valid JPEG/DBL files.
>
> I'd also settle for "Use libswf" if I could get that to do a bitmap
> without segfaulting either.
>
> Note that I *can* get non-bitmap Flash examples to work in Ming, so
> I'm not screwing everything up here.  And, yes, I did read the docs
> about the changes to SWFBitmap arguments of filename versus file
> handle/data-stream.  segfault or error messages, take your pick.
>
>
>
> Long version:
>
> Started with 4.1.2 (the one with the icky-looking phpinfo() bug) and Ming 0.2a
>
> I'm not completely unsuccessful in getting them to "work" -- I can
> get the square red spinning example from, errr, the PHP Manual
> user-contributed notes to work.  So ming itself got compiled in okay
> (--with-ming = /usr/src/ming)
>
> But then I plop in Rasmus' spinning PHP logo bitmap from slide
> 30-something of the Spinal Injection at http://conf.php.net and I get
> a segfault. :-(
>
> I've tried switching to/from the new/old style of handing SWFBitmap a
> file handle, or the actual contents of the file, or the *name* of the
> file, and can achieve a nice error message from Ming that it can't
> figure out what kind of file yoya (with umlats -- the first 4 chars
> in a JPEG) is, and similarly about "dbl2" for a DBL file, whatever
> that is.  (Never heard of a DBL file before today and don't know how
> to view one, but I used Ming's png2dbl utility on a PNG that looks
> okay to me...)
>
> I've tried libswf, and it also seems to segfault on attempts to do a
> bitmap -- though I admit I'm not at all sure I'm calling the
> functions properly.  Am I supposed to just make up numbers for the
> unique objid inputs, or do they have some kind of internal meaning to
> Flash that I'm just supposed to intuit or what?  Neither library
> seems very PHP-ish, but I can at least grok the Ming lib.  At any
> rate, I can achieve valid Flash files without bitmaps in libswf as
> well, but as soon as I touch a bitmap, Bam!, segfault.
>
> Anyway, the Ming docs mention that you have to have a standard
> 0-frame JPEG or somesuch...  I've tried both JPEG 6.0 and QuickTime
> JPEG from GraphicConverter, and I verified that I did *not* do the
> progressive thang there...
>
> Still, I don't claim to understand that buffer-0 JPEG bit of the Ming
> manual at all...
>
> But, since I used Ming's png2dbl tool to generate the DBL file,. and
> it doesn't like that either:  Same results -- I can segfault or it
> can bitch it's not an SWFCharacter, or it can bitch that it doesn't
> know what kind of file that DBL2 file is.   So I'm pretty sure it's
> not just a bad JPEG, and there truly is something broken about
> SWFBitmap in 4.1.2 with Ming 0.2a
>
> I've been trying to compile with 4.0.4pl1, mostly cuz I had it handy already.
>
> After hand-editing the ~/ming/php_ext/Makefile to have the hard-coded
> include paths for /usr/local/include/php/[main|Zend|TSRM] I got it to
> compile, albeit with tons of some semi-serious compiler warnings.
> Must have been worse than semi-serious, though, as the resulting
> php_ming.so yields:
> undefined symbol: VCWD_FOPEN
>
> At this point, I'd be happy to have somebody just point me to what
> they consider the most stable versions of PHP+Ming, I think, but I'll
> take any advice at all...
> --
> Got Music? http://l-i-e.com/artists.htm
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
>To prove that it works.  My infamous spinning logo example that everyone
>has seen 10 times...
>
>http://conf.php.net/pres/slides/intro/flash_ming.php
>
>The phpinfo() with the configure flags are here:
>
>http://conf.php.net/info.php
>
>libswf is compiled in directly and ming.so is built externally and loaded
>in via php.ini.

I've seen it work and even stolen ^H^H^H^H^H^H borrowed it for a talk 
on my laptop (now in the hands of crooks in Spain) so have made it 
work before...

I don't know why my 4.1.2 won't work for the bitmap call, though...

Here are my configure flags:
  './configure'
'--with-apxs=/usr/local/apache/bin/apxs'
'--with-jpeg-dir'
'--with-tiff-dir'
'--enable-ftp'
'--enable-gd-imgstrttf'
'--with-gd'
'--with-ttf'
'--with-freetype-dir=/usr/local'
'--with-t1lib'
'--with-imap'
'--with-ldap'
'--with-pgsql'
'--with-mysql=/usr/src/mysql'
'--enable-versioning'
'--enable-memory-limit'
'--with-kerberos'
'--with-imap-ssl'
'--with-pdflib'
'--with-swf=/usr/src/libswf'
'--with-ming=/usr/src/ming'

Yours is:
'./configure'
'--host=i686-pc-linux-gnu'
'--with-mysql=/usr/local/mysql'
'--with-config-file-path=/local'
'--with-imap=/usr/local'
'--with-gd=/home/rasmus/gd-2.0.1'
'--with-freetype-dir=/usr'
'--enable-gd-native-ttf'
'--enable-gd-imgstrttf'
'--with-jpeg-dir=/usr'
'--with-png-dir=/usr'
'--with-zlib-dir=/usr'
'--with-pdflib=/usr/local'
'--enable-exif'
'--disable-debug'
'--enable-inline-optimization'
'--with-swf=/usr/local'
'--with-expat=/usr/local'
'--with-snmp=/usr/local'
'--enable-xslt'
'--with-xslt-sablot=/usr'
'--with-apxs=/local/httpd/bin/apxs'

I've just tried it without "memory-limit" and with disable-debug as I 
thought maybe that was it.

No dice.

How about sending me your libming.so and/or php_ming.so as an attachment?...

-- 
Got Music? http://l-i-e.com/artists.htm
--- End Message ---
--- Begin Message ---

"The nice thing about standards is that there are so many to choose between".

Subject: Uses of block markers in coding

GNU recommends a standard with block-markers aligned under each other and a 
number of people - including myself - find it senseless and 
counter-progressive to keep up an older standard resting from old days and 
doing the programmer a disfavor.

Too many programmers continue to use a style that originates back to the 
days where dumb terminals with one-line memory and line-editors was common.

Those days it could take long time to submit a line to the mainframe. I 
have tried it myself and in worst-case situations it could take up to half 
a minute to submit a line.

So naturally we put more things into one line. Statements like

if (tempratureM1>=tempratureSTP) {cout << "Warning! Cooling needed"; 
log(tempratureM1, "Warning);};

all in one line.

When editors became a little faster people started to write:

if (tempratureM1>=tempratureSTP)  {
   cout << "Warning! Cooling needed"; log(tempratureM1, "Warning); }

which is nicer to look at but would take many seconds more as one more line 
has to be submitted.

- - -

Nowadays few people have any problems with waiting for a CR.

But for mysterious reasons a rest from the old forced "standard" remains 
among people who use C(++) like languages.

It is still standard to write

if (some_expression) {
   statements;
   ...
}

What the "{" - the marking of the beginning of a block that should be 
indented - is doing in the end of the line nobody has yet been able to 
explain me.

Why, then, are functions not written as

function foo(parameter1, foo(parameter1, parameter2, ... parameterN) {
  statements
  ...
}

?

In other block-structured languages you of course align block-markers under 
each other, allowing for easy scan.

if expression
begin
   statement;
   ...
   ...
end;

I have yet to see anybody write

if expression begin
   statement;
   ...
   ...
end;

- - -

Does it matter? Oh, yes it does. A lot. As teacher I know from experience 
that programmers has a harder time tracking their own block with a number 
of "{"s dancing far out of sight in the right side of the screen. This is 
not a matter of experience. No experience can ever make it equally fast to 
control structures based on vertically aligned block-markers contra those 
where the marker can be found anywhere on a line.

As an amusing result of the weird practice it has been necessary to 
recommend a standard where the { }-pair is always used, even though there 
is only one statement following an if:

if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114) {
   oneStatement;
}

instead of simply

if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114)
   oneStatement;


Why the need for the extra "{ }"s?

Of course because the the difference between

if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114)
   oneStatement;

(correct) and

if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114)  {
   oneStatement;

(wrong) is easily overlooked because of the block marker put away to the right!


But nobody overlooks the difference betweeen

if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114)
   oneStatement;

and

if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114)
   {
   oneStatement;


where the missing "}" shines in the eyes.

- - -

We can only hope that some major standard-setters for PHP should make a 
rational decision about what standard to choose and not just keep "what we 
are used to" for the disadvantage of future generations of programmers.

http://www.gnu.org/prep/standards.htm
http://cs.nmhu.edu/personal/curtis/cs1htmlfiles/essentialssec6.htm


Best regards

SFM
U5com Co Ltd.

--- End Message ---
--- Begin Message ---
Hehehe. And I thought the OTBSW (One True Brace Style Wars) had passed into
memory back some 10 or 15 years ago! Lo! They resurface yet again! 30 years
in this business and still I hear them argue.

Perhaps a cb style program for PHP so people can write any blasted style
they feel like and then have another programmer transform it into _their_
OTB style.

_My_ "coding standards" may not be _your_ coding standards, but mechanical
transformations can pretty much make it all moot.

Mark C.

> -----Original Message-----
> From: Frank [mailto:[EMAIL PROTECTED]]
>
> "The nice thing about standards is that there are so many to
> choose between".
>
> Subject: Uses of block markers in coding
>
> GNU recommends a standard with block-markers aligned under each
> other and a
> number of people - including myself - find it senseless and
> counter-progressive to keep up an older standard resting from old
> days and
> doing the programmer a disfavor.
> >


--- End Message ---
--- Begin Message ---
Frank wrote:
> 
<snip>

For starters, just because GNU says something is what should be done
doesn't mean it's the right way.  They don't believe software should be
licensed in particular ways, and I happen to believe it's up to the 
developer(s) of a package to decide that.

Second, *HOW MANY* PHP statements can be followed by a { ?

I can think of three

if (foo) {
function foo () {
class foo {

Maybe there's one more that I'm missing, but it seems pretty darn
obvious to me that if I write

if (foo) {
    if (bar) {
       echo "bar";
    }
}

that when I see a } I can immediately trace it back up to the 
corresponding column and see the keyword "IF".  The indentation still 
keeps things in order.

Guess what other benefit *I* derive from this?  I can see more lines
on the screen at the same time.  Sorry - I usually always see ~35.
What I'm seeing are more *useful* lines of PHP code, not extra line 
breaks intended to satisfy some GNU standards definer.

Personally, I enjoy being able to see more useful code than line breaks, 
and I am intelligent enough to be able, using intelligently indented 
code, to follow a } up the the statement which opened the { on the same 
line.

"As teacher I know from experience that programmers has a harder time 
tracking their own block with a number of "{"s dancing far out of sight 
in the right side of the screen."

Maybe they should be breaking up their IF logic into multiple lines
(PHP's OK with whitespace issues) so that things aren't 'dancing' off 
the right side of the screen.

if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114)  {
   oneStatement;

The only people I've come across that like to use this oneStatement
trick are smart enough not to type { in the first place.  Myself, I
never use that oneStatement style, and always put a { and matching } 
immediately below it when coding.  Then I go back and put the logic
between the { and } markers.

"> Why, then, are functions not written as
 >
 > function foo(parameter1, foo(parameter1, parameter2, ... parameterN) {
 >  statements
 >  ...
 > }
 > "

We write our functions like that.  It seems many user comments
in the PHP manual use the same style, as do many of
the code snippets and samples on Zend.

Trying to base if block {} usage on the supposed uniformity of
function block {} usage doesn't hold much weight.  :(


"I have yet to see anybody write

if expression begin
   statement;
   ...
   ...
end;
"

I'm not sure if you're trolling, or just don't go back very far in 
computers, or what...

BASIC seemed to be full of this stuff, and it made a decent
name for itself as a computer language.  Example:
(note carefully the placement of "IF" and "THEN" and "END IF")

FOR i% = 1 TO 10
   IF yourScore% >= playerscore%(i%) THEN
     FOR ii% = 10 TO i% + 1 STEP -1      'Go backwards (i% < 10)
       playername$(ii%) = playername$(ii% - 1)
       playerscore%(ii%) = playerscore%(ii% - 1)
     NEXT ii%
     PRINT "Congratulations! You have made the top 10!"
     INPUT "What is your name? ", yourName$
     playername$(i%) = yourName$
     playerscore%(i%) = yourScore%
     EXIT FOR
   END IF
NEXT i%

(taken shamlessly from 
http://www.geocities.com/SiliconValley/Bay/5707/qbasic.html as I can't 
remeber much BASIC these days!)


"As an amusing result of the weird practice it has been necessary to
recommend a standard where the { }-pair is always used, even though
there is only one statement following an if:"

I don't find it amusing that, as a programming standard,
one is encouraged to *ALWAYS* use { and }, regardless of if there's
only oneStatement (see above).  We teach PHP courses, and trying
to explain to people that, "well, sometimes you can use { } blocks
but you don't always need them" is just confusing as all get out
to people just starting out with the language.  Giving them a
standard "use {} blocks" makes more sense to them and us.

BTW, in the classes, we do show both

if (foo) {
   echo "foo";
}

and

if (foo)
{
    echo "foo";
}

styles.  I'd say about 60% or so wind up using option one, even though
option 2 is presented more, and the examples generally use style 2.

"We can only hope that some major standard-setters for PHP should make a
rational decision about what standard to choose and not just keep "what
we are used to" for the disadvantage of future generations of programmers."

What if there IS a forthcoming 'rational decision' about {} usage from
all the core PHP team, and they choose the way you don't like?  Should
they codify the parser to not work with certain styles?  Why must
there be some magical consensus on something which, ime, doesn't have
as much impact on the language as ISAPI support, or better object 
handling, or stronger memory handling, or a myriad of other topics?


Michael Kimsal
http://www.phphelpdesk.com

--- End Message ---
--- Begin Message ---
Frank wrote:
> 
<snip>

For starters, just because GNU says something is what should be done
doesn't mean it's the right way.  They don't believe software should be
licensed in particular ways, and I happen to believe it's up to the 
developer(s) of a package to decide that.

Second, *HOW MANY* PHP statements can be followed by a { ?

I can think of three

if (foo) {
function foo () {
class foo {

Maybe there's one more that I'm missing, but it seems pretty darn
obvious to me that if I write

if (foo) {
    if (bar) {
       echo "bar";
    }
}

that when I see a } I can immediately trace it back up to the 
corresponding column and see the keyword "IF".  The indentation still 
keeps things in order.

Guess what other benefit *I* derive from this?  I can see more lines
on the screen at the same time.  Sorry - I usually always see ~35.
What I'm seeing are more *useful* lines of PHP code, not extra line 
breaks intended to satisfy some GNU standards definer.

Personally, I enjoy being able to see more useful code than line breaks, 
and I am intelligent enough to be able, using intelligently indented 
code, to follow a } up the the statement which opened the { on the same 
line.

"As teacher I know from experience that programmers has a harder time 
tracking their own block with a number of "{"s dancing far out of sight 
in the right side of the screen."

Maybe they should be breaking up their IF logic into multiple lines
(PHP's OK with whitespace issues) so that things aren't 'dancing' off 
the right side of the screen.

if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114)  {
   oneStatement;

The only people I've come across that like to use this oneStatement
trick are smart enough not to type { in the first place.  Myself, I
never use that oneStatement style, and always put a { and matching } 
immediately below it when coding.  Then I go back and put the logic
between the { and } markers.

"> Why, then, are functions not written as
 >
 > function foo(parameter1, foo(parameter1, parameter2, ... parameterN) {
 >  statements
 >  ...
 > }
 > "

We write our functions like that.  It seems many user comments
in the PHP manual use the same style, as do many of
the code snippets and samples on Zend.

Trying to base if block {} usage on the supposed uniformity of
function block {} usage doesn't hold much weight.  :(


"I have yet to see anybody write

if expression begin
   statement;
   ...
   ...
end;
"

I'm not sure if you're trolling, or just don't go back very far in 
computers, or what...

BASIC seemed to be full of this stuff, and it made a decent
name for itself as a computer language.  Example:
(note carefully the placement of "IF" and "THEN" and "END IF")

FOR i% = 1 TO 10
   IF yourScore% >= playerscore%(i%) THEN
     FOR ii% = 10 TO i% + 1 STEP -1      'Go backwards (i% < 10)
       playername$(ii%) = playername$(ii% - 1)
       playerscore%(ii%) = playerscore%(ii% - 1)
     NEXT ii%
     PRINT "Congratulations! You have made the top 10!"
     INPUT "What is your name? ", yourName$
     playername$(i%) = yourName$
     playerscore%(i%) = yourScore%
     EXIT FOR
   END IF
NEXT i%

(taken shamlessly from 
http://www.geocities.com/SiliconValley/Bay/5707/qbasic.html as I can't 
remeber much BASIC these days!)


"As an amusing result of the weird practice it has been necessary to
recommend a standard where the { }-pair is always used, even though
there is only one statement following an if:"

I don't find it amusing that, as a programming standard,
one is encouraged to *ALWAYS* use { and }, regardless of if there's
only oneStatement (see above).  We teach PHP courses, and trying
to explain to people that, "well, sometimes you can use { } blocks
but you don't always need them" is just confusing as all get out
to people just starting out with the language.  Giving them a
standard "use {} blocks" makes more sense to them and us.

BTW, in the classes, we do show both

if (foo) {
   echo "foo";
}

and

if (foo)
{
    echo "foo";
}

styles.  I'd say about 60% or so wind up using option one, even though
option 2 is presented more, and the examples generally use style 2.

"We can only hope that some major standard-setters for PHP should make a
rational decision about what standard to choose and not just keep "what
we are used to" for the disadvantage of future generations of programmers."

What if there IS a forthcoming 'rational decision' about {} usage from
all the core PHP team, and they choose the way you don't like?  Should
they codify the parser to not work with certain styles?  Why must
there be some magical consensus on something which, ime, doesn't have
as much impact on the language as ISAPI support, or better object 
handling, or stronger memory handling, or a myriad of other topics?


Michael Kimsal
http://www.phphelpdesk.com

--- End Message ---
--- Begin Message ---
Mark Charette wrote:
> Hehehe. And I thought the OTBSW (One True Brace Style Wars) had passed into
> memory back some 10 or 15 years ago! Lo! They resurface yet again! 30 years
> in this business and still I hear them argue.
> 
> Perhaps a cb style program for PHP so people can write any blasted style
> they feel like and then have another programmer transform it into _their_
> OTB style.
> 
> _My_ "coding standards" may not be _your_ coding standards, but mechanical
> transformations can pretty much make it all moot.
>

Cool - thanks.  I seem to have posted twice on accident, but you
summed up much better what I tried to say, but quicker!  :)
This guy got on my few remaining nerves this evening.  :)


--- End Message ---
--- Begin Message ---
Mark Charette wrote:
> Hehehe. And I thought the OTBSW (One True Brace Style Wars) had passed into
> memory back some 10 or 15 years ago! Lo! They resurface yet again! 30 years
> in this business and still I hear them argue.
> 
> Perhaps a cb style program for PHP so people can write any blasted style
> they feel like and then have another programmer transform it into _their_
> OTB style.
> 
> _My_ "coding standards" may not be _your_ coding standards, but mechanical
> transformations can pretty much make it all moot.
>

Cool - thanks.  I seem to have posted twice on accident, but you
summed up much better what I tried to say, but quicker!  :)
This guy got on my few remaining nerves this evening.  :)



--- End Message ---
--- Begin Message ---

 I don't know who you are Frank..

 But I understand and support you entirely..


 I could write my own 1500 word post like you..


 But you've covered it all

 I always see the { } pair used when there is only one statement, and also
 this weird

 if(expression)
 {
   statement
 }
 else
 {
   statement 2
 }

 blocks are VERY weird and hard to understand.

 I prefer and use for every lang. Including C++, Object Pascal, java, PHP,
 Perl:

 if(expression) {
   statement block
   if(expression2) {
     statementblock 2
   }
 } else {
   statement if
 }

 in a text editor these blocks are easily read and the double spacing (not
 tabs) I use makes it REALLY easy to find and track code during debugging..


 sometimes I see loops in conditional statements mixed with functions and
 this neverending mass of curly braces and I am very confused trying to fix
 their code..

 SO I try as hard as possible so suggest my method as it makes reading much
 easier..





 I do understand where you are coming from with your starting { being in
line
 with the actual expression it refers to... Hmm yes but as I always indent
 for loops, conditional expressions, etc.. anything that needs curly braces
I
 will easily see that if the code doesn't return back to the first column
 something is wrong

 Eg..


 if(exp1) {
   if(exp2) {
     ..do that..
   } else {
     while(x<y) {
       ..do this..
     }
   }
 }


 and I can clearly see the last brace finishes again on col 1.. SO i know
all
 is good..

 Hard in email to show as the character spacing is not equal like good text
 editors..

 but paste it in your editor you'll see what I mean..






 Thanks for your support.. Should have more people following these readable
 standards in the world!

 :::::::::::::::::::::::::::::::::::::::::::
 :  Julien Bonastre [The-Spectrum.org CEO]
 :  A.K.A. The_RadiX
 :  [EMAIL PROTECTED]
 :  ABN: 64 235 749 494
 :  QUT Student :: 04475739
 :::::::::::::::::::::::::::::::::::::::::::

>
> ----- Original Message -----
> From: "Frank" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, April 21, 2002 11:51 AM
> Subject: [PHP] Better standards in PHP-coding
>
>
>
> "The nice thing about standards is that there are so many to choose
> between".
>
> Subject: Uses of block markers in coding
>
> GNU recommends a standard with block-markers aligned under each other and
> a
> number of people - including myself - find it senseless and
> counter-progressive to keep up an older standard resting from old days and
> doing the programmer a disfavor.
>
> Too many programmers continue to use a style that originates back to the
> days where dumb terminals with one-line memory and line-editors was
> common.
>
> Those days it could take long time to submit a line to the mainframe. I
> have tried it myself and in worst-case situations it could take up to half
> a minute to submit a line.
>
> So naturally we put more things into one line. Statements like
>
> if (tempratureM1>=tempratureSTP) {cout << "Warning! Cooling needed";
> log(tempratureM1, "Warning);};
>
> all in one line.
>
> When editors became a little faster people started to write:
>
> if (tempratureM1>=tempratureSTP)  {
>    cout << "Warning! Cooling needed"; log(tempratureM1, "Warning); }
>
> which is nicer to look at but would take many seconds more as one more
> line
> has to be submitted.
>
> - - -
>
> Nowadays few people have any problems with waiting for a CR.
>
> But for mysterious reasons a rest from the old forced "standard" remains
> among people who use C(++) like languages.
>
> It is still standard to write
>
> if (some_expression) {
>    statements;
>    ...
> }
>
> What the "{" - the marking of the beginning of a block that should be
> indented - is doing in the end of the line nobody has yet been able to
> explain me.
>
> Why, then, are functions not written as
>
> function foo(parameter1, foo(parameter1, parameter2, ... parameterN) {
>   statements
>   ...
> }
>
> ?
>
> In other block-structured languages you of course align block-markers
> under
> each other, allowing for easy scan.
>
> if expression
> begin
>    statement;
>    ...
>    ...
> end;
>
> I have yet to see anybody write
>
> if expression begin
>    statement;
>    ...
>    ...
> end;
>
> - - -
>
> Does it matter? Oh, yes it does. A lot. As teacher I know from experience
> that programmers has a harder time tracking their own block with a number
> of "{"s dancing far out of sight in the right side of the screen. This is
> not a matter of experience. No experience can ever make it equally fast to
> control structures based on vertically aligned block-markers contra those
> where the marker can be found anywhere on a line.
>
> As an amusing result of the weird practice it has been necessary to
> recommend a standard where the { }-pair is always used, even though there
> is only one statement following an if:
>
> if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114) {
>    oneStatement;
> }
>
> instead of simply
>
> if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114)
>    oneStatement;
>
>
> Why the need for the extra "{ }"s?
>
> Of course because the the difference between
>
> if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114)
>    oneStatement;
>
> (correct) and
>
> if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114)  {
>    oneStatement;
>
> (wrong) is easily overlooked because of the block marker put away to the
> right!
>
>
> But nobody overlooks the difference betweeen
>
> if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114)
>    oneStatement;
>
> and
>
> if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114)
>    {
>    oneStatement;
>
>
> where the missing "}" shines in the eyes.
>
> - - -
>
> We can only hope that some major standard-setters for PHP should make a
> rational decision about what standard to choose and not just keep "what we
> are used to" for the disadvantage of future generations of programmers.
>
> http://www.gnu.org/prep/standards.htm
> http://cs.nmhu.edu/personal/curtis/cs1htmlfiles/essentialssec6.htm
>
>
> Best regards
>
> SFM
> U5com Co Ltd.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Hmm sorry all


yes it seems I misread some crucial parts myself..


That whole

if(exp) {
  statement

that's a load..

if you want a one-liner conditional statement do:

if(exp) statement;

and that's it.


yes also michael you are right..

I use the:

if(exp) {
  blah blah
} else {
  blah blah 2
}

concept as well and find it the best

that whole wasting of lines:

if(exp)
{
  yabba
}
else
{
  yadda
}

is terrible..




Sorry bout that guys.. Didn't really understand the message till I reread
email..






:::::::::::::::::::::::::::::::::::::::::::
:  Julien Bonastre [The-Spectrum.org CEO]
:  A.K.A. The_RadiX
:  [EMAIL PROTECTED]
:  ABN: 64 235 749 494
:  QUT Student :: 04475739
:::::::::::::::::::::::::::::::::::::::::::


----- Original Message -----
From: "michael kimsal" <[EMAIL PROTECTED]>
To: "Mark Charette" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, April 21, 2002 1:22 PM
Subject: Re: [PHP] Better standards in PHP-coding


> Mark Charette wrote:
> > Hehehe. And I thought the OTBSW (One True Brace Style Wars) had passed
into
> > memory back some 10 or 15 years ago! Lo! They resurface yet again! 30
years
> > in this business and still I hear them argue.
> >
> > Perhaps a cb style program for PHP so people can write any blasted style
> > they feel like and then have another programmer transform it into
_their_
> > OTB style.
> >
> > _My_ "coding standards" may not be _your_ coding standards, but
mechanical
> > transformations can pretty much make it all moot.
> >
>
> Cool - thanks.  I seem to have posted twice on accident, but you
> summed up much better what I tried to say, but quicker!  :)
> This guy got on my few remaining nerves this evening.  :)
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


--- End Message ---
--- Begin Message ---
Sorry double posting..




Yes.. that's right Michael..



Both styles are correct and are parsed exactly the same..

They obviously both are part of the specifications of the PHP interpretor and 
structure OTHERWISE they wouldn't work would they? :P



And yes, it's to do with what is more comfortable for the programmer.. As long as the 
programmers at the end can read it easily enough that's all that should count..


Considering that:

if(exp) statement;

Is quite legal in all the languages I stated before then it is quite valid to use it 
as I see fit..





Hopefully you're not trying to impose on us the standard because standards are simply 
made for the sake of clarity to the developers.. Not the users... Obviously anyway :P






Bye


:::::::::::::::::::::::::::::::::::::::::::
:  Julien Bonastre [The-Spectrum.org CEO]  
:  A.K.A. The_RadiX
:  [EMAIL PROTECTED]
:  ABN: 64 235 749 494
:  QUT Student :: 04475739
:::::::::::::::::::::::::::::::::::::::::::


--- End Message ---
--- Begin Message ---

Change "terrible" to "readable" and I agree completely!

A carriage return and tab is the same size as two space-bar spaces, but is MUCH easier 
to read.

It's when you're going through someone ELSE's code that you start to appreciate things 
being all clearly spaced out with all nested things in their own indent.




> that whole wasting of lines:
> 
> if(exp)
> {
>   yabba
> }
> else
> {
>   yadda
> }
> 
> is terrible..
--- End Message ---
--- Begin Message ---
On Sunday 21 April 2002 11:26, The_RadiX wrote:

>  Hard in email to show as the character spacing is not equal like good text
>  editors..

Set your mail client to use a fixed width font -- Lucida Console is my 
preferred font.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Q:      Do you know what the death rate around here is?
A:      One per person.
*/
--- End Message ---
--- Begin Message ---
Yes thank you Jason..


I could have.. But I was busy..

And _usually_ my posts here are somewhat ignored so I thought better than to
spend _too_ much time on it..


Thanks anyway..


:::::::::::::::::::::::::::::::::::::::::::
:  Julien Bonastre [The-Spectrum.org CEO]
:  A.K.A. The_RadiX
:  [EMAIL PROTECTED]
:  ABN: 64 235 749 494
:  QUT Student :: 04475739
:::::::::::::::::::::::::::::::::::::::::::


----- Original Message -----
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, April 21, 2002 5:53 PM
Subject: Re: [PHP] Better standards in PHP-coding


> On Sunday 21 April 2002 11:26, The_RadiX wrote:
>
> >  Hard in email to show as the character spacing is not equal like good
text
> >  editors..
>
> Set your mail client to use a fixed width font -- Lucida Console is my
> preferred font.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Q: Do you know what the death rate around here is?
> A: One per person.
> */
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
I believe the php.ini file has "magic_quote_runtime" (or simular) enabled.
Not much you can do unless you have control of the server (ie, you are the
admin).

You have everything in an array, so it's quite easy to stripslashes() on the
whole array... it'd be a lot harder with individual vars.


Justin French
--------------------
Creative Director
http://Indent.com.au
--------------------


on 15/04/02 8:42 PM, Jeroen Olthof ([EMAIL PROTECTED]) wrote:

> Hi,
> 
> The problem:
> I don't use addslashes($....) but somehow that is what happens to my posted
> data
> 
> The situation:
> I'm building a wizard like form that read all posted data (HTTP_POST_VARS,
> HTTP_GET_VARS etc..) and puts it in an array that is registerd in a session.
> This gives me the possibility to use back en next in the wizard form. But
> every time the slashes are added !!!!!
> 
> What is the solution
> 
> PHP version 4.0.3pl1
> server is running a slash admin interface (so upgrading is a bit difficult)
> 
> what to do , to avoid those auto addslasshes ???
> 
> kind regards
> Jeroen Olthof
> 
> 

--- End Message ---
--- Begin Message ---
The browser's back button is NOT reliable, and JavaScript's 'back' is the
same thing...

If you are carrying values forward to the next page with a hidden field, my
recommendation would be to store each page's vars is a way which is easy to
work with, and instead of the browser's back button, prove them with <FORM>
buttons for back and forward.  This way, the user's input from previous
pages is set in the POST vars, and you can do something like:

<INPUT name="first" size="20" value="<? if(isset($first)) { echo
stripslashes($first); } else { echo "please enter your first name"; } ?>">


However, some people don't like using forms in this way, and it doesn't
solve the problem of people hitting their back button.  As you already
recognised, sessions would be a great way for keeping this data on hand,
because you can detect if the user has already seen "page 1" and flow in the
data they already entered.


Also consider inserting the data directly into a database (either the "real"
table, or a temporary table), which can provide the same options.


I like the idea of sessions best, but haven't really spent AGES testing each
method, looking for pros and cons.


Justin
--------------------
Creative Director
http://Indent.com.au
--------------------




on 18/04/02 8:58 AM, Vladislav Kulchitski ([EMAIL PROTECTED]) wrote:

> 
> Hi,
> 
> I am using registration form with a number of different steps. And if,
> for instance, the user wants to come back to correct something, I am
> using the back img button with the link:
> 
> javascript:history.back(1)
> 
> I am wondering how many people are actually using the way I do, and if
> it's reliable at all or not, I mean whether there are browsers wouldn't
> support returning back and keep the information in the fields.
> 
> Advice would be greatly appreciated,
> Thanks,
> Vlad
> p.s. probably the best way is to use sessions(?), but I am carrying
> values through the steps via <input type=hidden name=name value=value>
> 
> 
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
the manual says:the function A will be called.
in fact, the function B is called.
why?
my config : win98/pws2/php411(CGI)

<?php
class A
{
    function A()
    {
        echo "I am the constructor of A.<br>\n";
    }

    function B()
    {
        echo "I am a regular function named B in class A.<br>\n";
        echo "I am not a constructor in A.<br>\n";
    }
}

class B extends A
{
    function C()
    {
        echo "I am a regular function.<br>\n";
    }
}

// This will call B() as a constructor.
$b = new B;
?>

thaks
--- End Message ---
--- Begin Message ---
On Sunday 21 April 2002 06:02, Jason Soza wrote:
> They actually vary as to where they become truncated - some are at 633
> bytes, some are at 1kb. The odd thing is that the PHP script I'm using to
> process the form actually pics up the correct filesize, it reports it to me
> under a $filesize variable I've setup. It'll report, say file2_filesize...:
> 69147 but the actual attachment is 1kb.

Please post your code.

> Like I said, I have this same problem using both Perl scripts and PHP
> scripts. In php.ini my post_max size is 8M and upload_max_filesize is 2M.
> Looking through the Apache mailing list archives, it looks like others
> running Apache on win32 have experienced the same problems, but there are
> no answers. I'm a little stumped myself!

Have you narrowed down the problem to whether the uploaded file is truncated 
or whether the mail attachment process truncates the file?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
<<<<< EVACUATION ROUTE <<<<<
*/
--- End Message ---
--- Begin Message ---
Recently I have been trying to work with sessions however I must admit that
I am not sure I completely understand them. Does anyone know of a good
tutorial that thoroughly explains sessions?

Thanks in advance

--- End Message ---
--- Begin Message ---
On 20 Apr 02, at 11:48, Peter Janett wrote:

> I need to create a simple app that works like a radio repeater, in that is
> simply passes information it receives through to another script, in both
> directions.
> 
> In other words, a remote application located at www.domain.com/app.php
> accepts variable1, variable2, and variable3, and returns a response based on
> that information.
> 
> I want to put a "repeater app" in the middle of the browser and the url
> above, so information is passed to www.mydomain.com/process.php, and is not
> changed at all, but is sent to www.domain.com/app.php, and the response from
> www.domain.com/app.php is sent back to www.mydomain.com/process.php, so the
> results of sending the same information to either url will be exactly the
> same.
> 
> I'm not trying to do packet sniffing or anything, just trying to "mask" a
> url.  It would be nice if I could pass cookies through as well.
> 
> Any help, resources, ideas, etc appreciated.

i have the following idea if you want to use standard HTML-PHP 
techniques:

if the amount of information is not too large, make use of URL-
attached variables and pass them to your repeater script, which
contains a form. Dont forget to attach also ...&submit=yes to it.
parse recieved variables in that script with and parsestr($argv[0])

juergen



--- End Message ---

Reply via email to