php-general Digest 10 Nov 2002 02:10:06 -0000 Issue 1695
Topics (messages 123576 through 123641):
Re: W3C and PHP
123576 by: Ernest E Vogelsinger
123578 by: Ernest E Vogelsinger
123579 by: . Edwin
123581 by: . Edwin
123592 by: Jens Lehmann
123600 by: Ernest E Vogelsinger
123640 by: Brad Thomas
http$B$G%;%C%7%g%s$r3+;O(B$B$7$?>l9g!"(Bhttps$B$X(B$B9T$C$F$b7QB3$5$l$k$N$G(B$B$7$g$&$+!)(B
123577 by: Rich
Re: How can I start up a new and recompiled version of source PHP???
123580 by: info.t-host.de
123587 by: . Edwin
Setup-dependent quotes problem
123582 by: Daniele Baroncelli
123586 by: Marco Tabini
123589 by: . Edwin
upload whole direcotry using ftp functions
123583 by: AKHIL KODALI
starting recompiled php as a cgi-interpreter
123584 by: info.t-host.de
123625 by: Maxim Maletsky
Re: http$B$G%;%C%7%g%s$r3+;O$7$?>l9g!"(Bhttps$B$X9T$C$F$b7QB3$5$l$k$N$G$7$g$&$+!)(B
123585 by: BAROILLER Pierre-Emmanuel
Re: Need MENTOR for Fantasy football project
123588 by: Michael Geier
RegExp for Forum-List-Code
123590 by: Jens Lehmann
123594 by: Marek Kilimajer
123607 by: Jens Lehmann
123614 by: Ernest E Vogelsinger
Re: Request entity too large (already seen the FAQ)
123591 by: Brian Fahrlander
preg_split problem
123593 by: samug
123597 by: Marek Kilimajer
123598 by: Jason Wong
123599 by: samug
123601 by: Marek Kilimajer
123602 by: Ernest E Vogelsinger
123604 by: Ernest E Vogelsinger
Automatic Colspan from database data
123595 by: Dhaval Desai
123606 by: Marco Tabini
123608 by: Dhaval Desai
123619 by: Marco Tabini
Re: MySQL and PHP math problem...
123596 by: Peter
Re: HTTP POST FILE UPLOAD HELP - REVISITED
123603 by: . Darwin
HTML forms & php 4.2.3 - how to get cvs fix applied
123605 by: andy
Rotating Ads
123609 by: Stephen
123610 by: Stephen
123613 by: Andrew Brampton
123626 by: BAROILLER Pierre-Emmanuel
header function
123611 by: Donahue Ben
123612 by: Stephen
123616 by: Ernest E Vogelsinger
How to know files in a directory
123615 by: Mohd_Q
123617 by: Marco Tabini
123627 by: BAROILLER Pierre-Emmanuel
123635 by: John Nichel
Errors and Logging Configuration Options: docref-root
123618 by: Stefan Schiller
Re: PHP 4.3.0 and Zend Engine 2
123620 by: Andi Gutmans
Re: Weird behaviour with references to objects...
123621 by: Tim Molendijk
php5 features?
123622 by: ed
123623 by: ed
123624 by: Maxim Maletsky
Handling Errors Gracefully
123628 by: Monty
123629 by: Rasmus Lerdorf
123630 by: Marco Tabini
123631 by: Ernest E Vogelsinger
123632 by: Ernest E Vogelsinger
123633 by: Ernest E Vogelsinger
123634 by: Marco Tabini
Looping through formfields...
123636 by: Brad Apps
Re: calculate bytes in string
123637 by: Ian Newlands
123638 by: Ian Newlands
Errant include file works everywhere but here
123639 by: Andre Dubuc
confusion in session vars
123641 by: Khalid El-Kary
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 ---
At 07:12 09.11.2002, conbud said:
--------------------[snip]--------------------
>Hi,
>In some of my URLs I have to pass variables through the URL like
>nav.php?page=about§ion=linux - when i do this and then scan my site for
>W3C validation I get this
>Line 40, column 28:
> ... <a href="nav.php?page=about§ion=Linux"><font color="#256 ...
> ^
>Error: unknown entity "section"
--------------------[snip]--------------------
If this is really what the W3C validator tells you you should file a bug
report, IMHO. Passing GET variables should be valid HTML ;-)
But I rather believe your HREF contains a closing quote somewhere before
the parameters (maybe in any parameter value). To avoid this, use
"urlencode()" vor all parameter values you use to construct a link with.
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
--- End Message ---
--- Begin Message ---
At 07:45 09.11.2002, Khalid El-Kary said:
--------------------[snip]--------------------
>hi,
>just use & instead
><a href="mypage.php?name=khalid&age=d"></a>
--------------------[snip]--------------------
Sorry, no. This would result in a quite funny variable:
$_GET = Array(
name => khalid
amp;age => d
)
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
--- End Message ---
--- Begin Message ---
Not really. Try it ;)
Khalid is correct.
- E
"Ernest E Vogelsinger" <[EMAIL PROTECTED]> wrote:
> At 07:45 09.11.2002, Khalid El-Kary said:
> --------------------[snip]--------------------
> >hi,
> >just use & instead
> ><a href="mypage.php?name=khalid&age=d"></a>
> --------------------[snip]--------------------
>
> Sorry, no. This would result in a quite funny variable:
> $_GET = Array(
> name => khalid
> amp;age => d
> )
>
>
> --
> >O Ernest E. Vogelsinger
> (\) ICQ #13394035
> ^ http://www.vogelsinger.at/
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Hello,
"Ernest E Vogelsinger" <[EMAIL PROTECTED]> wrote:
[snip]
> If this is really what the W3C validator tells you you should file a bug
> report, IMHO. Passing GET variables should be valid HTML ;-)
[/snip]
True. And & IS a valid html. In fact, changing & to & is the only
way I could pass the xhtml validator. So, it's not really a bug when the
validator complains about the & sign...
- E
--- End Message ---
--- Begin Message ---
>> ... <a href="nav.php?page=about§ion=Linux"><font color="#256 ...
>> ^
>>Error: unknown entity "section"
> If this is really what the W3C validator tells you you should file a bug
> report, IMHO. Passing GET variables should be valid HTML ;-)
Usually entities start with "&" and end with ";". The "entity" §ion
doesn't end with ";" and is not defined, that's why it's not valid.
Jens
PS: Be aware of not writing something like
header("Location: script.php?foo1=a&foo2=b");
or use $amp; in mails, which are send thorugh the PHP-
mail-function.
--- End Message ---
--- Begin Message ---
At 15:22 09.11.2002, @ Edwin said:
--------------------[snip]--------------------
>True. And & IS a valid html. In fact, changing & to & is the only
>way I could pass the xhtml validator. So, it's not really a bug when the
>validator complains about the & sign...
--------------------[snip]--------------------
Right you are (and shame on me).
I just now doublechecked the RFC's - the '&' character is reserved within
HTML, it always starts a character entity, either a named or a numbered one.
So: YOU are right, the W3C Validator was right, and I was simply WRONG -
apologies for any misinformation.
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
--- End Message ---
--- Begin Message ---
Alternatively, you could set php.ini to use the semi-colon (;) to seperate
arguments.
HTH
Brad
"Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
news:Pine.LNX.4.44.0211082246320.2586-100000@;www.lerdorf.com...
> and in your php.ini file add:
>
> arg_separator.output = "&"
>
> On Sat, 9 Nov 2002, Khalid El-Kary wrote:
>
> > hi,
> > just use & instead
> > <a href="mypage.php?name=khalid&age=d"></a>
> >
> >
> >
> >
> >
> > _________________________________________________________________
> > Add photos to your e-mail with MSN 8. Get 2 months FREE*.
> > http://join.msn.com/?page=features/featuredemail
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
--- End Message ---
--- Begin Message ---
PHP$B=i?4http://www.mydomain.com$B$G%;%C%7%g%s$r3+;O$7!"$=$N8e!"(B
(Bhttps://www.mydomain.com/regist.htm$B$X0\F0$7$?$H$-$K!"%;%C%7%g%s$O7QB3$5(B
$B$l$k$N$G$7$g$&$+!)(B
(B
$BJL%5!<%P!<$X0\F0$9$k$H%;%C%7%g%s$O=*N;$9$k$HJ9$-$^$7$?!#%I%a%$%sItJ,$,F1(B
$B$8$G$b(Bhttps://$B$K$J$k$3$H$G!"JL%I%a%$%s$H$7$FG'<1$5$l$k$N$G$O$J$$$+$H?4G[(B
$B$7$F$$$^$9!#$^$@(BSSL Cert$B$rGc$C$F$$$J$$$N$G!"%F%9%H$G$-$J$$$N$G$9!#(B
(B
$B$h$m$7$/$*4j$$CW$7$^$9!#(B
(B
$B:d!!N<2p(B
--- End Message ---
--- Begin Message ---
Hello Edwin,
Thank you for answering my question :
>----- [snip]
> How can I start up this new and recompiled version of PHP???
>[/snip]
That´s all ?? Even for a -"NOT-DSO" but CGI-Installation.???
How can I check that all things were compiled?
Hope for help.
Oliver Etzel
lowcost domains
lowcost serverhousing www.t-host.com
--- End Message ---
--- Begin Message ---
Well, *I think* if you've overwritten the previous files, then you'll be
able to use the new versions.
Try phpinfo() or php -v (or something) and perhaps you'll see if indeed the
new version is running.
- E
<[EMAIL PROTECTED]> wrote:
> Hello Edwin,
> Thank you for answering my question :
>
> >----- [snip]
> > How can I start up this new and recompiled version of PHP???
> >[/snip]
>
> That´s all ?? Even for a -"NOT-DSO" but CGI-Installation.???
> How can I check that all things were compiled?
>
> Hope for help.
>
> Oliver Etzel
>
>
> lowcost domains
> lowcost serverhousing www.t-host.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Hi there,
I have just reinstalled a new PHP version, the 4.2.3.
Before I had the 4.0.6.
I now get the quotes problem in my scripts that connect to the database.
Also the phpMyAdmin gives me errors when I use the ' inside a field in a GUI
select.
Before everything was working fine.
Which parameters could be set to make the scripts work as before?
Cheers
Daniele
--- End Message ---
--- Begin Message ---
Ciao Daniele,
Check this out:
http://ca.php.net/manual/en/ref.info.php#ini.magic-quotes-gpc
Also, programmatically:
http://ca.php.net/manual/en/function.set-magic-quotes-runtime.php
Hope it helps.
Marco
--
------------
php|architect - The magazine for PHP Professionals
The first monthly worldwide magazine dedicated to PHP programmers
Check us out on the web at http://www.phparch.com
On Sat, 2002-11-09 at 09:19, Daniele Baroncelli wrote:
> Hi there,
>
> I have just reinstalled a new PHP version, the 4.2.3.
> Before I had the 4.0.6.
>
>
> I now get the quotes problem in my scripts that connect to the database.
> Also the phpMyAdmin gives me errors when I use the ' inside a field in a GUI
> select.
> Before everything was working fine.
>
> Which parameters could be set to make the scripts work as before?
>
>
> Cheers
>
> Daniele
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
> > Also the phpMyAdmin gives me errors when I use the ' inside a field in a
(BGUI
(B> > select.
(B
(BAnd since you're using 4.2.3, make sure that you've read this as well (if
(Byou haven't yet):
(B
(B http://bugs.php.net/bug.php?id=19404
(B
(B- E
(B
(B...still using 4.2.2...
--- End Message ---
--- Begin Message ---
Hi,
I there anyway to upload entire directory.
--
AKHIL K
200101009
Room No. 15
BH-2
IIIT
--------------------------------------------------------------------------
Look at me. My life has no meaning or direction, and I'm happy
--- End Message ---
--- Begin Message ---
Hi PHP-List,
Oh sorry, more concrete for an easy question:
How can I start up this new and recompiled version of PHP which was
recompiled
-not as a DSO-
but runs PHP as a CGI-Interpreter???
How can I start this fresh and recompiled PHP as a CGI-Interpreter??
How to start and fire up?
Please help.
Oliver Etzel
lowcost domains
lowcost serverhousing www.t-host.com
--- End Message ---
--- Begin Message ---
read the manual regarding the installation of php as cgi. There you will
find the clues. I am not very sure what exactly you meant.
--
Maxim Maletsky
[EMAIL PROTECTED]
On Sat, 9 Nov 2002 15:34:47 +0100 <[EMAIL PROTECTED]> wrote:
> Hi PHP-List,
>
> Oh sorry, more concrete for an easy question:
>
> How can I start up this new and recompiled version of PHP which was
> recompiled
> -not as a DSO-
> but runs PHP as a CGI-Interpreter???
>
> How can I start this fresh and recompiled PHP as a CGI-Interpreter??
>
> How to start and fire up?
> Please help.
>
> Oliver Etzel
> lowcost domains
> lowcost serverhousing www.t-host.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Hi !
Could you write it in english please ?
"Rich" <[EMAIL PROTECTED]> a ecrit dans le message de news:
[EMAIL PROTECTED]
> PHP$B=i?4<T$G$9!#<+J,$J$j$K$$$m$$$m$HD4$Y$F$_$^$7$?$,$o$+$i$J$+$C$?$N$G!"(B
> $B$*CN7C$rGR<Z$5$;$F$/$@$5$$!#(B
>
> $BNc$($P!"(Bhttp://www.mydomain.com$B$G%;%C%7%g%s$r3+;O$7!"$=$N8e!"(B
> https://www.mydomain.com/regist.htm$B$X0\F0$7$?$H$-$K!"%;%C%7%g%s$O7QB3$5(B
> $B$l$k$N$G$7$g$&$+!)(B
>
> $BJL%5!<%P!<$X0\F0$9$k$H%;%C%7%g%s$O=*N;$9$k$HJ9$-$^$7$?!#%I%a%$%sItJ,$,F1(B
> $B$8$G$b(Bhttps://$B$K$J$k$3$H$G!"JL%I%a%$%s$H$7$FG'<1$5$l$k$N$G$O$J$$$+$H?4G[(B
> $B$7$F$$$^$9!#$^$@(BSSL Cert$B$rGc$C$F$$$J$$$N$G!"%F%9%H$G$-$J$$$N$G$9!#(B
>
> $B$h$m$7$/$*4j$$CW$7$^$9!#(B
>
> $B:d!!N<2p(B
>
--- End Message ---
--- Begin Message ---
As this is the industry I am in, maybe I can offer a few hints/suggestions to
start you on your way:
start with the database
- is your user table built (how much information about the user do you need) ?
- are you validating the incoming email address (sending an email to confirm
entry) ?
- are you using a seperate table for storing their selection information ?
- yes, are you storing transactions (logging changes) ?
- no, what happens if they want more than one team ?
- do you have your rules for your game planned out (deadlines, team size,
salary cap) ?
- do you have a support methodology prepared ?
I can answer some generalized questions about methodology of the game (so as
not to violate my employment agreement), and some general programming issues
that you may have.
ps. Just to give you an idea, we maintain a staff of programmers, support
commisioners and system administrators (about 35 people), not to mention
accounting, advertising and graphic development, to run about 40-50 games a
year, including games for USA Today, Excite/iWon and Tops. This development
has been over 10 years going. What I am trying to get at is, are you trying to
make a friendly 'office league' type interface for your friends, or are you
trying to make something alot bigger? Be prepared for everything you could
potentially need for a large operation (did I mention legal department?).
=======================================
Michael Geier
CDM Sports, Inc. Systems Administration
email: [EMAIL PROTECTED]
phone: 314.991.1511 x 6505
Quoting Karl James <[EMAIL PROTECTED]>:
> Jason, I am trying small with forms, reading php
> But I have so many questions that books cant answer sometimes
> Thus the reason I need a guide...
> Would you be able to help me with that?
>
> -----Original Message-----
> From: Jason Wong [mailto:php-general@;gremlins.com.hk]
> Sent: Friday, November 08, 2002 10:14 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Need MENTOR for Fantasy football project
>
> On Saturday 09 November 2002 04:33, Karl James wrote:
> > I have the php bible 4 book but it
> > Doesn't tell you how to do things all the way
> > And still leaves with lots of questions.
>
> Questions such as? If you have fairly specific questions then they are
> usually
> answered quite quickly on this list.
>
> Open-ended requests such as yours, as you've found out for yourself, are
>
> usually ignored.
>
> Honestly it looks as if you're trying to do something beyond your
> current
> capabilities and you don't even know where to begin.
>
> If this is a commercial project just save yourself some grief and pay
> someone
> to do it for you.
>
> Otherwise start small. Try the many tutorials that are available on the
> web,
> learn about how to connect/retrieve/display information from a database,
> how
> to perform user authentication etc. Once you've broadened your knowledge
> you
> may be able to see where the pieces fit together and then you can start
> your
> project.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Innovation is hard to schedule.
> -- Dan Fylstra
> */
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
-----------------------------------------------
This email sent using CDM Sports Webmail v3.1
[ http://webmail.cdmsports.com ]
--- End Message ---
--- Begin Message ---
Hi out there,
I encountered a lot of problems while trying to convert a list
in Forum-Code (like UBB-Code).
[list]
[*] item 1
[*] item 2
[*] item 3
[/list]
should be converted to
<ul>
<li>item 1</li>
<li>item 2</li>
<li>item 3</li>
</ul>
I converted the first one to
<ul>
[*] item 1
[*] item 2
[*] item 3
</ul>
Now I need a Regexp for converting every [*] foo to <li>foo</li>.
I started with
$text = preq_replace('/\[\*\]([^(\[\*\])]*)/i','<li>$1</li>',$text);
The RegExp starts from [*] and saves every char in $1 until [*]
occurs again. That's fine, but what I need is a RegExp which starts
from [*] and saves every char in $1 until [*] OR </ul> occurs in
$text. I tested a lot, but didn't find a solution. I'd be glad about
any help.
Jens
--- End Message ---
--- Begin Message ---
untested:
preq_replace('/\[\*\]([^(\[\*\])(<\/ul>)]*)/i','<li>$1</li>',$text);
Jens Lehmann wrote:
Hi out there,
I encountered a lot of problems while trying to convert a list
in Forum-Code (like UBB-Code).
[list]
[*] item 1
[*] item 2
[*] item 3
[/list]
should be converted to
<ul>
<li>item 1</li>
<li>item 2</li>
<li>item 3</li>
</ul>
I converted the first one to
<ul>
[*] item 1
[*] item 2
[*] item 3
</ul>
Now I need a Regexp for converting every [*] foo to <li>foo</li>.
I started with
$text = preq_replace('/\[\*\]([^(\[\*\])]*)/i','<li>$1</li>',$text);
The RegExp starts from [*] and saves every char in $1 until [*]
occurs again. That's fine, but what I need is a RegExp which starts
from [*] and saves every char in $1 until [*] OR </ul> occurs in
$text. I tested a lot, but didn't find a solution. I'd be glad about
any help.
Jens
--- End Message ---
--- Begin Message ---
That's what I thought, too. But it doesn't work.
test.php:
$text = '<ul> [*] jusfj [*] ijusnf [*] jsf [*] jusdf </ul>';
$text = preg_replace('/\[\*\]([^(\[\*\])(<\/ul>)]*)/i','<li>$1</li>',$text);
$text = htmlentities($text);
Output:
<ul> <li> j</li>usfj <li> ij</li>usnf <li> jsf </li><li> j</li>usdf </ul>
I tested some different things, which didn't work. Any more ideas
are appreciated.
Jens
> untested:
>
> preq_replace('/\[\*\]([^(\[\*\])(<\/ul>)]*)/i','<li>$1</li>',$text);
>
>
>
> Jens Lehmann wrote:
>
> >Hi out there,
> >
> >I encountered a lot of problems while trying to convert a list
> >in Forum-Code (like UBB-Code).
> >
> >[list]
> >[*] item 1
> >[*] item 2
> >[*] item 3
> >[/list]
> >
> >should be converted to
> >
> ><ul>
> ><li>item 1</li>
> ><li>item 2</li>
> ><li>item 3</li>
> ></ul>
> >
> >I converted the first one to
> >
> ><ul>
> >[*] item 1
> >[*] item 2
> >[*] item 3
> ></ul>
> >
> >Now I need a Regexp for converting every [*] foo to <li>foo</li>.
> >
> >I started with
> >
> >$text = preq_replace('/\[\*\]([^(\[\*\])]*)/i','<li>$1</li>',$text);
> >
> >The RegExp starts from [*] and saves every char in $1 until [*]
> >occurs again. That's fine, but what I need is a RegExp which starts
> >from [*] and saves every char in $1 until [*] OR </ul> occurs in
> >$text. I tested a lot, but didn't find a solution. I'd be glad about
> >any help.
> >
> >Jens
> >
--- End Message ---
--- Begin Message ---
At 17:19 09.11.2002, Jens Lehmann said:
--------------------[snip]--------------------
>Hi out there,
>
>I encountered a lot of problems while trying to convert a list
>in Forum-Code (like UBB-Code).
>
>[list]
>[*] item 1
>[*] item 2
>[*] item 3
>[/list]
>
>should be converted to
>
><ul>
><li>item 1</li>
><li>item 2</li>
><li>item 3</li>
></ul>
--------------------[snip]--------------------
Maybe you could use this solution. It supports newlines and special
characters in the item's data as well:
<?php
function ubb2ul($src)
{
// retrieve the items
preg_match('/\[list\]\n?(.*?)\n?\[\/list\]/is', $src, $ar);
// now split the results by (opt) newline, followed by '[*]', (opt)
followed by whitespace
$ar = preg_split('/\n*\s*\[\*\]\s*/s', $ar[1]);
// $ar[0] is empty since the first element begins with a [*], chop
it off
array_shift($ar);
// apply htmlentities
for ($i = 0, $c = count($ar); $i < $c; ++$i)
$ar[$i] = nl2br(htmlentities($ar[$i]));
// finally construct the list
$result = '<ul><li>' . join("\n\t<li>", $ar) . "\n</ul>\n";
return $result;
}
$ubb = '[list]
[*] item 1 äöü line 1
item 1 line 2
[*] item 2
[*] item 3
[/list]';
echo ubb2ul($ubb);
?>
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
--- End Message ---
--- Begin Message ---
On Thu, 7 Nov 2002 11:31:52 -0600, [EMAIL PROTECTED] (Brian Fahrlander) wrote:
OK, thanks for no help whatsoever. But I'm not bitter; I'm here to report what I
found so that the next guy with this problem isn't stuck:
The PHP docs say to change variables in /etc/php.ini (like the whole world knows
about) but the key is to *also* look into php.CONF, too. That's where the problem
was.
And though I don't understand why the second file was there, or why no one piped
up about it, this is the obscure answer to an obscure problem.
------------------------------------------------------------------------
Brian Fahrländer GNU/Linux Zealot, Conservative, and Technomad
Evansville, IN My Voyage: http://www.CounterMoon.com
ICQ 5119262
------------------------------------------------------------------------
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCM d- s:+ a C++ UL+++ P+ L+++ E--- W++ N+ o- K+ w---
O- M- V PS- PE+ Y PGP++ t+ 5 X R- tv++ b- DI++ D+
G++ e h r y++++
------END GEEK CODE BLOCK------
--- End Message ---
--- Begin Message ---
Could someone tell me why isn't this working?
$text = "And what did I tell you?";
list($one,$two,$three,$rest) = preg_split("/\s+/", $text);
print($rest);
The result would be "I" and not "I tell you?"
Why?
--- End Message ---
--- Begin Message ---
list throws away the other two array elements, you need
list($one,$two,$three,$rest) = preg_split("/\s+/", $text, 4);
samug wrote:
Could someone tell me why isn't this working?
$text = "And what did I tell you?";
list($one,$two,$three,$rest) = preg_split("/\s+/", $text);
print($rest);
The result would be "I" and not "I tell you?"
Why?
--- End Message ---
--- Begin Message ---
On Sunday 10 November 2002 00:58, samug wrote:
> Could someone tell me why isn't this working?
>
> $text = "And what did I tell you?";
> list($one,$two,$three,$rest) = preg_split("/\s+/", $text);
> print($rest);
>
> The result would be "I" and not "I tell you?"
> Why?
Because that is what you asked for!
$doo = preg_split("/\s+/", $text);
print_r($doo); // each word is a separate element in $doo.
In your list() you're only taking up to the 4th element which is "I".
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
Something unpleasant is coming when men are anxious to tell the truth.
-- Benjamin Disraeli
*/
--- End Message ---
--- Begin Message ---
Thanks.
But what if you don't know how many elements there will be ahead?
"Samug" <[EMAIL PROTECTED]> kirjoitti viestissä
news:20021109165530.58233.qmail@;pb1.pair.com...
> Could someone tell me why isn't this working?
>
> $text = "And what did I tell you?";
> list($one,$two,$three,$rest) = preg_split("/\s+/", $text);
> print($rest);
>
> The result would be "I" and not "I tell you?"
> Why?
>
>
--- End Message ---
--- Begin Message ---
if you use
list($one,$two,$three,$rest) = preg_split("/\s+/", $text, *4*);
you get the remaining elements in $rest as a single string
samug wrote:
Thanks.
But what if you don't know how many elements there will be ahead?
"Samug" <[EMAIL PROTECTED]> kirjoitti viestissä
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Could someone tell me why isn't this working?
$text = "And what did I tell you?";
list($one,$two,$three,$rest) = preg_split("/\s+/", $text);
print($rest);
The result would be "I" and not "I tell you?"
Why?
--- End Message ---
--- Begin Message ---
At 17:58 09.11.2002, samug said:
--------------------[snip]--------------------
>$text = "And what did I tell you?";
>list($one,$two,$three,$rest) = preg_split("/\s+/", $text);
>print($rest);
>
>The result would be "I" and not "I tell you?"
--------------------[snip]--------------------
Your regex splits the entire string, and since you have only a list of four
elements, the fourth element happens to be the "I".
If you want the rest in $rest, you need a thried parameter to preg_split
telling it how many elements the resulting array should have:
$text = "And what did I tell you?";
list($one,$two,$three,$rest) = preg_split("/\s+/", $text, 4);
print($rest);
will correctly output "I tell you?"
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
--- End Message ---
--- Begin Message ---
At 18:59 09.11.2002, samug said:
--------------------[snip]--------------------
>Thanks.
>But what if you don't know how many elements there will be ahead?
>
>"Samug" <[EMAIL PROTECTED]> kirjoitti viestissä
>news:20021109165530.58233.qmail@;pb1.pair.com...
>> Could someone tell me why isn't this working?
>>
>> $text = "And what did I tell you?";
>> list($one,$two,$three,$rest) = preg_split("/\s+/", $text);
>> print($rest);
--------------------[snip]--------------------
You don't need the number of elements _ahead_, just the number of elements
you want to receive - the "rest" will be in the last element.
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
--- End Message ---
--- Begin Message ---
Hi everybody!
Well this is how it goes...
For the month of January there are 31 days...
so there are 2 rows in this table on the top row there are 31 columns
showing 31 days...and in the row below this one we will have to
generate....colspan based on the below information pulled from the
database...
2222211111111111111999999992222
in the above case we will have to get a colspan as follows:
<tr>
<td colspan="5"> 2 </td>
<td colspan="15"> 1 </td>
<td colspan="8"> 9 </td>
<td>colspan="4"> 2 </td>
</tr>
This is all I want to do....I know it is difficult...but still waiting for
some genius!
Thank You!
Dhaval
_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail
--- End Message ---
--- Begin Message ---
How is your database organized? you might be able to pull this
information from the query by using an appropriate group-by clause.
Marco
--
------------
php|architect - The magazine for PHP Professionals
The first monthly worldwide magazine dedicated to PHP programmers
Check us out on the web at http://www.phparch.com
On Sat, 2002-11-09 at 11:57, Dhaval Desai wrote:
>
>
>
>
> Hi everybody!
>
>
> Well this is how it goes...
>
> For the month of January there are 31 days...
> so there are 2 rows in this table on the top row there are 31 columns
> showing 31 days...and in the row below this one we will have to
> generate....colspan based on the below information pulled from the
> database...
>
> 2222211111111111111999999992222
>
>
> in the above case we will have to get a colspan as follows:
> <tr>
> <td colspan="5"> 2 </td>
> <td colspan="15"> 1 </td>
> <td colspan="8"> 9 </td>
> <td>colspan="4"> 2 </td>
> </tr>
>
>
> This is all I want to do....I know it is difficult...but still waiting for
> some genius!
>
>
> Thank You!
> Dhaval
>
>
> _________________________________________________________________
> Add photos to your messages with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Hi!
Well I have 12 table for 2 years which makes it 24 tables named as:
jan_2002, feb_2002 ...etc dec_2002
jan_2003, feb_2003 ...etc dec_2003
Each table has fields according to the number of days in the month plus 1
field as a unique key.
Each registration will create 1 entry in 24 tables each and it can only be
modified as 1 entry per registrant per table.
the fields in each table will take values ranging rom 1-20.
Well that's all about how my tables are in the database.
Thank You for your time
Dhaval Desai
From: Marco Tabini <[EMAIL PROTECTED]>
To: Dhaval Desai <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
Subject: Re: [PHP] Automatic Colspan from database data
Date: 09 Nov 2002 13:34:20 -0500
How is your database organized? you might be able to pull this
information from the query by using an appropriate group-by clause.
Marco
--
------------
php|architect - The magazine for PHP Professionals
The first monthly worldwide magazine dedicated to PHP programmers
Check us out on the web at http://www.phparch.com
On Sat, 2002-11-09 at 11:57, Dhaval Desai wrote:
>
>
>
>
> Hi everybody!
>
>
> Well this is how it goes...
>
> For the month of January there are 31 days...
> so there are 2 rows in this table on the top row there are 31 columns
> showing 31 days...and in the row below this one we will have to
> generate....colspan based on the below information pulled from the
> database...
>
> 2222211111111111111999999992222
>
>
> in the above case we will have to get a colspan as follows:
> <tr>
> <td colspan="5"> 2 </td>
> <td colspan="15"> 1 </td>
> <td colspan="8"> 9 </td>
> <td>colspan="4"> 2 </td>
> </tr>
>
>
> This is all I want to do....I know it is difficult...but still waiting
for
> some genius!
>
>
> Thank You!
> Dhaval
>
>
> _________________________________________________________________
> Add photos to your messages with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail
--- End Message ---
--- Begin Message ---
Ouch...
well, assuming you have two columns: day_id and value, here's a possible
solution:
$rs = mysql_query ('select day_id, value from my_table order by
day_id');
$a = mysql_fetch_assoc ($rs);
do
{
$i = 1;
$control = $a['value'];
while (($a = mysql_fetch_assoc ($rs)) && $a['value'] == $control)
$i++;
echo '<td colspan=' . $i . '>' . $control . '</td>';
} while ($a);
This is a bit rough and can probably be optimized quite a bit, plus I
can't test it, so I'm not sure that it will work the first time.
Hopefully, it gives you an idea of how it could be done.
If I could make a suggestion without knowing how your system works, I
think you should revisit your database design a little.
Hope this helps,
Marco
--
------------
php|architect - The magazine for PHP Professionals
The first monthly worldwide magazine dedicated to PHP programmers
Check us out on the web at http://www.phparch.com
On Sat, 2002-11-09 at 14:32, Dhaval Desai wrote:
> Hi!
>
> Well I have 12 table for 2 years which makes it 24 tables named as:
> jan_2002, feb_2002 ...etc dec_2002
> jan_2003, feb_2003 ...etc dec_2003
>
> Each table has fields according to the number of days in the month plus 1
> field as a unique key.
>
> Each registration will create 1 entry in 24 tables each and it can only be
> modified as 1 entry per registrant per table.
> the fields in each table will take values ranging rom 1-20.
>
> Well that's all about how my tables are in the database.
>
>
> Thank You for your time
>
> Dhaval Desai
>
>
>
>
>
>
>
>
>
> >From: Marco Tabini <[EMAIL PROTECTED]>
> >To: Dhaval Desai <[EMAIL PROTECTED]>
> >CC: [EMAIL PROTECTED]
> >Subject: Re: [PHP] Automatic Colspan from database data
> >Date: 09 Nov 2002 13:34:20 -0500
> >
> >How is your database organized? you might be able to pull this
> >information from the query by using an appropriate group-by clause.
> >
> >
> >Marco
> >--
> >------------
> >php|architect - The magazine for PHP Professionals
> >The first monthly worldwide magazine dedicated to PHP programmers
> >Check us out on the web at http://www.phparch.com
> >
> >On Sat, 2002-11-09 at 11:57, Dhaval Desai wrote:
> > >
> > >
> > >
> > >
> > > Hi everybody!
> > >
> > >
> > > Well this is how it goes...
> > >
> > > For the month of January there are 31 days...
> > > so there are 2 rows in this table on the top row there are 31 columns
> > > showing 31 days...and in the row below this one we will have to
> > > generate....colspan based on the below information pulled from the
> > > database...
> > >
> > > 2222211111111111111999999992222
> > >
> > >
> > > in the above case we will have to get a colspan as follows:
> > > <tr>
> > > <td colspan="5"> 2 </td>
> > > <td colspan="15"> 1 </td>
> > > <td colspan="8"> 9 </td>
> > > <td>colspan="4"> 2 </td>
> > > </tr>
> > >
> > >
> > > This is all I want to do....I know it is difficult...but still waiting
> >for
> > > some genius!
> > >
> > >
> > > Thank You!
> > > Dhaval
> > >
> > >
> > > _________________________________________________________________
> > > Add photos to your messages with MSN 8. Get 2 months FREE*.
> > > http://join.msn.com/?page=features/featuredemail
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
>
>
> _________________________________________________________________
> STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
> http://join.msn.com/?page=features/junkmail
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Thanks...the thing that I did wrong was I retrieved the number with
FORMAT(SUM(amount), 2), which formats the number and return it in the string
format...so that's what happened during the computation (it only took the
number prior to the ','. I miss the type-checking in C. :-)
Thanks,
-Peter
"@ Edwin" <[EMAIL PROTECTED]> wrote in message
news:20021109134728.65621.qmail@;pb1.pair.com...
> Hello,
>
> "Peter" <[EMAIL PROTECTED]> wrote in message
> news:20021109065959.35268.qmail@;pb1.pair.com...
>
> ...[snip]...
>
> > the result of echo, $tmp is displayed as '0.0002'. What's wrong here?
> The
> > problem only occurs when the value is greater than a 1,000? Could the
','
> > messed the computation up somehow?
>
> I think so because
>
> 1/5000 = 0.0002
>
> (Only the number *before* the ',' is being used.)
>
> Try taking away the ',' then by using str_replace() and calculate again.
>
> - E
>
--- End Message ---
--- Begin Message ---
You're absolutely correct. The script works perfectly fine now, and I have
you to thank. I went back to "Handling file uploads" and re-read the entire
thing. I guess I missed the part that said the following before the actual
script example. My fault and my apologies. Thanks Jason, and thanks to all
the others who replied as well.
"...Whatever the logic, you should either delete the file from the temporary
directory or move it elsewhere."
"The file will be deleted from the temporary directory at the end of the
request if it has not been moved away or renamed."
> -----Original Message-----
> From: Jason Wong [mailto:php-general@;gremlins.com.hk]
> Sent: Saturday, November 09, 2002 5:01 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] HTTP POST FILE UPLOAD HELP - REVISITED
>
>
> On Saturday 09 November 2002 18:39, [EMAIL PROTECTED] wrote:
> > Sorry about that guys, here is a bit more info that might be useful:
> >
> > I forgot to tell you that I'm working on a Windows XP box with
> full rights,
> > which means the default temporary directory is C:\WINDOWS\Temp and there
> > are no limitations on what I can and cannot access on the
> system (running
> > as system administrator). I did change that default to
> C:\PHP\tmp_uploads.
> > I ran this script with the default temp directory as well, same result.
>
> Assuming that you webserver really does have access to write to those
> directories then ...
>
> [snip 'simplified' code]
>
> > Here is what's happening:
> >
> > 2. When the submit button is pushed, the files are uploaded through the
> > form but the temporary file is never created on the system. I
> did a search
> > on the entire C: drive for the temporary file that should have been
> > created, but it's not there.
>
> ... you didn't read the manual like I suggested. Because
> otherwise you'll know
> that "the file will be deleted from the temporary directory at
> the end of the
> request if it has not been moved away or renamed."
>
> If you didn't 'simplify' the example and removed the all
> important copy() or
> move_uploaded_file() then you would have had something that worked!
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Mount St. Helens should have used earth control.
> */
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
I recently updated from 4.2.0 to 4.2.3 - since doing so values submitted
to php from HTML forms using keys - value="foo[bar]" - get truncated in
php - example: if I submit "[EMAIL PROTECTED]" it will come out as
"eight13.com" with a print_r($_POST)
I found these bug reports which say what appears to be the same bug has
been "fixed in CVS":
http://bugs.php.net/bug.php?id=20024
http://bugs.php.net/bug.php?id=19829
I'm wondering where to go from this point. I have a production server
which I need this fixed on.
Is my only choice to checkout the entire branch for the latest version
4.2.x? (I'm assuming its branched - I've not looked at any of this yet)
Is there not a patch? Could I just checkout the applicable files?
http://snaps.php.net/ wasn't avilable at the time of writing this -
possibly it would have given me more information.
Apache 1.3.20
php from source as module
Mandrake 8
--- End Message ---
--- Begin Message ---
I have a link exchange script and I need to rotate the ads each time a page refreshes.
How exactly can I do this?
I have an id field for each ad. How could I display a different ad each time the page
refreshes using the id field?
Thanks,
Stephen Craton
http://www.melchior.us
"Life is a gift from God. Wasting it is like destroying a gift you got from the person
you love most." -- http://www.melchior.us
--- End Message ---
--- Begin Message ---
I have a link exchange script and I need to rotate the ads each time a page refreshes.
How exactly can I do this?
I have an id field for each ad. How could I display a different ad each time the page
refreshes using the id field?
Thanks,
Stephen Craton
http://www.melchior.us
"Life is a gift from God. Wasting it is like destroying a gift you got from the person
you love most." -- http://www.melchior.us
--- End Message ---
--- Begin Message ---
you can use SQL:
SELECT id, url, image FROM tblAdds ORDER BY RAND() LIMIT 1
I think thats just about it, that should evenly show them, if you want to
bias the displying of your ads you would need to get a count of the ads in
the DB, then use some random number generated from PHP to chose which to
use.
Andrew
----- Original Message -----
From: "Stephen" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Saturday, November 09, 2002 7:45 PM
Subject: [PHP] Rotating Ads
I have a link exchange script and I need to rotate the ads each time a page
refreshes. How exactly can I do this?
I have an id field for each ad. How could I display a different ad each time
the page refreshes using the id field?
Thanks,
Stephen Craton
http://www.melchior.us
"Life is a gift from God. Wasting it is like destroying a gift you got from
the person you love most." -- http://www.melchior.us
--- End Message ---
--- Begin Message ---
The fastest way to do this is very simple :
store the last Id of your banner , get another from your SQL table (with
rand) and display it (repeat if the Id is the same)..
And, in your html page, add a refresh=xx to refresh the ad page.
Regards,
P.E. Baroiller
"Stephen" <[EMAIL PROTECTED]> a écrit dans le message de news:
001901c28827$d69d72a0$[EMAIL PROTECTED]
I have a link exchange script and I need to rotate the ads each time a page
refreshes. How exactly can I do this?
I have an id field for each ad. How could I display a different ad each time
the page refreshes using the id field?
Thanks,
Stephen Craton
http://www.melchior.us
"Life is a gift from God. Wasting it is like destroying a gift you got from
the person you love most." -- http://www.melchior.us
--- End Message ---
--- Begin Message ---
I am using the header function what i have is this:
header("Location:
http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/".$relative_url
$relative_url is a php file
when i run this script with this header function in
it, i get an error saying:"Redirection limit for this
URL has exceeded. Unable to load the requested page."
I dont understand why i get this error and how to fix
this.
Ben
__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2
--- End Message ---
--- Begin Message ---
The file loading may be too long for PHP to recognize it or whatever. Try
shortening it in some way.
----- Original Message -----
From: "Donahue Ben" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, November 09, 2002 2:47 PM
Subject: [PHP] header function
> I am using the header function what i have is this:
>
> header("Location:
>
http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/".$relative_u
rl
>
> $relative_url is a php file
>
> when i run this script with this header function in
> it, i get an error saying:"Redirection limit for this
> URL has exceeded. Unable to load the requested page."
>
> I dont understand why i get this error and how to fix
> this.
>
> Ben
>
> __________________________________________________
> Do you Yahoo!?
> U2 on LAUNCH - Exclusive greatest hits videos
> http://launch.yahoo.com/u2
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
At 20:47 09.11.2002, Donahue Ben said:
--------------------[snip]--------------------
>I am using the header function what i have is this:
>
>header("Location:
>http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/".$relative_url
>
>$relative_url is a php file
>
>when i run this script with this header function in
>it, i get an error saying:"Redirection limit for this
>URL has exceeded. Unable to load the requested page."
--------------------[snip]--------------------
This message might mean that $relative_url points to the same script...
what browser make&model are you using? IE simply loops, without any error.
A small glitch: in case dirname($_SERVER['PHP_SELF']) is empty (root
directory), your header would look as:
http://www.yourdomain.com//relative.php
Note the double slash...
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
--- End Message ---
--- Begin Message ---
I wonder if there is a way to get the files names in a given directory.
--- End Message ---
--- Begin Message ---
Try readdir()
http://www.php.net/manual/en/function.readdir.php
Marco
--
------------
php|architect - The magazine for PHP Professionals
The first monthly worldwide magazine dedicated to PHP programmers
Check us out on the web at http://www.phparch.com
On Sat, 2002-11-09 at 15:01, Mohd_Q wrote:
> I wonder if there is a way to get the files names in a given directory.
>
--- End Message ---
--- Begin Message ---
use opendir() , and readdir()..
you'll get a var like $file,
then check is_file($file) to see if it's a file :)
(take a look at the php doc.)
"Mohd_q" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
I wonder if there is a way to get the files names in a given directory.
--- End Message ---
--- Begin Message ---
Yeah, spend a milisecond looking at the manual, and you'll find
"Filesystem Functions"
Mohd_Q wrote:
I wonder if there is a way to get the files names in a given directory.
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--- End Message ---
--- Begin Message ---
I updated my development-server
--> FreeBSD 4.7-REALEASE, Apache/1.3.27 (Port-Build), PHP 4.2.3
(Port-Build) ...]
After this I found
http://www.php.net/manual/en/ref.errorfunc.php#ini.docref-root
In the manual. I downloaded the manual and changed some config-item
[httpd.conf]
Alias /manual/ "/XXXXX/XXXX/manual/"
[php.ini]
docref_roof = /manual/php4_manual
docref_ext = .html
But I noticed no changes!
- is this a future of php ?.?.? ??
- are some configure options needed for the build?
- is it useful, how does it look like?
[some more options out php.ini]
error_reporting = E_ALL
display_errors = On
log_errors = On
html_errors = On
error_log = "/XXXXXX/YYYYYYYYY/ZZZZZ/php.err"
docref_roof = /manual/php4_manual
docref_ext = .html
Best regards
Stefan Schiller
--- End Message ---
--- Begin Message ---
On Tue, 5 Nov 2002 [EMAIL PROTECTED] wrote:
> Can anybody tell me if PHP 4.3.0 will use Zend Engine 2?
Hi,
The Zend Engine 2 is likely to appear officially only in PHP 5.
However, I have released a couple of alphas with the Engine 2 bundled
against the latest CVS of PHP (i.e. almost PHP 4.3.0).
Hopefully within the next few weeks I'll bundle another alpha based on the
latest version of the engine 2 and the latest CVS version.
Andi
--- End Message ---
--- Begin Message ---
"Ernest E Vogelsinger" <[EMAIL PROTECTED]> wrote in message
news:5.1.1.6.2.20021108175627.00b44880@;mail.vogelsinger.at...
>
> This is clearly said in your PHP.ini file:
>
> ; Whether to enable the ability to force arguments to be passed by
reference
> ; at function call time. This method is deprecated and is likely to be
> ; unsupported in future versions of PHP/Zend. The encouraged method of
> ; specifying which arguments should be passed by reference is in the
function
> ; declaration. You're encouraged to try and turn this option Off and make
> ; sure your scripts work properly with it in order to ensure they will
work
> ; with future versions of the language (you will receive a warning each
time
> ; you use this feature, and the argument will be passed by value instead
of by
> ; reference).
> allow_call_time_pass_reference = On
>
> ...god has spoken :)
yup that's one hell of an argument :)
>
> I'd rather have the abilty to pass A reference like "foo(&$a)" and have
the
> opportunity to choose at runtime if I want to use a reference here or not,
> but it's how they say...
>
>
> --
> >O Ernest E. Vogelsinger
> (\) ICQ #13394035
> ^ http://www.vogelsinger.at/
>
--- End Message ---
--- Begin Message ---
Hi all. I was wondering if there are resources on the
web that will help me get an
idea of the changes and new features that will be in
php5.
I'm particularly interested in what's gonna be added
or changed to php in regards to
its OOP capabilities.
I already love this language. I'm just looking
forward to seeing in what areas it is going to be made
even better.
tia,
--ed
__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2
--- End Message ---
--- Begin Message ---
Hi all. I was wondering if there are resources on the
web that will help me get an
idea of the changes and new features that will be in
php5.
I'm particularly interested in what's gonna be added
or changed to php in regards to
its OOP capabilities.
I already love this language. I'm just looking
forward to seeing in what areas it is going to be made
even better.
tia,
--ed
__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2
--- End Message ---
--- Begin Message ---
Try searching the list archives, particularly of PHP-DEV lists (but
hesitate asking these questions there)
--
Maxim Maletsky
[EMAIL PROTECTED]
On Sat, 9 Nov 2002 13:27:05 -0800 (PST) ed <[EMAIL PROTECTED]> wrote:
> Hi all. I was wondering if there are resources on the
> web that will help me get an
> idea of the changes and new features that will be in
> php5.
> I'm particularly interested in what's gonna be added
> or changed to php in regards to
> its OOP capabilities.
>
> I already love this language. I'm just looking
> forward to seeing in what areas it is going to be made
> even better.
>
> tia,
> --ed
>
>
>
> __________________________________________________
> Do you Yahoo!?
> U2 on LAUNCH - Exclusive greatest hits videos
> http://launch.yahoo.com/u2
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Is there any way to gracefully handle errors that happen after output to the
screen has begun (the point where header(Location:) doesn't work) without
using ob_ functions?
I have a separate PHP page I'd like to display with the error if one happens
using the error_handler() and trigger_error() functions. But, I can't make
it work because if the error happens after output starts, I just get an
error stating header() won't work.
I'm also not sure of the best way to pass all the error data to the error
page. Its too much for a $_GET.
Anyone have any suggestions or links to articles that explain how this can
be done?? Thanks a lot.
Monty
--- End Message ---
--- Begin Message ---
Just turn off display_errors in your php.ini file
On Sat, 9 Nov 2002, Monty wrote:
> Is there any way to gracefully handle errors that happen after output to the
> screen has begun (the point where header(Location:) doesn't work) without
> using ob_ functions?
>
> I have a separate PHP page I'd like to display with the error if one happens
> using the error_handler() and trigger_error() functions. But, I can't make
> it work because if the error happens after output starts, I just get an
> error stating header() won't work.
>
> I'm also not sure of the best way to pass all the error data to the error
> page. Its too much for a $_GET.
>
> Anyone have any suggestions or links to articles that explain how this can
> be done?? Thanks a lot.
>
> Monty
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
I think the only way to do it the way you want to do it is through
buffering (with the ob_functions or via the php.ini file). Turning off
error printing is another possibility--that way you can have the errors
logged to a file rather than to the screen.
Marco
--
------------
php|architect - The magazine for PHP Professionals
The first monthly worldwide magazine dedicated to PHP programmers
Check us out on the web at http://www.phparch.com
On Sat, 2002-11-09 at 17:42, Monty wrote:
> Is there any way to gracefully handle errors that happen after output to the
> screen has begun (the point where header(Location:) doesn't work) without
> using ob_ functions?
>
> I have a separate PHP page I'd like to display with the error if one happens
> using the error_handler() and trigger_error() functions. But, I can't make
> it work because if the error happens after output starts, I just get an
> error stating header() won't work.
>
> I'm also not sure of the best way to pass all the error data to the error
> page. Its too much for a $_GET.
>
> Anyone have any suggestions or links to articles that explain how this can
> be done?? Thanks a lot.
>
> Monty
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
At 23:42 09.11.2002, Monty said:
--------------------[snip]--------------------
>Is there any way to gracefully handle errors that happen after output to the
>screen has begun (the point where header(Location:) doesn't work) without
>using ob_ functions?
>
>I have a separate PHP page I'd like to display with the error if one happens
>using the error_handler() and trigger_error() functions. But, I can't make
>it work because if the error happens after output starts, I just get an
>error stating header() won't work.
>
>I'm also not sure of the best way to pass all the error data to the error
>page. Its too much for a $_GET.
--------------------[snip]--------------------
One way, as you just have ruled out, would be using the ob_ functions.
However you can redirect the browser using JavaScript, with the drawback
that this will only work with compliant clients and JS not disabled.
Passing data to the error page could be done by using session data, or if
you don't want to use sessions, create a temp file and pass the name and
location to the error page.
Sending the javascript:
<?php
if ($we_found_an_error) {
$url = 'http://' . $_SERVER['SERVER_NAME'] .
'/my_error_handler.php?any_parameters_you_need';
echo '<script language="JavaScript">',
'document.location.href="', $url, '">',
'</script>',
'<hr>',
'A nasty error has occurred. If you are not redirected ',
'to the correct page, <a href="',$url,'">click here</a> to',
'continue (sorry folks)';
}
// else no error - continue
?>
Hope this helps,
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
--- End Message ---
--- Begin Message ---
At 23:57 09.11.2002, Ernest E Vogelsinger said:
--------------------[snip]--------------------
><?php
>if ($we_found_an_error) {
> $url = 'http://' . $_SERVER['SERVER_NAME'] .
> '/my_error_handler.php?any_parameters_you_need';
> echo '<script language="JavaScript">',
> 'document.location.href="', $url, '">',
> '</script>',
> '<hr>',
> 'A nasty error has occurred. If you are not redirected ',
> 'to the correct page, <a href="',$url,'">click here</a> to',
> 'continue (sorry folks)';
// I FORGOT THIS LINE...
exit;
>}
>// else no error - continue
>
>?>
--------------------[snip]--------------------
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
--- End Message ---
--- Begin Message ---
Ok, it's late, and my last post for today, but I need to get this right ;-)
<?php
if ($we_found_an_error) {
$url = 'http://' . $_SERVER['SERVER_NAME'] .
'/my_error_handler.php?any_parameters_you_need';
echo '<script language="JavaScript">',
'document.location.href="', $url, '">',
'</script>',
'<hr>',
'A nasty error has occurred. If you are not redirected ',
'to the correct page, <a href="',$url,'">click here</a> to',
'continue (sorry folks)',
'</script></body></html>';
exit;
}
// else no error - continue
?>
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
--- End Message ---
--- Begin Message ---
imho there are many problems with a handler of this type... since an
error could occur anywhere--in the middle of an HTML tag, or within a
block of client-side script code--you don't know for sure that the
Javascript is going to be interpreted properly by the browser...and
therefore it may look messy and/or not work at all.
Marco
--
------------
php|architect - The magazine for PHP Professionals
The first monthly worldwide magazine dedicated to PHP programmers
Check us out on the web at http://www.phparch.com
On Sat, 2002-11-09 at 18:05, Ernest E Vogelsinger wrote:
> Ok, it's late, and my last post for today, but I need to get this right ;-)
>
> <?php
> if ($we_found_an_error) {
> $url = 'http://' . $_SERVER['SERVER_NAME'] .
> '/my_error_handler.php?any_parameters_you_need';
> echo '<script language="JavaScript">',
> 'document.location.href="', $url, '">',
> '</script>',
> '<hr>',
> 'A nasty error has occurred. If you are not redirected ',
> 'to the correct page, <a href="',$url,'">click here</a> to',
> 'continue (sorry folks)',
> '</script></body></html>';
> exit;
> }
> // else no error - continue
>
> ?>
>
> --
> >O Ernest E. Vogelsinger
> (\) ICQ #13394035
> ^ http://www.vogelsinger.at/
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Hey Guys,
Can anyone please point me to any URLs or give me some code which will loop
through form fields and delete the particular file which is passed from the
form. The user will click a checkbox next to each file needed deleting and
we must perform a unlink() to each file.
Thanks.
--- End Message ---
--- Begin Message ---
Well I tried that, however I was saving dynamically generated .XLS files.
Because I was using addslashes before hand it was reporting the wrong file
size.
So it was my mistake, thanks for your help!
Regards,
Ian Newlands
"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:200211091639.43919.php-general@;gremlins.com.hk...
> On Saturday 09 November 2002 14:22, Ian Newlands wrote:
> > Does anyone know of a function, or a method to calculate how many bytes
are
> > in a string? Similar to the filesize file system function.
> >
> > Any help would be appreciated.
>
> Assuming 1 character = 1 byte, then strlen().
--- End Message ---
--- Begin Message ---
This was exactly what I was trying to avoid. See I was porting a reporting
module to write .XLS files to a database, rather than to files. It's easier
for me to clean up old reports that way.
Anyway, thanks for your help!
Regards,
Ian Newlands
"@ Edwin" <[EMAIL PROTECTED]> wrote in message
news:OE54PDGNZzahL7szm8x00001367@;hotmail.com...
> Or,
>
> "Jason Wong" <[EMAIL PROTECTED]> wrote:
>
> > On Saturday 09 November 2002 14:22, Ian Newlands wrote:
> > > Does anyone know of a function, or a method to calculate how many
bytes
> are
> > > in a string? Similar to the filesize file system function.
> > >
> > > Any help would be appreciated.
> >
> > Assuming 1 character = 1 byte, then strlen().
> >
>
> Just write the string to a file first then check the filesize. This should
> work (I think)
> even if you're dealing with multi-byte characters wherein 1 character = 2
> bytes
> (or more?).
>
> There's mb_strlen() but I don't think it'll be useful though...
>
> - E
--- End Message ---
--- Begin Message ---
I've run into a problem with an include file that I can't figure out why it's
happening.
Certain text files on my site are rather long. Originally, when these pages
loaded, the menu structure would load first, followed by the text in a box
to the right of the Menu. However, the long text files would load over on
top of the menu, but once the loading was complete, the text box would shift
to its proper position. Very messy looking!
What I have done successfuly on about twelve different files, is to put the
include statement at the very end, after the final closing </div>and before
</body>. For all files but two, this works admirably.
On these errant last two files (they have the same div sheet and include
file, but exhibit very different behavior), the text loads fine, but then the
menu overlays upon it - contrary to what the div sheet says. If I put the
include in the 'normal' place at the top of the file, everything works OK.
I've tried resetting the names of both the div sheet and the links sheet (the
Menu) so that both are executed only once and only by the page in question.
No change -- same effect.
Snippet of 'Normal' placement:
. . .
<body>
<?php include("links-infoSub.sht"); ?>
<div id="content">
. . .
Snippet of 'End' placement:
. . .
</div>
<?php include("links-infoSub.sht"); ?>
</body>
</html>
Any ideas of what's going wrong? And why only these two files exhibit this
behavior? Btw, the code of the two pages is exactly similar to all others
that work OK. (Only the text is changed).
Any help of what might be happening here would be greatly appreciated,
Tia,
Andre
--- End Message ---
--- Begin Message ---
hi,
did any one face a prob when session vars get mixed from a website to
another when you use the same browser window ?
_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus
--- End Message ---