|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 18 Feb 2004 11:45:03 -0000 Issue 2597
php-general-digest-help
lists.php.net
Date: Wed Feb 18 2004 - 05:45:03 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 18 Feb 2004 11:45:03 -0000 Issue 2597
Topics (messages 178039 through 178091):
Re: post variables (SpamEnder: BLOCKED 8BZF-SE44074-lgonze
panix.com) (fwd)
178039 by: Chris W. Parker
Re: how to deal with http and https directory structures?
178040 by: Adam Bregenzer
178090 by: Ford, Mike [LSS]
Re: Split()
178041 by: Adam Bregenzer
178048 by: Jochem Maas
178052 by: Adam Bregenzer
PHP4 vs. PHP5 test case for objects question.....
178042 by: Richard Gintz
178051 by: Adam Bregenzer
Re: post variables
178043 by: julian haffegee
178045 by: Chris Shiflett
Javascript array [] length is undefined when only single element
178044 by: Daevid Vincent
178046 by: Adam Bregenzer
178091 by: Ford, Mike [LSS]
Re: Problems with authentication (I think)
178047 by: Leif Gregory
Re: Parse error
178049 by: Jochem Maas
tmp_dir
178050 by: ajay
178053 by: Gerard Samuel
178054 by: Martin Towell
Re: [ANNOUNCE] :Possibility of SA PHP conference
178055 by: Jakes
redirecting
178056 by: ajay
178058 by: - Edwin -
178062 by: John Nichel
178065 by: Ian Firla
178080 by: adwinwijaya
mem
178057 by: John Taylor-Johnston
178059 by: - Edwin -
178060 by: Gerard Samuel
178061 by: John Taylor-Johnston
178063 by: - Edwin -
178064 by: Gerard Samuel
178066 by: Ian Firla
178069 by: John Taylor-Johnston
178070 by: John Taylor-Johnston
change array
178067 by: Max
Re: Check to remove file that are older than 1 week
178068 by: Ian Firla
Re: problems with spam
178071 by: David Robley
Re: [PHP-WIN] Re: [PHP] Replace of ' in a query
178072 by: Svensson, B.A.T. (HKG)
query returns 0 when it shouldnt
178073 by: bob pilly
Some simple questions about Zend
178074 by: Berend Dekens
Recursive Select Box
178075 by: Matt Palermo
178084 by: Jakes
Internationalization performance
178076 by: Arnout Standaert
About Classes and Scope
178077 by: Nick Wilson
178078 by: Nick Wilson
FTP (via firewall)
178079 by: Tommi Virtanen
178082 by: Jason Wong
178083 by: Tommi Virtanen
htmlspecialchars... or...?
178081 by: Tristan.Pretty.risk.sungard.com
178085 by: "Miguel J. Jiménez"
Re: mail()
178086 by: Juan Torres
PDF
178087 by: Juan Torres
Re: UK Postcodes Format
178088 by: Ford, Mike [LSS]
Re: Class rules
178089 by: Ford, Mike [LSS]
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Lucas Gonze <mailto:lgonze
panix.com>
on Tuesday, February 17, 2004 2:00 PM said:
> Is it possible to ban subscribers who issue this kind of
> auto-response?
i just wish people were smart enough to understand that no one cares
about the spam in the other persons mailbox. we only care about the spam
in our own. in this case people shouldn't use any spam filtering
techniques that adversely affect other people, or require interaction on
the part of the sender.
i think he'll ban himself considering it says you won't be given another
opportunity to return his confirmation email.
chris.
attached mail follows:
On Tue, 2004-02-17 at 18:39, Chris W. Parker wrote:
> http root:
> /home/cparker/www/domain.com/http/
>
> https root:
> /home/cparker/www/domain.com/https/
>
> includes directory:
> /home/cparker/www/domain.com/includes/
>
> this way i don't have to worry about symlinks or keeping two separate
> and identical directory trees up to date (if i chose to put the includes
> within each directory).
I think this is the best solution, it is very similar to how I implement
virtual hosting.
--
Adam Bregenzer
adam
bregenzer.net
http://adam.bregenzer.net/
attached mail follows:
On 17 February 2004 23:40, Chris W. Parker contributed these pearls of wisdom:
>
> http root:
> /home/cparker/www/domain.com/http/
>
> https root:
> /home/cparker/www/domain.com/https/
>
> includes directory:
> /home/cparker/www/domain.com/includes/
>
> this way i don't have to worry about symlinks or keeping two
> separate and identical directory trees up to date (if i chose
> to put
> the includes
> within each directory).
This is how I'd do it. And this way the includes directory would be completely outside both webroots, so no chance of them being served up by accident!
Cheers!
Mike
--
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
On Tue, 2004-02-17 at 15:22, Jochem Maas wrote:
> $applePie = array(1,2,3,4,5,6,7,8);
>
> while ($pieceOfPie = array_shift($applePie)) {
> echo $pieceOfPie; // want some pie?
> }
Careful, that will eat your array as well. When the while loop finishes
you won't have any pieces of pie left!
IE:
$applePie = array(1,2,3,4,5,6,7,8);
while ($pieceOfPie = array_shift($applePie)) {
echo $pieceOfPie; // want some pie?
}
// Both of these are now true:
$applePie == array();
$applePie != array(1,2,3,4,5,6,7,8);
-Adam
--
Adam Bregenzer
adam
bregenzer.net
http://adam.bregenzer.net/
attached mail follows:
Adam Bregenzer wrote:
> On Tue, 2004-02-17 at 15:22, Jochem Maas wrote:
>
>>$applePie = array(1,2,3,4,5,6,7,8);
>>
>>while ($pieceOfPie = array_shift($applePie)) {
>> echo $pieceOfPie; // want some pie?
>>}
>
>
> Careful, that will eat your array as well. When the while loop finishes
> you won't have any pieces of pie left!
that was the idea: you can't have your pie at eat it right? ;-)
seriously thought, John Taylor-Johnston was asking for help on while
loops and I thought I'd give him some brainfood (i.e. a little
optimalization thrown in). besides which how many times have we in our PHP
careers not created arrays just to loop over them once, outputting each
item?
>
> IE:
> $applePie = array(1,2,3,4,5,6,7,8);
>
> while ($pieceOfPie = array_shift($applePie)) {
> echo $pieceOfPie; // want some pie?
> }
>
> // Both of these are now true:
> $applePie == array();
> $applePie != array(1,2,3,4,5,6,7,8);
>
> -Adam
>
attached mail follows:
On Tue, 2004-02-17 at 22:28, Jochem Maas wrote:
> that was the idea: you can't have your pie at eat it right? ;-)
Heh, I thought you might have done that deliberately. :)
> seriously thought, John Taylor-Johnston was asking for help on while
> loops and I thought I'd give him some brainfood (i.e. a little
> optimalization thrown in). besides which how many times have we in our PHP
> careers not created arrays just to loop over them once, outputting each
> item?
Oh yeah, that's one side effect of PHP, you completely forget about:
memory and garbage collection concerns.
--
Adam Bregenzer
adam
bregenzer.net
http://adam.bregenzer.net/
attached mail follows:
I ran a test on the same machine for php4(port 80) vs. php5(port 8080).
Using the exact same code, I created 50 objects. It took twice as long in php5 as it did in the older php4.
I then ran a test to access a property of the class using a method of the class. Again, php5 was almost exactly twice as slow as php4.
Is it possible that php5 (I'm using the latest beta) is somehow compiled with extra debugging code or something like that? I was under the impression that php5 was going to better handle objects. Does this mean that it might be "better" but also slower? My biggest problem right now with PHP5 is that creating and using objects is pretty darn slow.
I'm a tad discouraged with these results.
Is there anything in the php.ini file that might be "tunable" for performance considerations?
Any help would be appreciated.
Thanks,
Dick
attached mail follows:
Richard,
On Tue, 2004-02-17 at 19:25, Richard Gintz wrote:
> Using the exact same code, I created 50 objects. It took twice as
> long in php5 as it did in the older php4.
>From what I remember the speed improvement with objects in PHP 5 was
that they would be passed by reference, which I understand to be the
case. Try passing an object to a function, modifying it, then returning
it and echoing the result. I was surprised however to hear that you
found PHP 5 to be slower, I would be interested in any benchmarking
results you have. I also decided to do a quick test.
I wanted to test some decent sized classes so I used some I have written
already. Each class inherits from the one above it (names have been
changed to protect the innocent), therefore Class is a sub-class of
ClassData, etc. up to Object. Here is the wc output for the class
files:
43 200 1355 Object.php
190 533 5311 ClassBase.php
428 1554 15648 ClassData.php
481 1274 18831 Class.php
1142 3561 41145 total
Here is the script I tested with:
<?php
include_once('Object.php');
include_once('ClassBase.php');
include_once('ClassData.php');
include_once('Class.php');
function getmicrotime() {
list($usec, $sec) = explode(' ', microtime());
return ((float)$usec + (float)$sec);
}
$script_start = getmicrotime();
for ($x = 0; $x < 100000; $x++)
$a = new Class();
echo 'Script Time: ' . sprintf('%.4f',(getmicrotime() - $script_start))
. "\n";
?>
I tried to measure only the execution time of creating 100,000 objects
as accurately as possible. Creating them in an array would have been
interesting as well, but rather memory intensive, so I decided against
it. Another note is that I did run PHP 5 in cli mode only. I installed
both copies of php as well as apache2 and Turck MM Cache through emerge
on a Gentoo system. They were compiled from source but I did not change
their optimizations from the default. Since this is a testing box PHP
is installed with pretty much everything. Disclaimers aside, below is
what I found.
PHP 4.3.4 and apache2:
Script Time: 16.0964
Script Time: 16.0322
Script Time: 16.0289
Script Time: 16.0710
Script Time: 16.0306
Average: 16.0518
PHP 4.3.4 and apache2 with Turck MMCache v2.4.6:
Script Time: 15.1848
Script Time: 15.2146
Script Time: 15.2527
Script Time: 15.2354
Script Time: 15.2507
Average: 15.2276
PHP 5.0.0RC1-dev (cli):
Script Time: 15.2346
Script Time: 15.2254
Script Time: 15.2538
Script Time: 15.2414
Script Time: 15.2554
Average: 15.2421
PHP 4 is a bit slower than PHP 5, however with an optimizer it comes to
be about the same, maybe a touch faster. If/when a PHP 5 optimizer
comes out this may change some. I hope to run more benchmarks as I have
time. Also, PHP 5 is still in Beta, and this is not even the latest
version.
Regards,
Adam
--
Adam Bregenzer
adam
bregenzer.net
http://adam.bregenzer.net/
attached mail follows:
Hi Richard
yes it happens in Netscape 7 too,
The thing is, it works in perl when I access the query string. But not in
php.
could it be a setting in php.ini?
Jules
----- Original Message -----
From: "Richard Davey" <rich
launchcode.co.uk>
To: "julian haffegee" <jules
killi.co.uk>
Cc: "Php-General
Lists.Php.Net" <php-general
lists.php.net>
Sent: Tuesday, February 17, 2004 11:22 PM
Subject: Re: [PHP] post variables
> Hello julian,
>
> Tuesday, February 17, 2004, 9:20:58 PM, you wrote:
>
> jh> I am having a nightmare accessing my POST variables. I can red them if
I use
> jh> the GET method on my form, but POST is always blank
>
> A *lot* of people are reporting this as of late and I'm beginning to
> wonder what the true cause is. I noticed that the latest security fix
> from Microsoft to IE broke several high profile sites - do you get
> this on IE or does it happen with Mozilla too? Do you have any
> firewall software installed too?
>
attached mail follows:
--- julian haffegee <jules
killi.co.uk> wrote:
> Hi Richard
>
> yes it happens in Netscape 7 too,
>
> The thing is, it works in perl when I access the query string. But not
> in php.
>
> could it be a setting in php.ini?
Do you have a way to capture the raw HTTP? I'd like to see:
1. The HTTP Request
2. The output of print_r($_POST)
3. What Web server you're using (and version)
With this, I feel certain that we can figure something out.
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security - O'Reilly
Coming mid-2004
HTTP Developer's Handbook - Sams
http://httphandbook.org/
PHP Community Site
http://phpcommunity.org/
attached mail follows:
Okay kids. Here's another strange one. Very simple form. The array is
dynamically generated from PHP as per the suggested method:
http://us2.php.net/manual/en/faq.html.php#faq.html.arrays
However, when there is only a single element, the myMultiSelect.length is
undefined in javascript.
If there are two or more elements, then the length works as expected...
---------------------- snip ----------------------
<SCRIPT>
function checkAudits()
{
var theForm = document.AddSchedule;
var myMultiSelect = theForm['RunVuln[]'];
// this doesn't work either.
//var a = document.forms[0].elements['RunVuln[]'].length;
//alert("a: " + a);
selectedAudits = 0;
for(i = 0; i < myMultiSelect.length; i++)
if (myMultiSelect[i].checked) selectedAudits++;
alert("selectedAudits: "+selectedAudits+" myMultiSelect.length:
"+myMultiSelect.length);
if (selectedAudits < 1)
{
alert("You must select at least one.");
return false;
}
return true;
}
</SCRIPT>
<FORM ACTION="/poop.php" METHOD=POST NAME="AddSchedule">
<input type=checkbox name="RunVuln[]" value="foo"> foo <BR>
<!-- uncomment this line and it works. with it commented, the length
is undefined. WTF?!
<input type=checkbox name="RunVuln[]" value="bar"> bar <BR>
-->
<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE="Update Selections"
onClick='return checkAudits();'>
</FORM>
attached mail follows:
On Tue, 2004-02-17 at 20:21, Daevid Vincent wrote:
> Okay kids. Here's another strange one. Very simple form. The array is
> dynamically generated from PHP as per the suggested method:
> http://us2.php.net/manual/en/faq.html.php#faq.html.arrays
>
> However, when there is only a single element, the myMultiSelect.length is
> undefined in javascript.
> If there are two or more elements, then the length works as expected...
This is a javascript question not a PHP question, but how about:
selectedAudits = 0;
if (myMultiSelect.length) {
for(i = 0; i < myMultiSelect.length; i++)
if (myMultiSelect[i].checked) selectedAudits++;
} else {
if (myMultiSelect.checked) selectedAudits++;
}
--
Adam Bregenzer
adam
bregenzer.net
http://adam.bregenzer.net/
attached mail follows:
On 18 February 2004 01:21, Daevid Vincent contributed these pearls of wisdom:
> Okay kids. Here's another strange one. Very simple form. The
> array is dynamically generated from PHP as per the suggested
> method:
> http://us2.php.net/manual/en/faq.html.php#faq.html.arrays
>
> However, when there is only a single element, the
> myMultiSelect.length is
> undefined in javascript.
> If there are two or more elements, then the length works as
> expected...
Correct. If there is only a single element with a name, JavaScript creates a single scalar checkbox property with that name; if there are multiple elements with the same name, it creates an array of those elements as that property. The existence of the '[]' in the element name has no significance for JavaScript -- it goes solely on how many of the elements there are.
Checking whether the .length property exists is one way of telling whether you have a single element or multiple ones!
Cheers!
Mike
--
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
Hello Comex,
Tuesday, February 17, 2004, 11:15:07 AM, you wrote:
C> What does phpinfo say?
It says tons of stuff. Anything in particular I should be looking
for?
Cheers,
Leif Gregory
--
TB Lists Moderator (and fellow registered end-user)
PCWize Editor / ICQ 216395 / PGP Key ID 0x7CD4926F
Web Site <http://www.PCWize.com>
attached mail follows:
T_VARIABLE refers to a variable token (e.g. $foo) found in your file
when the PHP parser was expecting something else.
the very common typo; e.g.: (note the end of line 3 below)
<?
$foo = 'hello world';
echo $foo
$bar = $foo;
?>
PHP parser token overview:
http://www.phpbuilder.com/manual/tokens.php
Stuart wrote:
> Rolf van de Krol wrote:
>
>> Does anybody know what this error can meen?
>> Parse error: parse error, unexpected T_VARIABLE in
>> /www/htdocs/rolfvand/thinkquest/browsercheck.php on line 46
>> What is a T_VARIABLE?
>
>
> Could be an unclosed quote, or a number of other things. Post a few
> lines around line 46 and we can probably help.
>
> T_VARIABLE is PHPs internal representation of a variable (I could be
> wrong).
>
attached mail follows:
hi!
i suppose this is more of an apache question.
i'm trying to build a php file upload utility. as part of writing it i need to
know the upload_tmp_dir for my apache server (its 1.3.27)
i did phpinfo() and the result i getis
upload_tmp_dir no value no value
how do i set this variable?
thanks
--
ajay
---------------
Who Dares Wins
-------------------------------------------------
This mail sent through IMP: www-mail.usyd.edu.au
attached mail follows:
On Wednesday 18 February 2004 12:20 am, ajay wrote:
> how do i set this variable?
>
Set it via php.ini. Usually php knows the temp directory the OS is using, so
only set this if you need something other than the OS's temp directory...
Windows: c:\windows\temp
*nix: /tmp
attached mail follows:
google is your friend
http://www.onlamp.com/pub/a/php/2001/02/15/php_admin.html
5th bottom one..
Martin
> -----Original Message-----
> From: ajay [mailto:abra9823
mail.usyd.edu.au]
> Sent: Wednesday, 18 February 2004 4:20 PM
> To: php-general
lists.php.net
> Subject: [PHP] tmp_dir
>
>
> hi!
>
> i suppose this is more of an apache question.
> i'm trying to build a php file upload utility. as part of
> writing it i need to
> know the upload_tmp_dir for my apache server (its 1.3.27)
> i did phpinfo() and the result i getis
> upload_tmp_dir no value no value
> how do i set this variable?
>
> thanks
>
> --
> ajay
> ---------------
> Who Dares Wins
>
> -------------------------------------------------
> This mail sent through IMP: www-mail.usyd.edu.au
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Trust me, its the most beautiful country in the world. You will be
mesmerized
by the Drakensburg, or as we call it "The Berg". Other places to visit if
you have the
chance is, Durban, our Garden Route and Cape Town.
Enjoy!!!
"Alex Hogan" <Alex.Hogan
AlliedElec.com> wrote in message
news:F63DEC4D37ACD41183C700508B95574F0F88D0F9
exchsrvr.alliedelec.com...
> You do have some nice scenery.
>
> My son is in the Texas Boys Choir and they hosted the Drakensberg Boys
> Choir. We are going to Drakensberg in the summer after Europe and can't
> wait to see it other than pictures.
>
> > -----Original Message-----
> > From: Jakes [mailto:sunsoffun
hotmail.com]
> > Sent: Tuesday, February 17, 2004 9:03 AM
> > To: php-general
lists.php.net
> > Subject: [PHP] Re: [ANNOUNCE] :Possibility of SA PHP conference
> >
> > I'm another South African, and I think my wife is tired of hearing the
> > same
> > thing!
> >
> > South Africa is very Microsoft based, but it does seem to be changing
> > especially in the
> > last few years.
> >
> > We don't we get a site together where we can have some sort voting poll
> > The more users we get voting on this poll to show the South African
> > interest
> > in the PHP
> > community, the better the chance we have of getting a conference down
> > here.
> >
> > Hey and to all Non South Africa who might read this Post - South Africa
is
> > the place to be!!!
> > Things are cheap in most foreign currency and we have loads on scenery
> > ....
> > beats the hell out
> > of London, New York... that's for sure!
> >
> > One conference is all that we ask for! After that I know you guys will
be
> > hooked forever...
> > just like our common language - PHP.
> >
> > Give it try!
> >
> > "Rory McKinley" <rorym
nebula.co.za> wrote in message
> > news:40324580.31682.1BC4941
localhost...
> > > Hi All
> > >
> > > Just a quick question.My wife has gotten tired of me complaining about
> > the
> > lack of PHP
> > > (and LAMP in general I suppose) conferences etc in South Africa.
> > Therefore, seeing as
> > > she runs a conference company she is thinking of hosting a PHP
> > conference
> > in South
> > > Africa, but before she get's going she needs some idea of how large
the
> > PHP
> > > community in SA (and neighbours) is to see whether it will be
> > worthwhile.
> > >
> > > Can anyone who thinks this is a good idea drop me a mail off-list, so
> > that
> > we can get
> > > some gauge of the scale of repsonse that is likely to happen should
the
> > conference take
> > > place. Also, if you like you can give me info re: which city it should
> > take place in, people
> > > that you would like as speakers etc.
> > >
> > > Thanks in advance
> > >
> > > Rory McKinley
> > > Nebula Solutions
> > > +27 82 857 2391
> > > rorym
nebula.co.za
> > > "There are 10 kinds of people in this world,
> > > those who understand binary and those who don't" (Unknown)
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> ******************************************************************
> The contents of this e-mail and any files transmitted with it are
> confidential and intended solely for the use of the individual or
> entity to whom it is addressed. The views stated herein do not
> necessarily represent the view of the company. If you are not the
> intended recipient of this e-mail you may not copy, forward,
> disclose, or otherwise use it or any part of it in any form
> whatsoever. If you have received this e-mail in error please
> e-mail the sender.
> ******************************************************************
>
>
>
attached mail follows:
hi!
after having trawled through many google articles, i've been told that the best
way to redirect a person is using header("Location:url");
the problem is, i have form that is posted to another php script. This script then
processes the form and then writes up a html page and includes in that page any
warnings etc.
i want the user to have say 5s to read that page and then be redirected to
another page.
so i have something like
//process form
//write page
sleep(10);
header("Location:blah.php");
the problem is i get an error when the script gets to the header part, the error
being
Warning: Cannot modify header information - headers already sent by (output
started at c:\program files\apache
group\apache\htdocs\usydbasketball\subscribe_mailing_list.php:6) in c:\program
files\apache group\apache\htdocs\usydbasketball\subscribe_mailing_list.php on
line 67
so how do i workaround that?
thanks
regards
--
ajay
---------------
Who Dares Wins
-------------------------------------------------
This mail sent through IMP: www-mail.usyd.edu.au
attached mail follows:
On Wed, 18 Feb 2004 17:19:03 +1100
ajay <abra9823
mail.usyd.edu.au> wrote:
<snip>
> i want the user to have say 5s to read that page and then be
> redirected to another page.
</snip>
'Not sure if it's only me but I think I've seen this recently ;)
http://marc.theaimsgroup.com/?t=107698314000004&r=1&w=2
http://marc.theaimsgroup.com/?l=php-general&w=2&r=1&s=headers&q=b
--
- E -
attached mail follows:
ajay wrote:
> hi!
>
> after having trawled through many google articles, i've been told that the best
> way to redirect a person is using header("Location:url");
>
> the problem is, i have form that is posted to another php script. This script then
> processes the form and then writes up a html page and includes in that page any
> warnings etc.
> i want the user to have say 5s to read that page and then be redirected to
> another page.
> so i have something like
> //process form
> //write page
> sleep(10);
> header("Location:blah.php");
>
> the problem is i get an error when the script gets to the header part, the error
> being
> Warning: Cannot modify header information - headers already sent by (output
> started at c:\program files\apache
> group\apache\htdocs\usydbasketball\subscribe_mailing_list.php:6) in c:\program
> files\apache group\apache\htdocs\usydbasketball\subscribe_mailing_list.php on
> line 67
>
> so how do i workaround that?
>
> thanks
>
> regards
>
JavaScript or META refresh.
You cannot send headers after you have sent content to the browser.
(Let the war begin again ;)
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
attached mail follows:
Stick something like this in your html <head></head>:
<meta HTTP-EQUIV="REFRESH" CONTENT="5; URL=blah.php">
Location won't work because you've already sent output to the browser.
Ian
On Wed, 2004-02-18 at 07:19, ajay wrote:
> hi!
>
> after having trawled through many google articles, i've been told that the best
> way to redirect a person is using header("Location:url");
>
> the problem is, i have form that is posted to another php script. This script then
> processes the form and then writes up a html page and includes in that page any
> warnings etc.
> i want the user to have say 5s to read that page and then be redirected to
> another page.
> so i have something like
> //process form
> //write page
> sleep(10);
> header("Location:blah.php");
>
> the problem is i get an error when the script gets to the header part, the error
> being
> Warning: Cannot modify header information - headers already sent by (output
> started at c:\program files\apache
> group\apache\htdocs\usydbasketball\subscribe_mailing_list.php:6) in c:\program
> files\apache group\apache\htdocs\usydbasketball\subscribe_mailing_list.php on
> line 67
>
> so how do i workaround that?
>
> thanks
>
> regards
>
> --
> ajay
> ---------------
> Who Dares Wins
>
> -------------------------------------------------
> This mail sent through IMP: www-mail.usyd.edu.au
attached mail follows:
Hello Ian,
Wednesday, February 18, 2004, 5:42:34 PM, you wrote:
IF> Stick something like this in your html <head></head>:
IF> <meta HTTP-EQUIV="REFRESH" CONTENT="5; URL=blah.php">
IF> Location won't work because you've already sent output to the browser.
IF> Ian
IF> On Wed, 2004-02-18 at 07:19, ajay wrote:
>> hi!
>>
>> after having trawled through many google articles, i've been told that the best
>> way to redirect a person is using header("Location:url");
>>
>> the problem is, i have form that is posted to another php script. This script then
>> processes the form and then writes up a html page and includes in that page any
>> warnings etc.
>> i want the user to have say 5s to read that page and then be redirected to
>> another page.
>> so i have something like
>> //process form
>> //write page
>> sleep(10);
>> header("Location:blah.php");
>>
>> the problem is i get an error when the script gets to the header part, the error
>> being
>> Warning: Cannot modify header information - headers already sent by (output
>> started at c:\program files\apache
>> group\apache\htdocs\usydbasketball\subscribe_mailing_list.php:6) in c:\program
>> files\apache
>> group\apache\htdocs\usydbasketball\subscribe_mailing_list.php on
>> line 67
>>
>> so how do i workaround that?
>>
>> thanks
>>
>> regards
>>
>> --
>> ajay
--> the best way to solve your problem is by using output buffering.
try to start with ob_start(); and at the end of your script call with
ob_end_flush() ;
hope it will work :)
--
Best regards,
adwinwijaya mailto:adwinwijaya
yahoo.com.au
attached mail follows:
I'm not even sure if this is a Unix thing, or if it can be done, but ...
How can I read the amount of memory used in a directory /var/something/ (and maybe sub-directories) and echo it?
John
attached mail follows:
On Wed, 18 Feb 2004 01:25:54 -0500
John Taylor-Johnston <taylorjo
collegesherbrooke.qc.ca> wrote:
> I'm not even sure if this is a Unix thing, or if it can be
> done, but ... How can I read the amount of memory used in a
> directory /var/something/ (and maybe sub-directories) and echo
> it?
Try the manual:
http://www.php.net/manual/en/ref.filesystem.php
And just watch out for some permission issues...
--
- E -
attached mail follows:
On Wednesday 18 February 2004 01:25 am, John Taylor-Johnston wrote:
> I'm not even sure if this is a Unix thing, or if it can be done, but ...
> How can I read the amount of memory used in a directory /var/something/
> (and maybe sub-directories) and echo it? John
The amount of memory or the amount of disk space???
attached mail follows:
Both for that matter. I have root access. I want to echo how much /var/xxx contains, and while I'm at it, how much my partition contains and how much is used.
Gerard Samuel wrote:
> On Wednesday 18 February 2004 01:25 am, John Taylor-Johnston wrote:
> > I'm not even sure if this is a Unix thing, or if it can be done, but ...
> > How can I read the amount of memory used in a directory /var/something/
> > (and maybe sub-directories) and echo it? John
>
> The amount of memory or the amount of disk space???
attached mail follows:
Not that this is still a php question but...
On Wed, 18 Feb 2004 01:38:39 -0500
John Taylor-Johnston <taylorjo
collegesherbrooke.qc.ca> wrote:
> Both for that matter. I have root access. I want to echo how
> much /var/xxx contains, and while I'm at it, how much my
> partition contains and how much is used.
Try these commands:
$ df
$ du /var/something
and these:
$ man df
$ man du
for more info...
And check this as well:
http://www.php.net/manual/en/ref.exec.php
--
- E -
attached mail follows:
On Wednesday 18 February 2004 01:38 am, John Taylor-Johnston wrote:
> Both for that matter. I have root access. I want to echo how much /var/xxx
> contains, and while I'm at it, how much my partition contains and how much
> is used.
>
Im not sure about memory, but for diskspace you can look at
http://us2.php.net/manual/en/function.disk-total-space.php
attached mail follows:
Try this:
http://it2.php.net/manual/en/function.disk-free-space.php
(PHP 4 >= 4.1.0)
disk_free_space -- Returns available space in directory
Ian
On Wed, 2004-02-18 at 07:25, John Taylor-Johnston wrote:
> I'm not even sure if this is a Unix thing, or if it can be done, but ...
> How can I read the amount of memory used in a directory /var/something/ (and maybe sub-directories) and echo it?
> John
attached mail follows:
That was very helpful, thanks,
John
- Edwin - wrote:
> Not that this is still a php question but...
>
> On Wed, 18 Feb 2004 01:38:39 -0500
> John Taylor-Johnston <taylorjo
collegesherbrooke.qc.ca> wrote:
>
> > Both for that matter. I have root access. I want to echo how
> > much /var/xxx contains, and while I'm at it, how much my
> > partition contains and how much is used.
>
> Try these commands:
>
> $ df
> $ du /var/something
>
> and these:
>
> $ man df
> $ man du
>
> for more info...
>
> And check this as well:
>
> http://www.php.net/manual/en/ref.exec.php
>
> --
>
> - E -
attached mail follows:
thanks
Gerard Samuel wrote:
> On Wednesday 18 February 2004 01:38 am, John Taylor-Johnston wrote:
> > Both for that matter. I have root access. I want to echo how much /var/xxx
> > contains, and while I'm at it, how much my partition contains and how much
> > is used.
> >
>
> Im not sure about memory, but for diskspace you can look at
> http://us2.php.net/manual/en/function.disk-total-space.php
attached mail follows:
Hello all,
$x = array(03,04,08,10);
$y = array(100,110,120,130);
I need these arrays be converted to:
$x = array(01,02,03,04,05,06,07,08,09,10,11,12,13);
$y = array(0,0,100,110,0,0,0,120,0,130,0,0,0);
Can somebody give an answer ?
Thanks.
Max
attached mail follows:
On Fri, 2004-02-20 at 17:35, YC Nyon wrote:
> Hi,
>
> I want to delete files than are older than 1 week from a specific directory.
> Anyone mind to share their code? Can't anything on phpbuilder on this.
>
> Regards
> Nyon
I have a bash script that I use:
#! /bin/bash
# call as: ./delete_old.sh directory days
# days is the age limit for files you want to keep (ie. 3, 5, 7, etc)
find $2 -type f -mtime +$1 | xargs rm
Ian
attached mail follows:
In article <20040217181105.10308.qmail
pb1.pair.com>, ng
xemoc.cjb.net
says...
> <1624732628.20040216160211
launchcode.co.uk>
> Richard Davey:
> > Hello mayo,
> >
> > Monday, February 16, 2004, 3:51:30 PM, you wrote:
> >
> > m> As for my email being harvested because I wrote it out
> > m> (mayo
nycinteractive.com). Well I'll change it to
> > m> something else. :-)
> >
> > There are other ways - spam bots can actually subscribe to the list
> > and then just reap the email address of anyone who posts. Or of course
> > just scan the web version of the list archives.
> >
> > m> As it is members of one listserv has gotten swamped. The response
> > there was m> a deluge of "me too!"
> >
> > I bet. It's annoying, but not as annoying as when you post to the list
> > and get a stack of Delivery Reports, Out of office replies, user
> > mailbox full errors and various other things back again from the
> > actual "subscribers".
>
> The only way to get rid of it would be to use the newsgroup version.
>
And never post....
--
Quod subigo farinam
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?
attached mail follows:
Never trust the web...
Esacping is bad practis. Doing it, is to ask for trouble when you
try to port the code to another system that a) escapes in another
way, or b) does not escape at all, the transparent way to handle
quote are to quote them. This has been working for the last 40 to
50 years or so, and still works fine. Why not stay with a winner?
-----Original Message-----
From: Brent Baisley
To: carlos castillo
Cc: php-general
lists.php.net; php-windows
lists.php.net
Sent: 2004-02-17 21:02
Subject: [PHP-WIN] Re: [PHP] Replace of ' in a query
Look at the addslashes command. You should always escape the values you
are accepting from user input. If you read almost any article on web
site security, it will mention something called SQL injection among
other things. This is a way to compromise your data.
For instance, what if a user entered:
"1" OR "A"="A"
Now what if you used that user input to filter a query. You may end up
with:
SELECT * FROM db WHERE field="1" OR "A"="A"
Which would return every record in the database.
On Feb 17, 2004, at 2:44 PM, carlos castillo wrote:
> Hi , i have the following problem, i have a form where a user can
input
> any text, on that text may be a char is ' char(39) when i try to
> execute
> the sql query, i have an error for that ', i need to replace it for
the
> html tag, for example " is " or by chr(39) i dont know, and then
> execute the sql query.
>
> i really appreciate your help, thanks.
>
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hi All
Im having trouble with a query that runs fine when i
cut and paste it to freetds and run against the
database. code as follows:
$query ="select count(phonenum) from callrslt where
(dateofcall = '$today') and (callresultcode ='9' or
callresultcode ='12' or callresultcode ='14')";
$result=mssql_query($query,$numero);
$contacts=mssql_fetch_row($result);
print_r($contacts);
This returns
Array ( [0] => 0 )
select count(phonenum) from callrslt where (dateofcall
= 'Feb 17 2004') and (callresultcode ='9' or
callresultcode ='12' or callresultcode ='14')
If i cut and paste this to freetds i get a result of
5120. Can anyone spot why i am getting a zero with
php? There are no problems with any of my other
queries in my scripts.
Thanks in advance for any help.
Cheers
Bob
________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping"
your friends today! Download Messenger Now
http://uk.messenger.yahoo.com/download/index.html
attached mail follows:
Hi,
As far as I can make up of all the sites the Zend project is a php
script compiler... right?
If I got that one right, the next thing I noticed was that the examples
for the Zend engine are normal programs. My problem is that I've
developed a webbased program but I don't want to distribute the
source-code. Which is kinda a problem because otherwise I won't be able
to share it :)
So can the Zend engine run normal php scripts for webpages too?
And while I'm at it, does it make a difference in performance?
Last question, as far as I can tell its possible to buy the Zend
compiler and optimizer. Is there another way to compile php code into
something like the Zend code?
Cheers,
Berend Dekens
P.S. It would be nice if a page with things like these would be placed
on php.net as I can't seem to find stuff like that...
attached mail follows:
Hey everyone. I'm looking for assistance/suggestions/answers on how to
build a select dropdown box from data that needs to be pulled recursively
from a MySQL database. Basically the situation is mainly for a dicussion
thread system type of thing where I have categories nested inside
categories, nested inside categories... Anyway, I want to be able to build
a drop down box containing all the categories indented underneath it's
parent category to look something similar to this:
-------------------------
Top Level Category
- Nested Category
- Lower level
- Etc....
Top Level Category
- Nested Category
Top Level Category
-------------------------
Then the user will be able to select one from the dropdown menu. I have all
the categories stored in a MySQL database called site_categories. The table
is setup like this:
__________________________________
| Cat_ID | Cat_Parent | Cat_Name |
|---------------------------------------------|
| 1 | 0 | Top Level 1 |
|---------------------------------------------|
| 2 | 1 | Nested 1 |
|---------------------------------------------|
| 3 | 0 | Top Level 2 |
|---------------------------------------------|
| 4 | 2 | Nested 2 |
|---------------------------------------------|
Sorry for the bad pictures you hopefully you get the idea. Anything with a
0 Cat_Parent is a Top Level category. Then the others are all nested inside
other categories that have the same Cat_ID as the nested categories
Cat_Parent. I basically need help creating a properly indented dropdown
menu box using this structure from the database. I assume I'm gonna have to
use some sort of recursion here, but I'm not sure how to go about this.
Please help if you can.
Thanks,
Matt
http://sweetphp.com
attached mail follows:
use two loops 9(or as many as you need) with global varaibles. If a variable
in the top level loop is executed
it prints out the second loop. You need to do round trips to the db.
"Matt Palermo" <webmaster
sweetphp.com> wrote in message
news:20040218083536.96886.qmail
pb1.pair.com...
> Hey everyone. I'm looking for assistance/suggestions/answers on how to
> build a select dropdown box from data that needs to be pulled recursively
> from a MySQL database. Basically the situation is mainly for a dicussion
> thread system type of thing where I have categories nested inside
> categories, nested inside categories... Anyway, I want to be able to
build
> a drop down box containing all the categories indented underneath it's
> parent category to look something similar to this:
>
> -------------------------
> Top Level Category
> - Nested Category
> - Lower level
> - Etc....
> Top Level Category
> - Nested Category
> Top Level Category
> -------------------------
>
> Then the user will be able to select one from the dropdown menu. I have
all
> the categories stored in a MySQL database called site_categories. The
table
> is setup like this:
>
> __________________________________
> | Cat_ID | Cat_Parent | Cat_Name |
> |---------------------------------------------|
> | 1 | 0 | Top Level 1 |
> |---------------------------------------------|
> | 2 | 1 | Nested 1 |
> |---------------------------------------------|
> | 3 | 0 | Top Level 2 |
> |---------------------------------------------|
> | 4 | 2 | Nested 2 |
> |---------------------------------------------|
>
> Sorry for the bad pictures you hopefully you get the idea. Anything with
a
> 0 Cat_Parent is a Top Level category. Then the others are all nested
inside
> other categories that have the same Cat_ID as the nested categories
> Cat_Parent. I basically need help creating a properly indented dropdown
> menu box using this structure from the database. I assume I'm gonna have
to
> use some sort of recursion here, but I'm not sure how to go about this.
> Please help if you can.
>
> Thanks,
>
> Matt
> http://sweetphp.com
attached mail follows:
Hi list,
I'm working on a not-so-big website (currently about 1,5MB without
database files) that will receive not-too-much traffic (let's say 1000
visitors a day, being optimistic here). It's supposed to be available in
Dutch and in English. I want one version of the scripts/pages, loading
language-specific content depending on the language setting in a cookie.
Now, I see two ways:
* store all content in a MySQL table, for the different languages
* use the include file approach
The question: how about performance? The include file seems the most
attractive at first sight, querying a database on each page request
sounds intensive. Then again, as the site grows bigger, language files
will grow and HTML output might not be too fast anymore.
Has anyone got experience with both approaches, and how they scale?
Thanks in advance,
Wald
attached mail follows:
Hi all,
I would like a class to test a configuration var and act according to
the vars value a bit like this:
<?php
$myconfig=TRUE;
class myclass {
if($myconfig) {
var $something=1;
}
}
I know that that is not the way it should be done though. What is the
best way to do this?
Many thanks....
--
Nick W
attached mail follows:
* and then Nick Wilson declared....
> <?php
> $myconfig=TRUE;
>
> class myclass {
>
> if($myconfig) {
> var $something=1;
> }
> }
>
> I know that that is not the way it should be done though. What is the
> best way to do this?
On a hunch, i think i've found the answer:
http://www.php.net/manual/en/language.constants.php
Right?
--
Nick W
attached mail follows:
Hi!
It's quite easy to write code, which connect to FTP-site (and upload one file),
but.... How I can do it, if I had Firewall (like 123.123.123.123), and
Firewall
type is USER with no logon (following text from WS_FTP).
Regards,
gustavus
attached mail follows:
On Wednesday 18 February 2004 17:34, Tommi Virtanen wrote:
> It's quite easy to write code, which connect to FTP-site (and upload one
> file), but.... How I can do it, if I had Firewall (like 123.123.123.123),
> and Firewall
> type is USER with no logon (following text from WS_FTP).
Please explain exactly what the problem is. If you had a firewall in the way
and a normal FTP client couldn't login then whatever you do in PHP would not
be able to get you in either.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Inform all the troops that communications have completely broken down.
*/
attached mail follows:
>Please explain exactly what the problem is. If you had a firewall in the way
>and a normal FTP client couldn't login then whatever you do in PHP would not
>be able to get you in either.
(from php.net)
$conn_id = ftp_connect($ftp_server);
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
if ((!$conn_id) || (!$login_result)) {
echo "FTP connection has failed!";
echo "Attempted to connect to $ftp_server for user $ftp_user_name";
exit;
} else {
echo "Connected to $ftp_server, for user $ftp_user_name";
}
...
This is simple, but I have firewall.... How to enter firewall ip....
attached mail follows:
Hi all...
I've having problems submitting information to salesforce.com...
I have a system set up that allows my users here in the office, to send
individual leads, to salesforce...
However, if the users details contain characters such as...
Ù ë ý Ñ Ã etc...
htmlspecialchars only does & " < >
(From what I understand...)
Does anyone know how to turn the other characters into a format, I can
submit to salesforce, without it being rejected...
(the problem, in a little more detail...
I have about 15 fields I'm submitting...
It processes the first on, then the second etc. but as soon as it hits a
field with the characters mentions above, it simply sends blank data to
salesforce for the remaining fields, so I'm left with a half completed
record??? I'm presuming that this fix, will solve it... Once I figure out what this fix is... ;-) )
Tris...
*********************************************************************
The information contained in this e-mail message is intended only for
the personal and confidential use of the recipient(s) named above.
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is
strictly prohibited. If you have received this communication in error,
please notify us immediately by e-mail, and delete the original message.
***********************************************************************
attached mail follows:
Tristan.Pretty
risk.sungard.com wrote:
>Hi all...
>I've having problems submitting information to salesforce.com...
>
>I have a system set up that allows my users here in the office, to send
>individual leads, to salesforce...
>However, if the users details contain characters such as...
>Ù ë ý Ñ Ã etc...
>
>htmlspecialchars only does & " < >
>(From what I understand...)
>
>
...
Surely is a problem with the encoding... try ISO-8859-1
Ù = %D9
ë = %EB
ý = %FD
Ñ = %D1
à = %C3
At least it works for the URL while passing parameters thru GET
attached mail follows:
thanks!
attached mail follows:
Hi,
How can I write special characters (á, ö, ñ, ç,...) in a pdf document?
I'm using pdflib.
Greetings.
attached mail follows:
On 17 February 2004 19:44, Shaun contributed these pearls of wisdom:
> However the following code wont let me add any postcode!:
>
> if(!preg_match("/[A-Z]{1,2}[0-9][0-9A-Z]?
> [0-9][ABD-HJLNP-UW-Z]{1,2}/",
> $_POST[postcode])){
> $error = "Invalid Postcode";
> header("Location: add_location.php?error=$error");
> exit;
> }
>
> Any ideas?
Well, I just cut'n'pasted the above and tested it and it works fine for me. The only things I can think of are fairly obvious ones that I'm sure you've already thought of:
* the postcode needs to be in upper case to match that regex -- if you want to accept lower-case input, it should be upper-cased before matching.
* have you tried echoing $_POST['postcode'] to make sure it contains what you think it should?
Also, I need to correct a minor error in the regexp; it should have read:
"/[A-Z]{1,2}[0-9][0-9A-Z]? [0-9][ABD-HJLNP-UW-Z]{2}/"
Also also, two other points points made in other solutions: you should probably add allowance for leading/trailing spaces, and for additional whitespace between the two parts of the code; and, as currently written, that regexp matches if there is a valid postcode anywhere in the input, so it should be anchored to the beginning and end of the string. Both of these can be catered for in the regexp (rather than with extra PHP code), resulting in:
"/^\\s*[A-Z]{1,2}[0-9][0-9A-Z]?\\s+[0-9][ABD-HJLNP-UW-Z]{2}\\s*$/"
Cheers!
Mike
--
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
On 17 February 2004 22:02, Alex Hogan contributed these pearls of wisdom:
> Hi All,
>
>
>
> What are the rules of thumb for classes and included files?
>
>
>
> Can I not include a file in a class function?
No. The entire class has to be in the same file (and inside a single set of <?php ?> tags).
See the Warning at http://www.php.net/manual/en/language.oop.php
Cheers!
Mike
--
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]