|
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 24 Jul 2003 20:21:25 -0000 Issue 2195
php-general-digest-help
lists.php.net
Date: Thu Jul 24 2003 - 15:21:25 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 24 Jul 2003 20:21:25 -0000 Issue 2195
Topics (messages 156606 through 156737):
Difference between equal $_SERVER variables?
156606 by: Ivo Fokkema
156614 by: chenqi1.zte.com.cn
156617 by: Marek Kilimajer
156650 by: Curt Zirzow
156661 by: Ivo Fokkema
Re: I'm really getting annoyed with PHP
156607 by: Lars Torben Wilson
156612 by: Ow Mun Heng
156626 by: Comex
156628 by: Comex
156629 by: Comex
156635 by: zerof
156636 by: Comex
156637 by: zerof
156659 by: Curt Zirzow
156669 by: Pushpinder Singh Garcha
156677 by: Curt Zirzow
156701 by: Jim Lucas
156704 by: Pushpinder Singh Garcha
156707 by: Chris W. Parker
156710 by: Curt Zirzow
156711 by: Curt Zirzow
156721 by: Chris Shiflett
156731 by: Kevin Stone
156733 by: Lars Torben Wilson
a stupid question
156608 by: Joe
156613 by: Jacob Vennervald Madsen
156621 by: Joe
Please help!!! thx a lot~~~
156609 by: Joe
156610 by: Joe
156616 by: sven
156620 by: Marek Kilimajer
156622 by: Joe
156623 by: Joe
156625 by: Marek Kilimajer
Please help!!!~~thx a lot
156611 by: Joe
156649 by: Curt Zirzow
Re: people who has done a POS system before
156615 by: sven
156624 by: Tan Ai Leen
Re: php function on php.net
156618 by: Merlin
156630 by: Ivo Fokkema
156639 by: Curt Zirzow
156641 by: Curt Zirzow
156660 by: Chris Shiflett
Re: Load in a dedicated server
156619 by: Marek Kilimajer
156651 by: Curt Zirzow
php4 vs php5
156627 by: Robert Janeczek
156652 by: Curt Zirzow
156653 by: Edward Peloke
Re: Has anyone successfully installed PHP 5?
156631 by: Comex
Re: arguments against moving site from Linux/Apache/PHP server to Windows/IIS/PHP needed
156632 by: Jerry Artman
156644 by: Curt Zirzow
need help
156633 by: dan montgomery
156634 by: skate
Re: Some SESSION Vars not Registering
156638 by: Jeff Stillwall
156642 by: Curt Zirzow
PHP timeout doing fread from Apache Coyote
156640 by: Robert Fitzpatrick
156654 by: Curt Zirzow
156662 by: Robert Fitzpatrick
removing parts of a string...
156643 by: Tristan.Pretty.risk.sungard.com
156645 by: Juan Nin
156648 by: R'twick Niceorgaw
156656 by: sven
156680 by: Tristan.Pretty.risk.sungard.com
156683 by: Curt Zirzow
156685 by: Tristan.Pretty.risk.sungard.com
Re: Problem with MySQL Query
156646 by: Curt Zirzow
sorting multi-array
156647 by: Jiøí Nìmec
156655 by: Marek Kilimajer
156657 by: sven
Re: reading from dir and displaying thumbs
156658 by: Ryan A
PHP Webpage like MySql- need to be able to see all fields and edit
156663 by: Matt Hedges
156665 by: Jay Blanchard
156666 by: Adam Voigt
156675 by: Miles Thompson
Re: REVISED: PHP timeout doing fread from Apache Coyote
156664 by: Robert Fitzpatrick
156671 by: Peter Clarke
156672 by: Curt Zirzow
156684 by: Robert Fitzpatrick
156691 by: Robert Fitzpatrick
156700 by: Curt Zirzow
156702 by: Curt Zirzow
Re: Software Application Engineer WANTED (PHP/MySQL Guru)
156667 by: Dan Joseph
uploading a file from a form
156668 by: Amanda McComb
html and php in the same document
156670 by: Bill Pilgrim
156674 by: Curt Zirzow
156676 by: Curt Zirzow
156678 by: Miles Thompson
156681 by: John W. Holmes
command line or http browser?
156673 by: ermelir
156679 by: Curt Zirzow
156697 by: ermelir
156703 by: Curt Zirzow
Hiding URL's...
156682 by: Tristan.Pretty.risk.sungard.com
156686 by: Curt Zirzow
156688 by: Chris Shiflett
156692 by: Bobby Patel
Re: Redirection Question (I spoke to soon)
156687 by: Brian Tully
PHP with XML on Windows XP
156689 by: Sam
phpTidy problems (xhtml)
156690 by: Pedro Arellano
Re: PHP CGI mode and command line variables
156693 by: CDitty
just looking for some opinions...
156694 by: Dan Joseph
156695 by: John W. Holmes
156696 by: Ford, Mike [LSS]
156698 by: Dan Joseph
156699 by: Jeff Harris
156705 by: Dan Joseph
156706 by: Curt Zirzow
156708 by: Dan Joseph
156709 by: Curt Zirzow
Same pattern, ereg_replace catches it, ereg doesn't
156712 by: Reuben D. Budiardja
Re: header & headers_sent BUG
156713 by: Eric Fleming
Include Problems
156714 by: Eric Fleming
156715 by: Jeff Harris
156716 by: Jay Blanchard
156717 by: Jennifer Goodie
156718 by: Jason Giangrande
156720 by: Eric Fleming
156722 by: Jason Giangrande
156723 by: Eric Fleming
156726 by: Eric Fleming
156728 by: Jay Blanchard
156729 by: Eric Fleming
156730 by: Jason Giangrande
156732 by: Eric Fleming
156734 by: Jay Blanchard
156735 by: Chris W. Parker
PHP Upgrade Problem
156719 by: Shaun
ARRAY QUESTION
156724 by: Dale Hersh
156725 by: Jay Blanchard
156727 by: Chris W. Parker
156736 by: Kevin Stone
PHP webpage like MySQL, PART 2
156737 by: Matt Hedges
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:
Hi list,
Just out of curiosity I would like to know if anyone can tell me the
difference between some $_SERVER variables that generate the same output (in
my test-file at least).
For instance, what is the difference between $_SERVER['HTTP_HOST'] and
$_SERVER['SERVER_NAME']? Can they generate different output under some
circumstances? They're always the same with me. Any recommendations on which
to use?
I know that $_SERVER['REQUEST_URI'] can differ from 'SCRIPT_NAME' and
'PHP_SELF' (I use 'REQUEST_URI' to see what people were looking for when
they hit a 404) but can $_SERVER['SCRIPT_NAME'] and $_SERVER['PHP_SELF'] be
different?
TIA,
--
Ivo Fokkema
PHP & MySQL programmer
Leiden University Medical Centre
Netherlands
attached mail follows:
$_SERVER['HTTP_HOST'] and $_SERVER['SERVER_NAME']are different in my
circumstance,I found that the $_SERVER['SERVER_NAME']is the same with the
"ServerName" value you set in httpd.conf.
"Ivo Fokkema"
<I.F.A.C.Fokkem ÊÕ¼þÈË£º php-general
lists.php.net
a
LUMC.nl> ³ËÍ£º
´«ÕæÖ£º
Ö÷Ì⣺ [PHP] Difference between equal $_SERVER
variables?
2003-07-24
16:20
Hi list,
Just out of curiosity I would like to know if anyone can tell me the
difference between some $_SERVER variables that generate the same output
(in
my test-file at least).
For instance, what is the difference between $_SERVER['HTTP_HOST'] and
$_SERVER['SERVER_NAME']? Can they generate different output under some
circumstances? They're always the same with me. Any recommendations on
which
to use?
I know that $_SERVER['REQUEST_URI'] can differ from 'SCRIPT_NAME' and
'PHP_SELF' (I use 'REQUEST_URI' to see what people were looking for when
they hit a 404) but can $_SERVER['SCRIPT_NAME'] and $_SERVER['PHP_SELF'] be
different?
TIA,
--
Ivo Fokkema
PHP & MySQL programmer
Leiden University Medical Centre
Netherlands
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
server name - real name of the server, ie when you do a reverse dns
lookup you get (usualy) this
http host - content of the Host: header, that is virtual host
Ivo Fokkema wrote:
> Hi list,
>
> Just out of curiosity I would like to know if anyone can tell me the
> difference between some $_SERVER variables that generate the same output (in
> my test-file at least).
>
> For instance, what is the difference between $_SERVER['HTTP_HOST'] and
> $_SERVER['SERVER_NAME']? Can they generate different output under some
> circumstances? They're always the same with me. Any recommendations on which
> to use?
>
> I know that $_SERVER['REQUEST_URI'] can differ from 'SCRIPT_NAME' and
> 'PHP_SELF' (I use 'REQUEST_URI' to see what people were looking for when
> they hit a 404) but can $_SERVER['SCRIPT_NAME'] and $_SERVER['PHP_SELF'] be
> different?
>
> TIA,
>
>
> --
> Ivo Fokkema
> PHP & MySQL programmer
> Leiden University Medical Centre
> Netherlands
>
>
>
attached mail follows:
* Thus wrote Ivo Fokkema (I.F.A.C.Fokkema
LUMC.nl):
> Hi list,
>
> Just out of curiosity I would like to know if anyone can tell me the
> difference between some $_SERVER variables that generate the same output (in
> my test-file at least).
>
> For instance, what is the difference between $_SERVER['HTTP_HOST'] and
> $_SERVER['SERVER_NAME']? Can they generate different output under some
> circumstances? They're always the same with me. Any recommendations on which
> to use?
>
> I know that $_SERVER['REQUEST_URI'] can differ from 'SCRIPT_NAME' and
> 'PHP_SELF' (I use 'REQUEST_URI' to see what people were looking for when
> they hit a 404) but can $_SERVER['SCRIPT_NAME'] and $_SERVER['PHP_SELF'] be
> different?
I would suggest reading up on the variables available
http://www.php.net/manual/en/reserved.variables.php
That will answer all your questions.
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
attached mail follows:
"Curt Zirzow" <curt
zirzow.dyndns.org> wrote in message
news:20030724143733.GG78291
bagend.shire...
> * Thus wrote Ivo Fokkema (I.F.A.C.Fokkema
LUMC.nl):
> > Hi list,
> >
> > Just out of curiosity I would like to know if anyone can tell me the
> > difference between some $_SERVER variables that generate the same output
(in
> > my test-file at least).
> I would suggest reading up on the variables available
> http://www.php.net/manual/en/reserved.variables.php
Well, I've seen that, but for instance;
'PHP_SELF'
The filename of the currently executing script, relative to the document
root.
--and--
'SCRIPT_NAME'
Contains the current script's path.
doesn't mean much to me... They both return the same results to me, also.
When do these differ?
attached mail follows:
On Thu, 2003-07-24 at 20:24, Beauford.2005 wrote:
> It's obvious though that PHP can not handle it. This is why I am forced
> to use javascript. I have already spent a week on this and am not going
> to waste any further time. I have posted all my code and if someone can
> see a problem I'll look at it, but it just ain't worth the effort at
> this point.
Again, post a script which displays the problem. I've only seen little
snippets which do not consitute a working example. It will be seen by
many and fixed within minutes.
I have had this functionality active every day for years over many
different version of PHP in many different environments. The good news
is that the problem is not with PHP. That means it's the code, which is
easy to fix.
--
Torben Wilson <torben
php.net> +1.604.709.0506
http://www.thebuttlesschaps.com http://www.inflatableeye.com
http://www.hybrid17.com http://www.themainonmain.com
-----==== Boycott Starbucks! http://www.haidabuckscafe.com ====-----
attached mail follows:
This is taken from mantis.. NOt sure if it'll help but take a look at the
t_use_iis field
function print_header_redirect( $p_url, $p_die=true ) {
$t_use_iis = config_get( 'use_iis');
if ( ON == config_get( 'stop_on_errors' ) && error_handled()
) {
return false;
}
if ( OFF == $t_use_iis ) {
header( 'Status: 302' );
}
header( 'Content-Type: text/html' );
header( 'Pragma: no-cache' );
header( 'Expires: Fri, 01 Jan 1999 00:00:00 GMT' );
header( 'Cache-control: no-cache, no-cache="Set-Cookie",
private' );
if ( ON == $t_use_iis ) {
header( "Refresh: 0;url=$p_url" );
} else {
header( "Location: $p_url" );
}
if ( $p_die ) {
die; # additional output can cause problems so let's
just stop output here
}
return true;
}
Cheers,
Mun Heng, Ow
H/M Engineering
Western Digital M'sia
DID : 03-7870 5168
-----Original Message-----
From: Beauford.2005 [mailto:beauford.2005
rogers.com]
Sent: Friday, July 25, 2003 6:13 AM
To: bigdog
venticon.com; PHP
Subject: RE: [PHP] I'm really getting annoyed with PHP
FYI. I did this login page for another website last month and I used the
code from it to do this one. The other one works perfectly. I checked
that code again today and there is ABSOLUTELY no differnce. I even used
the same variables and session names. The only difference between the
two sites is that the one that works is running IIS on Windows 2000
Server. The broken one is on a Linux box running Apache. Both PHP and
MySQL are the same versions. Remember also that the Header redirect is
working in the redirect.inc page, which is even more confusing.
I have really given up on it. It just ain't gonna work - no matter what
I do. I thought I finally had it working again, but of course - another
f*** up.
Can you explain this? Along with my other code I used a little piece of
javascript to do the redirect, and lo and behold it worked. But now my
paths are all screwed up. I just don't get it.
In the example I tried, the page I am redirected to has a form on it.
When I click submit it should go to the page specified in the action,
which is season_write.php.
<FORM onSubmit="return checkrequired(this)" ACTION="season_write.php"
action="post" name="seasons">
But for some reason it tries to go to /setup/season_write.php. This is
not specified anywhere in any of my code. So where the hell it getting
this from.
The more I use PHP the more I am becoming convinced I should be using
something else. This is just ridiculous.
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
window.location="<? echo $_SESSION['goto']; ?>";
// End -->
</script>
-----Original Message-----
From: Ray Hunter [mailto:bigdog
venticon.com]
Sent: July 23, 2003 5:44 PM
To: Beauford.2005
Subject: Re: [PHP] I'm really getting annoyed with PHP
Questions:
1. What verion of php are you running?
2. What version of apache are you running? Or other web server? 3. What
is your configuration for php? check phpinfo() 4. Is php built from
source or a binary (rpm, exe)? 5. What OS are you running on and what
version?
--
BigDog
On Thu, 2003-07-24 at 13:41, Beauford.2005 wrote:
> Yes, I'm still screwing around with this stupid redirection thing, and
> either I'm just a total idiot or there are some serious problems with
> PHP. I have now tried to do it another way and - yes - you guessed it.
> It does not work.
>
> I mean really, it can not be this hard to redirect a user to another
> page. If it is, then I must look into using something else as I just
> can't be wasting days and days on one minor detail that should take 30
> seconds to complete.
>
> If anyone has some concrete suggestion on how to get this to work It
> would be greatly appreciated. In the mean time I have given up on it
> as I am just totally pissed off at it.
>
> TIA
>
>
attached mail follows:
> Ok, I have a question. Where is $_SESSION['valid_user'] getting set
> (or unset)???
AFAICS, $_SESSION['valid_user'] is getting set by a previous page, it's a
*session*.
> Have you checked to see if your IF statement at the top of the script
> is working like you think it should be?? Try putting an echo in
> instead of the header() call and see if you get the output you think
> you should.
>
> I suspect this isn't a "redirect isn't working" issue at all but a "the
> if isn't working like I thought it would" issue. :)
>
Err... that wasn't the original code... that was someone else's code that
worked...
attached mail follows:
<1059013359.835.133.camel
ali>
Lars Torben Wilson:
> On Wed, 2003-07-23 at 18:21, Daryl Meese wrote:
>> Well, I know I am not running the latest version of PHP but I don't
>> believe this is accurate. I believe PHP case sensitivity is based
>> on the os that processes the file. Can anyone clear this up.
>>
>> Daryl
>
>
> OK: you're mistaken. If you're correct, it's a bug. I'm pretty sure we
> would have heard about it by now. :)
>
> But give it a try and post your results (I don't have a Win PHP box
> set up right now, myself).
PHP 4.3.2 and 5.0.0b1 on Windows
<?php
$a = "set";
print '$A is '; print isset($A) ? 'set' : 'unset'; print '<br>';
print '$a is '; print isset($a) ? 'set' : 'unset';
?>
$A is unset
$a is set
attached mail follows:
<001001c3525c$37a0cda0$6401a8c0
p1>
Beauford.2005:
> It's obvious though that PHP can not handle it. This is why I am
> forced to use javascript. I have already spent a week on this and am
> not going to waste any further time. I have posted all my code and if
> someone can see a problem I'll look at it, but it just ain't worth
> the effort at this point.
Every single person who posted here thought that PHP could handle it. If
header("Location: http://www.google.com"); doesn't work, there's something
wrong with your version of PHP.
attached mail follows:
I'm using the redirect with php for a long time, with no problems.
I use it in all of my pages, including navigational menus.
The great problem with "headers" is the function "exit" if it is used to ends the call.
"headers + exit", if used in any place, may cause some collateral efects.
-----
zerof
-----
attached mail follows:
<20030724130309.8752.qmail
pb1.pair.com>
Zerof:
> I'm using the redirect with php for a long time, with no problems.
> I use it in all of my pages, including navigational menus.
> The great problem with "headers" is the function "exit" if it is used
> to ends the call. "headers + exit", if used in any place, may cause
> some collateral efects. -----
> zerof
> -----
Why? AFAIK, exit quits the script, exactly what you want if you want to
redirect.
attached mail follows:
You are absolutely right, exit, quits my script, this let me use an independent script to
handle the headers. if used with conditional calls. .
----
zerof
-----
"Comex" <ng
xemoc.cjb.net> escreveu na mensagem
news:20030724130500.12089.qmail
pb1.pair.com...
> <20030724130309.8752.qmail
pb1.pair.com>
-------------
> Why? AFAIK, exit quits the script, exactly what you want if you want to redirect.
-----------
attached mail follows:
* Thus wrote Wendell Brown (wbrown
arkie.net):
> On Thu, 24 Jul 2003 02:05:58 -0500, Wendell Brown wrote:
>
> >Ok, I have a question. Where is $_SESSION['valid_user'] getting set
> >(or unset)???
>
> Oooops. I thought that was the code that he was talking about. I
> missed your lead in. Sorry!!!
This thread need to die... we all know it works..<period>
Curt
--
:0
* ^Subject: .*I'm really getting annoyed with PHP
/dev/null
attached mail follows:
try this,
use a meta-refresh ...
echo "<META HTTP-EQUIV=\"refresh\"
content=\"3;URL=http://wherever_u_wana_go.com/hello.html\">";
hth
--Pushpinder
On Thursday, July 24, 2003, at 11:24 PM, Beauford.2005 wrote:
> It's obvious though that PHP can not handle it. This is why I am forced
> to use javascript. I have already spent a week on this and am not going
> to waste any further time. I have posted all my code and if someone can
> see a problem I'll look at it, but it just ain't worth the effort at
> this point.
>
> -----Original Message-----
> From: Justin French [mailto:justin
indent.com.au]
> Sent: July 23, 2003 10:52 PM
> To: Curt Zirzow
> Cc: PHP
> Subject: Re: [PHP] I'm really getting annoyed with PHP
>
>
>
> On Thursday, July 24, 2003, at 12:18 PM, Curt Zirzow wrote:
>
>> And in my case I would never see the next page. I have javascript
>> turned
>> off.
>>
>> Never rely on javascript to do the work, excpecially in small cases
>> like
>> this when php can handle it without any issues, such as javascript
>> being
>> turned off.
>
> To follow on from this, the W3 accessibility guidelines
> (http://www.w3.org/TR/WCAG10/checkpoint-list.html) state:
>
> ---
> 6.3 Ensure that pages are usable when scripts, applets, or other
> programmatic objects are turned off or not supported. If this is not
> possible, provide equivalent information on an alternative accessible
> page. [Priority 1]
>
> For example, ensure that links that trigger scripts work when scripts
> are turned off or not supported (e.g., do not use "javascript:" as the
> link target). If it is not possible to make the page usable without
> scripts, provide a text equivalent with the NOSCRIPT element, or use a
> server-side script instead of a client-side script, or provide an
> alternative accessible page as per checkpoint 11.4. Refer also to
> guideline 1.
> ---
>
> In short, do as much as you can server side (PHP), and ensure the page
> doesn't break without JS. Then use JS on the client side IF YOU MUST
> to enhance the experience for those with it switched on.
>
> Yes, it's more work, and yes this is optional (but be aware that SOCOG
> (Sydney Olympics) were sued for having an inaccessible site, so it's
> only a matter of time before we have huge class action everywhere :)),
> and yes you'll reach a greater market share with an accessible page.
>
> Sorry for getting OT
>
> Justin
>
>
> --
> 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
>
attached mail follows:
* Thus wrote Pushpinder Singh Garcha (pgarcha
adelphia.net):
> try this,
>
>
> use a meta-refresh ...
>
> echo "<META HTTP-EQUIV=\"refresh\"
> content=\"3;URL=http://wherever_u_wana_go.com/hello.html\">";
This has already been discussed, and is not the preferred method of
doing redirects. PHP can handle what he is doing just fine.
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
attached mail follows:
can someone post the original source that he submitted. I was gone
yesterday and missed it.
Thanks
Jim
----- Original Message -----
From: "Curt Zirzow" <curt
zirzow.dyndns.org>
To: "PHP" <php-general
lists.php.net>
Sent: Thursday, July 24, 2003 9:11 AM
Subject: Re: [PHP] I'm really getting annoyed with PHP
> * Thus wrote Pushpinder Singh Garcha (pgarcha
adelphia.net):
> > try this,
> >
> >
> > use a meta-refresh ...
> >
> > echo "<META HTTP-EQUIV=\"refresh\"
> > content=\"3;URL=http://wherever_u_wana_go.com/hello.html\">";
>
> This has already been discussed, and is not the preferred method of
> doing redirects. PHP can handle what he is doing just fine.
>
>
>
> Curt
> --
> "I used to think I was indecisive, but now I'm not so sure."
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
hello everyone,
Can somebody tell me why meta-refresh is not preferred to do re-directs
?
I know Javascript is browser dependent, so its undependable.
using headers in php requires that no output is sent to the browser,
what if the code logic requires that there is some output sent to the
browser. I am sorry if this is a repeat question because someone
earlier did mention abt output buffering as a way around.
TIA
--Pushpinder
On Thursday, July 24, 2003, at 12:11 PM, Curt Zirzow wrote:
> * Thus wrote Pushpinder Singh Garcha (pgarcha
adelphia.net):
>> try this,
>>
>>
>> use a meta-refresh ...
>>
>> echo "<META HTTP-EQUIV=\"refresh\"
>> content=\"3;URL=http://wherever_u_wana_go.com/hello.html\">";
>
> This has already been discussed, and is not the preferred method of
> doing redirects. PHP can handle what he is doing just fine.
>
>
>
> Curt
> --
> "I used to think I was indecisive, but now I'm not so sure."
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Pushpinder Singh Garcha <mailto:pgarcha
adelphia.net>
on Thursday, July 24, 2003 11:10 AM said:
> hello everyone,
>
> Can somebody tell me why meta-refresh is not preferred to do
> re-directs ?
I think because it breaks the back button (explained in more detail
later).
> using headers in php requires that no output is sent to the browser,
> what if the code logic requires that there is some output sent to the
> browser. I am sorry if this is a repeat question because someone
> earlier did mention abt output buffering as a way around.
Well, if you use a header("Location: ..."); redirect there's no point in
sending anything to the browser because no one is going to see it.
If some output is required to be seen by the user you should just put a
link to the next page and not worry about a redirect at all.
OOORRRR, at the very least, give the meta-refresh a time of about 5
seconds or more so that the back button is not broken. I think the
problem with meta-refresh is that if you try to do an instant refresh
(like the way header(); works) you'll prevent the user from being able
to click the back button since every time they try to go back and reload
the previous page (in their mind they are wanting to go back to the page
BEFORE the redirect page) it will immediately send them back to the page
they were just on because they hit the redirect page first.
hth,
chris.
attached mail follows:
* Thus wrote Jim Lucas (phplist
zonedzero.net):
> can someone post the original source that he submitted. I was gone
> yesterday and missed it.
dont bother. his original post was in some other exhausted long
threaded that resulted in nothing.
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
attached mail follows:
* Thus wrote Pushpinder Singh Garcha (pgarcha
adelphia.net):
> hello everyone,
>
> Can somebody tell me why meta-refresh is not preferred to do re-directs
> ?
> I know Javascript is browser dependent, so its undependable.
Again, this has already been mentioned three (3) times in this
thread alone, just to re-iterate since this thread is all messed
up and overly responded to....
Here:
http://www.w3.org/TR/WCAG10/checkpoint-list.html
>
> using headers in php requires that no output is sent to the browser,
> what if the code logic requires that there is some output sent to the
> browser. I am sorry if this is a repeat question because someone
> earlier did mention abt output buffering as a way around.
Yes, output buffering is what you would do. I would recommend
programming around using output buffering and if you cant then
rethink your logic.
and on a side note, technically you should also send html with your
header('Location: /url') for browsers that either are unable to
redirect or have automatic re-direction off.
Ok.. now I'm even more guilty of keeping this thing alive. from now
on I am ignoring all messages in this thread :)
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
attached mail follows:
--- Pushpinder Singh Garcha <pgarcha
adelphia.net> wrote:
> Can somebody tell me why meta-refresh is not preferred to do
> re-directs?
Sure.
> using headers in php requires that no output is sent to the browser
I think this is what is causing you trouble, as this is incorrect. You can have
output and HTTP headers. In fact, that is what happens 99.9% of the time (or
more). Even when you don't specify headers yourself, you can be sure your Web
server is sending some.
You can use meta tags instead of HTTP headers in many cases, and most browsers
can accomodate this. People are most familiar with using it in substitute for
the Refresh header, but many headers can be sent in meta tags this way.
Of course, since we are PHP developers and can modify the *real* HTTP headers,
there is no reason for us to use meta tags instead. Doing so is a lot like
using JavaScript to perform logic that is more appropriately done in PHP. While
many developers still do this, the more experienced ones generally don't.
Hope that helps.
Chris
=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/
attached mail follows:
"Zerof" <zerof
terra.com.br> wrote in message
news:20030724132559.28411.qmail
pb1.pair.com...
> You are absolutely right, exit, quits my script, this let me use an
independent script to
> handle the headers. if used with conditional calls. .
> ----
> zerof
> -----
> "Comex" <ng
xemoc.cjb.net> escreveu na mensagem
> news:20030724130500.12089.qmail
pb1.pair.com...
> > <20030724130309.8752.qmail
pb1.pair.com>
> -------------
> > Why? AFAIK, exit quits the script, exactly what you want if you want to
redirect.
> -----------
Zerof, Comex is absolutely correct. exit() should almost always be used in
conjucntion with header("Location: "). I would be interested in learning
what "collateral effects" you see when doing so. By any logic exit()
should reduce the number of adverse effects when using header() redirects.
Consider this example..
<?
if($i==10){
header("Location: $nextpage");
}
$_SESSION['i'] = $i;
?>
If we were to employ this code $i would be set to the session even if
header() was called and the user was redirected. PHP does not care that
another script has been launched and happily continues to execute this
script. Is this really a desirable effect? No.. surely not. Instead what
we should do is exit the script after redirecting the user.
<?
if($i==10) {
header("Location: $nextpage");
exit;
}
$_SESSION['i'] = $i;
?>
Now we're safe becuase nothing beyond the header() call is going to execute.
Obviously this is an extraordinarily simple example. But most scripts are
not so straight forward. If you don't exit after a header redirect you
could be causing yourself one hell of a headache.
Be wise and have one script running at one time.
- Kevin
attached mail follows:
On Thu, 2003-07-24 at 04:18, Comex wrote:
> <1059013359.835.133.camel
ali>
> Lars Torben Wilson:
> > On Wed, 2003-07-23 at 18:21, Daryl Meese wrote:
> >> Well, I know I am not running the latest version of PHP but I don't
> >> believe this is accurate. I believe PHP case sensitivity is based
> >> on the os that processes the file. Can anyone clear this up.
> >>
> >> Daryl
> >
> >
> > OK: you're mistaken. If you're correct, it's a bug. I'm pretty sure we
> > would have heard about it by now. :)
> >
> > But give it a try and post your results (I don't have a Win PHP box
> > set up right now, myself).
>
> PHP 4.3.2 and 5.0.0b1 on Windows
>
> <?php
> $a = "set";
> print '$A is '; print isset($A) ? 'set' : 'unset'; print '<br>';
> print '$a is '; print isset($a) ? 'set' : 'unset';
> ?>
>
> $A is unset
> $a is set
Thanks. The same file on Linux PHP 4.3.2 produces the same output. The
manual is correct: variable names in PHP are case-sensitive, full
stop. It is not dependent upon the OS.
This is explained here:
http://www.php.net/manual/en/language.variables.php
Thanks for the Win test, Comex!
Cheers,
Torben
--
Torben Wilson <torben
php.net> +1.604.709.0506
http://www.thebuttlesschaps.com http://www.inflatableeye.com
http://www.hybrid17.com http://www.themainonmain.com
-----==== Boycott Starbucks! http://www.haidabuckscafe.com ====-----
attached mail follows:
how to check the filetype of remote file
because is_dir(), is_file() can't work on remote file
thx a lot
attached mail follows:
Download it and then check it. But if you need to check a lot of files
that's probably to slow.
Jacob Vennervald
On Thu, 2003-07-24 at 06:03, Joe wrote:
> how to check the filetype of remote file
> because is_dir(), is_file() can't work on remote file
> thx a lot
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Venlig hilsen / Best regards,
Jacob Vennervald
System Developer
Proventum Solutions ApS
Tuborg Boulevard 12
2900 Hellerup
Denmark
Phone: +45 36 94 41 66
Mobile: +45 61 68 58 51
attached mail follows:
thx
"Jacob Vennervald Madsen" <jvennervald
proventum.net> ¼¶¼g©ó¶l¥ó·s»D
:1059037487.1077.45.camel
jvennervald.intra.proventum.net...
> Download it and then check it. But if you need to check a lot of files
> that's probably to slow.
>
> Jacob Vennervald
>
> On Thu, 2003-07-24 at 06:03, Joe wrote:
> > how to check the filetype of remote file
> > because is_dir(), is_file() can't work on remote file
> > thx a lot
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> --
> Venlig hilsen / Best regards,
> Jacob Vennervald
> System Developer
> Proventum Solutions ApS
> Tuborg Boulevard 12
> 2900 Hellerup
> Denmark
> Phone: +45 36 94 41 66
> Mobile: +45 61 68 58 51
>
>
attached mail follows:
I have written a php to show file in directories.
The problem is due to is_dir() can't opearate on remote files. What should I
do in order to fix it.
thx a lot~~~
begin 666 list.php
M/#]P:' -"B
)&9I;&5N86UE/2=L:7-T+G!H<"<[#0H
(&=L;V)A;" D8W5R
M<E]D:7([#0H
("1C=7)R7V1I<CTG+B<[#0H
(&EF*&ES4V5T*"1?1T54*28F
M:7-3970H)%]'151;)W!A=&
G72DI#0H
("
("1C=7)R7V1I<CTD7T=%5%LG
M<&%T:"==.PT*("!I9B
D;&5N/7-T<G)P;W,H)&-U<G)?9&ER+"<O)RDI#0H
M("
("1P87)E;G1?9&ER/7-U8G-T<B
D8W5R<E]D:7(L,"PD;&5N*3L-"B
M96QS90T*("
(" D<&%R96YT7V1I<CTD8W5R<E]D:7([#0H-"B
:68H:7-?
M9&ER*"1C=7)R7V1I<BDI#0H
('L-"B
("
:68H)&1H/6]P96YD:7(H)&-U
M<G)?9&ER*2D-"B
("
>PT*("
("
("
("1O=71P=71;,%U;,%T](CQ!
M($A2148]7"(D9FEL96YA;64_<&%T:#TD8W5R<E]D:7)<(CXN/"]!/B([#0H
M("
("
("
)&]U='!U=%LQ75LP73TB/$$
2%)%1CU<(B1F:6QE;F%M93]P
M871H/21P87)E;G1?9&ER7"(^+BX\+T$^(CL-"B
("
("
(" D8V]U;G1E
M<CTR.PT*("
("
("
('=H:6QE*"
D9FEL93UR96%D9&ER*"1D:"DI(3T]
M9F%L<V4I#0H
("
("
("
>PT*("
("
("
("
("
96-H;R B)&9I
M;&4
:7,
82 B+F9I;&5T>7!E*"1F:6QE*2XB/&)R/B([#0H
("
("
("
M("
("!I9B
D9FEL93T])RXG?'PD9FEL93T])RXN)RD-"B
("
("
("
M("
('L-"B
("
("
("
("
('T-"B
("
("
("
("
(&5L<V4
M:68H:7-?9FEL92
D9FEL92DI#0H
("
("
("
("
("![#0H
("
("
M("
("
("
("
(" D;W5T<'5T6R1C;W5N=&5R*RM=6S!=/2(\02!(4D5&
M/5PB)&-U<G)?9&ER+R1F:6QE7"(^)&9I;&4\+T$^(CL-"B
("
("
("
M("
('T-"B
("
("
("
("
(&5L<V4-"B
("
("
("
("
('L-
M"B
("
("
("
("
("
("
("1O=71P=71;)&-O=6YT97(K*UU;,%T]
M(CQ!($A2148]7"(D9FEL96YA;64_<&%T:#TD8W5R<E]D:7(O)&9I;&5<(CXD
M9FEL93PO03XB.R
("
("
("
("
("
("
("
(" -"B
("
("
M("
("
('T-"B
("
("
("!]#0H
("
('T-"B
?0T*("!F;W)E86-H
M*"1O=71P=70
87,
)&ET96TI#0H
("
("
9F]R96%C:"
D:71E;2!A<R D
K<W1R*0T*("
("
("
("
96-H;R D<W1R+B(\8G(^(CL-"B
#0H_/
``
`
end
attached mail follows:
any alternative method is also welcome
"Joe" <arjoe
cuhk.edu.hk> ¼¶¼g©ó¶l¥ó·s»D
:20030724085145.4069.qmail
pb1.pair.com...
> I have written a php to show file in directories.
> The problem is due to is_dir() can't opearate on remote files. What should
I
> do in order to fix it.
> thx a lot~~~
>
>
>
attached mail follows:
hi joe,
you want a server-script, that lists a dir on a client?
i think that's impossible. think of if you visit a website written in php
and in background your hdd is scanned? that's simply a security reason.
ciao SVEN
Joe wrote:
> any alternative method is also welcome
>
> "Joe" <arjoe
cuhk.edu.hk> ¼¶¼g©ó¶l¥ó·s»D
>> 20030724085145.4069.qmail
pb1.pair.com...
>> I have written a php to show file in directories.
>> The problem is due to is_dir() can't opearate on remote files. What
>> should I do in order to fix it.
>> thx a lot~~~
attached mail follows:
What is remote in your circumstances? FTP, HTTP, ... ?
Joe wrote:
> any alternative method is also welcome
>
> "Joe" <arjoe
cuhk.edu.hk> ¼¶¼g©ó¶l¥ó·s»D
> :20030724085145.4069.qmail
pb1.pair.com...
>
>>I have written a php to show file in directories.
>>The problem is due to is_dir() can't opearate on remote files. What should
>
> I
>
>>do in order to fix it.
>>thx a lot~~~
>>
>>
>>
>
>
>
>
attached mail follows:
I see the point but I just want to list the subfolder under my directory.
Could you please tell me how to distinguish a directory from a file in Unix
thx a lot
"Sven" <svenie
gmx.li> ¼¶¼g©ó¶l¥ó·s»D
:20030724091907.33967.qmail
pb1.pair.com...
> hi joe,
> you want a server-script, that lists a dir on a client?
> i think that's impossible. think of if you visit a website written in php
> and in background your hdd is scanned? that's simply a security reason.
> ciao SVEN
>
> Joe wrote:
> > any alternative method is also welcome
> >
> > "Joe" <arjoe
cuhk.edu.hk> ¼¶¼g©ó¶l¥ó·s»D
> >> 20030724085145.4069.qmail
pb1.pair.com...
> >> I have written a php to show file in directories.
> >> The problem is due to is_dir() can't opearate on remote files. What
> >> should I do in order to fix it.
> >> thx a lot~~~
>
>
attached mail follows:
HTTP
my department disable the function of listing file
"Marek Kilimajer" <kilimajer
webglobe.sk>
???????:3F1FACE8.8080401
webglobe.sk...
What is remote in your circumstances? FTP, HTTP, ... ?
Joe wrote:
> any alternative method is also welcome
>
> "Joe" <arjoe
cuhk.edu.hk> ¼¶¼g©ó¶l¥ó·s»D
> :20030724085145.4069.qmail
pb1.pair.com...
>
>>I have written a php to show file in directories.
>>The problem is due to is_dir() can't opearate on remote files. What should
>
> I
>
>>do in order to fix it.
>>thx a lot~~~
>>
>>
>>
>
>
>
>
attached mail follows:
Do you mean you cannot access the filesystem on your own server?
You can find out if /something is a directory by connecting to the web
server and request the file/directory without a trailing slash. If it is
a directory server will respond with "301 Moved Permanently" response.
$is_dir=false;
$sock=fsockopen('server', 80);
fputs($sock,"GET /something\r\n\r\n");
while (!feof($fp)) {
if(strpos(fgets($fp,128),"301 Moved Permanently")) $is_dir=true;
}
fclose ($fp);
Joe wrote:
> HTTP
> my department disable the function of listing file
> "Marek Kilimajer" <kilimajer
webglobe.sk>
> ???????:3F1FACE8.8080401
webglobe.sk...
> What is remote in your circumstances? FTP, HTTP, ... ?
>
> Joe wrote:
>
>
>>any alternative method is also welcome
>>
>>"Joe" <arjoe
cuhk.edu.hk> ¼¶¼g©ó¶l¥ó·s»D
>>:20030724085145.4069.qmail
pb1.pair.com...
>>
>>
>>>I have written a php to show file in directories.
>>>The problem is due to is_dir() can't opearate on remote files. What should
>>
>>I
>>
>>
>>>do in order to fix it.
>>>thx a lot~~~
>>>
>>>
>>>
>>
>>
>>
>>
>
>
>
attached mail follows:
I have just started to learn php and written a php to list the files. But
there is a problem, seen the is_dir() function can't work on remote files.
Therefore, it couldn't check the filetype of subdirectories.
Would anyone tell me what should I do.
Thx a lot
begin 666 list.php
M/#]P:' -"B
)&9I;&5N86UE/2=L:7-T+G!H<"<[#0H
(&=L;V)A;" D8W5R
M<E]D:7([#0H
("1C=7)R7V1I<CTG+B<[#0H
(&EF*&ES4V5T*"1?1T54*28F
M:7-3970H)%]'151;)W!A=&
G72DI#0H
("
("1C=7)R7V1I<CTD7T=%5%LG
M<&%T:"==.PT*("!I9B
D;&5N/7-T<G)P;W,H)&-U<G)?9&ER+"<O)RDI#0H
M("
("1P87)E;G1?9&ER/7-U8G-T<B
D8W5R<E]D:7(L,"PD;&5N*3L-"B
M96QS90T*("
(" D<&%R96YT7V1I<CTD8W5R<E]D:7([#0H-"B
:68H:7-?
M9&ER*"1C=7)R7V1I<BDI#0H
('L-"B
("
:68H)&1H/6]P96YD:7(H)&-U
M<G)?9&ER*2D-"B
("
>PT*("
("
("
("1O=71P=71;,%U;,%T](CQ!
M($A2148]7"(D9FEL96YA;64_<&%T:#TD8W5R<E]D:7)<(CXN/"]!/B([#0H
M("
("
("
)&]U='!U=%LQ75LP73TB/$$
2%)%1CU<(B1F:6QE;F%M93]P
M871H/21P87)E;G1?9&ER7"(^+BX\+T$^(CL-"B
("
("
(" D8V]U;G1E
M<CTR.PT*("
("
("
('=H:6QE*"
D9FEL93UR96%D9&ER*"1D:"DI(3T]
M9F%L<V4I#0H
("
("
("
>PT*("
("
("
("
("
96-H;R B)&9I
M;&4
:7,
82 B+F9I;&5T>7!E*"1F:6QE*2XB/&)R/B([#0H
("
("
("
M("
("!I9B
D9FEL93T])RXG?'PD9FEL93T])RXN)RD-"B
("
("
("
M("
('L-"B
("
("
("
("
('T-"B
("
("
("
("
(&5L<V4
M:68H:7-?9FEL92
D9FEL92DI#0H
("
("
("
("
("![#0H
("
("
M("
("
("
("
(" D;W5T<'5T6R1C;W5N=&5R*RM=6S!=/2(\02!(4D5&
M/5PB)&-U<G)?9&ER+R1F:6QE7"(^)&9I;&4\+T$^(CL-"B
("
("
("
M("
('T-"B
("
("
("
("
(&5L<V4-"B
("
("
("
("
('L-
M"B
("
("
("
("
("
("
("1O=71P=71;)&-O=6YT97(K*UU;,%T]
M(CQ!($A2148]7"(D9FEL96YA;64_<&%T:#TD8W5R<E]D:7(O)&9I;&5<(CXD
M9FEL93PO03XB.R
("
("
("
("
("
("
("
(" -"B
("
("
M("
("
('T-"B
("
("
("!]#0H
("
('T-"B
?0T*("!F;W)E86-H
M*"1O=71P=70
87,
)&ET96TI#0H
("
("
9F]R96%C:"
D:71E;2!A<R D
K<W1R*0T*("
("
("
("
96-H;R D<W1R+B(\8G(^(CL-"B
#0H_/
``
`
end
attached mail follows:
* Thus wrote Joe (arjoe
cuhk.edu.hk):
> I have just started to learn php and written a php to list the files. But
> there is a problem, seen the is_dir() function can't work on remote files.
> Therefore, it couldn't check the filetype of subdirectories.
> Would anyone tell me what should I do.
> Thx a lot
>
Please dont attatch* your php file and expect us to read your code
figure out what you want to do then tell you what to do.
Explain what you are trying to do, and if needed give us small (10
or so lines timed down to do the task) sample of how you go about
it. Your success rate in getting help will be much higher.
*Your file was not attatched properly, please attach file properly
if and when needed.
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
attached mail follows:
hi,
for mobiles: there is a wap-browser for windows-plattform:
http://www.winwap.org
ciao SVEN
Tan Ai Leen wrote:
> Hi,
> I was just wondering there is a emulator for us developers to develop
> programs for palm and handphone, etc. Is there a program that
> emulates the output from various printers on screen?
>
> Regards,
> Tan Ai Leen
attached mail follows:
Actually I am looking for a emulator that works for printers, not phones
attached mail follows:
this is a reply on:
> I am wondering how on php.net the search for functions is done.
You
> can add
> any function just behind the php.net
> like php.net/phpinfo and it will point you right through it. I
know how to
> redirect this as a 404 error in apache to another file, but then
the
> url is
> changing. In the php.net case the url stayes the same.
> Does anybody know how this is done?
reply:
Use a path relative to your httpdocs for your error document, e.g.
ErrorDocument 404 /myerrorpage.php
instead of
ErrorDocument 404 http://mysite/myerrorpage.php
David.
Unfortunatelly this is not what I mean.
Have a look on this:
http://www.globosapiens.net/hially
A php page is redirecting this 404 error to another page, but I would like
to have
the URL stay the same like it is done on php.net
Can anybody help?
Thanx,
Merlin
------------------------------
Worldwide Travel Community
http://www.globosapiens.net
--
<IFRAME
SRC="http://saratoga.globosapiens/associates/report_member.php?u=3&color=EEE
EEE" scrolling=no frameborder=0 TITLE="My travel articles" width="330"
height="155" ALLOWTRANSPARENCY="true"><a href="http://www.globosapiens.net"
title="Worldwide Travel Community"a>Travel Community<a/> </IFRAME>
"David Nicholson" <me
djnicholson.com> schrieb im Newsbeitrag
news:b62fc92a2561538525c89be63f36bf7b
home.djnicholson.com...
Hello,
This is a reply to an e-mail that you wrote on Tue, 22 Jul 2003 at
21:15, lines prefixed by '>' were originally written by you.
> Hi there,
> I am wondering how on php.net the search for functions is done.
You
> can add
> any function just behind the php.net
> like php.net/phpinfo and it will point you right through it. I
know
> how to
> redirect this as a 404 error in apache to another file, but then
the
> url is
> changing. In the php.net case the url stayes the same.
> Does anybody know how this is done?
> Thanx, Merlin
Use a path relative to your httpdocs for your error document, e.g.
ErrorDocument 404 /myerrorpage.php
instead of
ErrorDocument 404 http://mysite/myerrorpage.php
David.
--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/
Professional Web Development by David Nicholson
http://www.djnicholson.com/
QuizSender.com - How well do your friends actually know you?
http://www.quizsender.com/
(developed entirely in PHP)
attached mail follows:
> > Use a path relative to your httpdocs for your error document, e.g.
> > ErrorDocument 404 /myerrorpage.php
> > instead of
> > ErrorDocument 404 http://mysite/myerrorpage.php
> Unfortunatelly this is not what I mean.
I think it is. When you use a relative path in the .htaccess, the URL will
not change, but you will be redirected. Therefor you can use
$_SERVER['REQUEST_URI'] in your 404-page to check what the visitor was
looking for.
HTH,
--
Ivo Fokkema
PHP & MySQL programmer
Leiden University Medical Centre
Netherlands
attached mail follows:
* Thus wrote Merlin (news.groups
web.de):
> this is a reply on:
>
> > I am wondering how on php.net the search for functions is done.
> You
> > can add
> > any function just behind the php.net
> > like php.net/phpinfo and it will point you right through it. I
> know how to
> > redirect this as a 404 error in apache to another file, but then
> the
> > url is
> > changing. In the php.net case the url stayes the same.
> > Does anybody know how this is done?
>
> reply:
>
> Use a path relative to your httpdocs for your error document, e.g.
> ErrorDocument 404 /myerrorpage.php
> instead of
> ErrorDocument 404 http://mysite/myerrorpage.php
> David.
>
> Unfortunatelly this is not what I mean.
>
> Have a look on this:
> http://www.globosapiens.net/hially
> A php page is redirecting this 404 error to another page, but I would like
> to have
> the URL stay the same like it is done on php.net
mod_rewrite can do that.
Or:
header('HTTP/1.0 307 Temporary Redirect');
header('Location: /uri/to/file');
?>
<a href="/url/to/file">moved here</a>
---
<rfc2616 section="10.3.8">
307 Temporary Redirect
The requested resource resides temporarily under a different URI.
Since the redirection MAY be altered on occasion, the client
SHOULD continue to use the Request-URI for future requests.
</rfc2616>
I havn't tested it but the behaviour for the client is specified.
>
> Can anybody help?
>
HTH,
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
attached mail follows:
* Thus wrote Ivo Fokkema (I.F.A.C.Fokkema
LUMC.nl):
> > > Use a path relative to your httpdocs for your error document, e.g.
> > > ErrorDocument 404 /myerrorpage.php
> > > instead of
> > > ErrorDocument 404 http://mysite/myerrorpage.php
> > Unfortunatelly this is not what I mean.
> I think it is. When you use a relative path in the .htaccess, the URL will
> not change, but you will be redirected. Therefor you can use
> $_SERVER['REQUEST_URI'] in your 404-page to check what the visitor was
> looking for.
with ErrorDocument 404 /myerropage.php
The url wont change if the 404 doesn't do any redirection. I've
never tried a 404 to an external page, I don't think its possible
(too lazy to look at apache's docs atm).
cheers
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
attached mail follows:
--- Merlin <news.groups
web.de> wrote:
> Unfortunatelly this is not what I mean.
>
> Have a look on this:
> http://www.globosapiens.net/hially
> A php page is redirecting this 404 error to another page, but I
> would like to have the URL stay the same like it is done on php.net
Then don't redirect to another URL but rather display whatever it is you want
to display. If nothing else, you can simply fetch the alternate URL for the
user like this:
readfile('http://www.google.com/');
Hope that helps.
Chris
=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/
attached mail follows:
Globals off should help you gain performance, but safe mode on is expensive.
desa15
necso.es wrote:
> Hit to all, i have a Sun cobalt Raq 550, with php 4.1 as a module with
> apache 1.3
>
> The load average of my server is ever above 0.20 to 0.60 whith the same
> users
>
> When i turn off register globals and turn on safe mode in php.ini and
> restart the apache daemon to take the changes, the load averge is ever 0.90
> to 1.20
>
> I not found anything about this params affect the optimization, is posible
> ???
> any can help me ??
>
>
> Best rtegards, and excuse my broken english
>
>
>
>
attached mail follows:
* Thus wrote desa15
necso.es (desa15
necso.es):
> Hit to all, i have a Sun cobalt Raq 550, with php 4.1 as a module with
> apache 1.3
>
> The load average of my server is ever above 0.20 to 0.60 whith the same
> users
>
> When i turn off register globals and turn on safe mode in php.ini and
> restart the apache daemon to take the changes, the load averge is ever 0.90
> to 1.20
Have you tried toggling each one seperatly to see which one is
causing the overhead. My bet would be the safe_mode since it has
extra work to do.
If that is the case safe_mode is VERY expensive, or something is
wrong. I hope (nothing personal) that there is something wrong with
your php scripts, because that is too high of a price to pay for
safe_mode.
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
attached mail follows:
hi, i`m working on presentation of php5 features and i would like to add
some comparison between php4 and php5. new coding features are of course
available in doc on php.net, but i`m wondering where can i find benchmarks
that show speed differences between the two. if there are none i would like
to hear from core developers about which types (loops, math operations,
objects code) of code will show the differences so i could write my own
benchmark.
rash
attached mail follows:
* Thus wrote Robert Janeczek (rashid
ds.pg.gda.pl):
> hi, i`m working on presentation of php5 features and i would like to add
> some comparison between php4 and php5. new coding features are of course
> available in doc on php.net, but i`m wondering where can i find benchmarks
> that show speed differences between the two. if there are none i would like
> to hear from core developers about which types (loops, math operations,
> objects code) of code will show the differences so i could write my own
> benchmark.
Since 5 is beta 1, i'm not sure all the documentation is
(officially) out on it. If your concenered about details the
php-dev list might prove useful.
This is the only thing I found, i didn't look to hard:
http://www.php.net/ChangeLog-5.php
Curt.
--
"I used to think I was indecisive, but now I'm not so sure."
attached mail follows:
some more good php5 info...
http://www.phparch.com/news/343
-----Original Message-----
From: Robert Janeczek [mailto:rashid
ds.pg.gda.pl]
Sent: Thursday, July 24, 2003 7:16 AM
To: php-general
lists.php.net
Subject: [PHP] php4 vs php5
hi, i`m working on presentation of php5 features and i would like to add
some comparison between php4 and php5. new coding features are of course
available in doc on php.net, but i`m wondering where can i find benchmarks
that show speed differences between the two. if there are none i would like
to hear from core developers about which types (loops, math operations,
objects code) of code will show the differences so i could write my own
benchmark.
rash
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
<001b01c35165$b42d72d0$2900a8c0
polycarp>
Jonathan Villa:
> Has anyone installed PHP 5 on Windows or Linux using Apache 2?
Yes... on Windows. But it's unstable, don't do it.
attached mail follows:
How about you can get a the world's fastest PC, a 64bit server that handles
8gig of memory that can run cicles around any wintel based machine and still
use all the *nix software without having rewrite anything for say $3k.
That's with 10/100/1000 ethernet ports. It already has hugely more installed
base than Linux (7 million) and can still run all your favorite MS software
even Windows OS if so inclined-- as an additional application. There is no
server/user license fees from the manufacturer. For bigger projects, thing
like Oracle are available. It doesn't require a whole new staff of certified
(READ $$$$$) staff to manage and maintain. In fact, $1k a year can buy you
30min 24/7 phone response and 4hr business hours on-site response time
factory service.
For $6k you can put fibre channel 1.25T of raid data. If you really need a
GUI for all the *nix stuff and perhaps don't care to unload or compile from
source, a "Server" option for $500 will give you all kinds of GUI interfaces
to the settings, again- unlimited users.
Jerry Artman
Budget and Reimbursement
gartm
lssm.org
attached mail follows:
* Thus wrote SLanger
spirit21.de (SLanger
spirit21.de):
> Go with the costs. If you have a running system on apache + php + mysql
> see how much it costs to support that platform. Meaning how high are the
> costs to maintain it. Inclusive administration and deployment of apps.
> Then compare the costs of maintaining a IIS Windows PHP Mysql setup under
> the same circumstances and than add to that the cost of migrating.
> Don't forget to compare upgrade costs in apache and IIS.
From my experience NT admin's are easier to find than UNIX/Linux
admins.
> The sums should make it clear.
Some times costs aren't an issue higher up. MS's marketing
department pushing propaganda out for people to by their products,
is what the higher management sees.
> But don't forget to see why they want to migrate. There might be a good
> reason to do so and you shouldn't be blocking that just because you like
> linux better.
Good policy. This will guarantee a check in the end :)
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
attached mail follows:
need to know which scripts I can get free or at low cost to create a hosting site and to make an e-mail site. The e-mail site need two features one is for free accounts and one is for paid accounts like yahoo.com. But there is one catch yahoo dosn't give as much space as I will for free I will be equal to the low end of yahoo.com and for only 4.95 a year you get unlimited space this of course is unless you have put in info that has helped create this site. Or gave suggestions so as long as you have gave suggestions then you will get unlimited e-mail.
---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
attached mail follows:
check out sourceforget.net, lots of web applications on there for hosting
management, and i believe there's a few email applications.
----- Original Message -----
From: "dan montgomery" <scripts007
yahoo.com>
To: <php-general
lists.php.net>
Sent: Thursday, July 24, 2003 12:55 PM
Subject: [PHP] need help
> need to know which scripts I can get free or at low cost to create a
hosting site and to make an e-mail site. The e-mail site need two features
one is for free accounts and one is for paid accounts like yahoo.com. But
there is one catch yahoo dosn't give as much space as I will for free I will
be equal to the low end of yahoo.com and for only 4.95 a year you get
unlimited space this of course is unless you have put in info that has
helped create this site. Or gave suggestions so as long as you have gave
suggestions then you will get unlimited e-mail.
>
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
attached mail follows:
"CPT John W. Holmes" wrote:
> Why not just
>
> $_SESSION['userArray'] = $userArray;
>
> ??
>
> Then $_SESSION['userArray']['fname'] to access the values, for example.
Well, yes, that does work. And it's an acceptable workaround (I've already
updated my code). It's nice in that it let's me keep the keys that match my
database columns.
However, it's really just that: a workaround. I'd still love to know why I
can't register certain variables and have them stick outside of that one
function. I think I will never find out.
Thank you very much for a very direct alternative.
--
Jeff Stillwall
attached mail follows:
* Thus wrote Jeff Stillwall (jstill
audioengine.net):
> "CPT John W. Holmes" wrote:
>
> > Why not just
> >
> > $_SESSION['userArray'] = $userArray;
> >
> > ??
> >
> > Then $_SESSION['userArray']['fname'] to access the values, for example.
>
> Well, yes, that does work. And it's an acceptable workaround (I've already
> updated my code). It's nice in that it let's me keep the keys that match my
> database columns.
>
> However, it's really just that: a workaround. I'd still love to know why I
> can't register certain variables and have them stick outside of that one
> function. I think I will never find out.
>
I was browsing the php.net site and came accross this:
http://bugs.php.net/bug.php?id=23354
Note the last comment on the bug. It seems that person has been
having the same problem as you.
HTH,
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
attached mail follows:
I am trying to communicate with an API of a vendors of ours. They provide a
Perl example that works fast and well. I am trying to do the same thing with
a PHP class. The response takes over a minute before the response comes
back. I see from the response text that the API is running on Apache
Coyote/1.0. Does anyone know of issues with this match-up, here is the
snippet of code that seems to be hanging. Using my Komodo debugger, it
points to the line with 'while($data=fread($fp, 32768))' while waiting for
execution to continue. Using a Perl script provided by them, I get a
response in seconds. Basically, my PHP page prepares content and variables
and then uses this class to send XML formatted content to receive a
response.
...
$fp=fsockopen($this->server, $this->port, &$this->errno,
&$this->errstr, $this->timeout);
if(!$fp) {
$this->errstr="Cant Connect to Service ($this->server:$this->port,
$this->errno, $this->errstr)";
return;
}
if (!fputs($fp, $op, strlen($op))) {
$this->errstr="Write error";
return;
} else {
$ipd = "";
while($data=fread($fp, 32768)) {
$ipd.=$data;
}
$this->responsetext = $ipd;
//echo "<p>".$ipd."</p>";
$ipd = $this->_parse_header($ipd);
}
fclose($fp);
return $ipd;
...
attached mail follows:
* Thus wrote Robert Fitzpatrick (robert
webtent.com):
> I am trying to communicate with an API of a vendors of ours. They provide a
> Perl example that works fast and well. I am trying to do the same thing with
> a PHP class. The response takes over a minute before the response comes
> back. I see from the response text that the API is running on Apache
> Coyote/1.0. Does anyone know of issues with this match-up, here is the
> snippet of code that seems to be hanging. Using my Komodo debugger, it
> points to the line with 'while($data=fread($fp, 32768))' while waiting for
> execution to continue. Using a Perl script provided by them, I get a
> response in seconds. Basically, my PHP page prepares content and variables
> and then uses this class to send XML formatted content to receive a
> response.
>
> ...
> $fp=fsockopen($this->server, $this->port, &$this->errno,
> &$this->errstr, $this->timeout);
>
> if(!$fp) {
> $this->errstr="Cant Connect to Service ($this->server:$this->port,
> $this->errno, $this->errstr)";
> return;
> }
>
> if (!fputs($fp, $op, strlen($op))) {
which HTTP version are you requesting? I know that if you send a
HTTP/1.1 then a lot of servers send the data in chunks, thus your
retrieval code needs to be different. If it is HTTP/1.1 try using
HTTP/1.0 instead.
> $this->errstr="Write error";
> return;
> } else {
>
> $ipd = "";
> while($data=fread($fp, 32768)) {
Have you tried smaller requests mabey 512? although that shouldn't
matter, but you might be able to see if it is getting data back at
all.
> $ipd.=$data;
> }
HTH,
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
attached mail follows:
> > if (!fputs($fp, $op, strlen($op))) {
>
> which HTTP version are you requesting? I know that if you send a
> HTTP/1.1 then a lot of servers send the data in chunks, thus your
> retrieval code needs to be different. If it is HTTP/1.1 try using
> HTTP/1.0 instead.
>
Same difference with the 1.0, I was using 1.1, here is the complete request
and response. The response comes back as 1.1 regardless of what I use (of
course, the xml parameter is urlencoded):
Request:
POST /XMLCommunicationServlet HTTP/1.0 Content-Type:
application/x-www-form-urlencoded User-Agent: PHP XMLRPC Host:
api.newedgenetworks.com:80 Connection: keep-alive Content-Length: 758
txnType=P&partner=&xml=%3C%3Fxml+version%3D%221.0%22%3F%3E%3C%21DOCTYPE+preq
ualrequest+SYSTEM+%22http%3A%2F%2Fapi.newedgenetworks.com%3A80%2Fdtd%2Fprequ
alrequest.dtd%22%3E%3CPrequalRequest%3E++++%3CIdentification%3E++++++++%3CUs
er%3Eusername%3C%2FUser%3E++++++++%3CPassword%3mypassword%3C%2FPassword%3E++
++%3C%2FIdentification%3E++++%3CServiceType%3ER%3C%2FServiceType%3E++++%3CAd
dress%3E+++++++%3CStreet1%3E2780+CEDARLINKS+DRIVE%3C%2FStreet1%3E+++++++%3CC
ity%3EMEDFORD%3C%2FCity%3E+++++++%3CState%3EOR%3C%2FState%3E+++++++%3CZipCD%
3E97504%3C%2FZipCD%3E++++%3C%2FAddress%3E++++%3CPhone%3E++++++++%3CPhoneNPA%
3E541%3C%2FPhoneNPA%3E++++++++%3CPhoneNXX%3E772%3C%2FPhoneNXX%3E++++++++%3CP
honeSuffix%3E6990%3C%2FPhoneSuffix%3E++++%3C%2FPhone%3E%3C%2FPrequalRequest%
3E
Response:
HTTP/1.1 200 OK Content-Type: text/xml Content-Length: 343 Date: Thu, 24 Jul
2003 15:18:52 GMT Server: Apache Coyote/1.0 Connection: Keep-Alive
1050Prequalification failed: AggregateCircuit unavailable
> > $ipd = "";
> > while($data=fread($fp, 32768)) {
>
> Have you tried smaller requests mabey 512? although that shouldn't
> matter, but you might be able to see if it is getting data back at
> all.
>
Yes, I've tried 128 and get the same delay.
Thanks for any help:)
--
Robert
attached mail follows:
I wanna be able to take a URL
http://www.mysite.com/downloads/file_1_a.pdf
and then remove:
http;//www.mysite.com/
then add:
/host/sites/site1/web/
to
downloads/file_1_a.pdf
Turning:
http://www.mysite.com/downloads/file_1_a.pdf
Into:
/host/sites/site1/web/downloads/file_1_a.pdf
I know I need to look up strings, but can someone point me in the right
direction (I wanna learn, so don't give too much away!)
*********************************************************************
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.
************************************