User Contributed Notes: HTTP functions
jrochkin@cs.oberlin.edu
24-Mar-2000 03:54
Yes, see the file() function. It works on http requests too, even though it's grouped with filesystem functions.
kris.y@gdm.co.th
26-Mar-2000 08:09
How do I store URL data into variable? such as $data = http://r.r.com
Please help!
==Kris==
a.ha@home.se
27-Mar-2000 10:01
How do I get the current url?
info@clonewars.de
27-Mar-2000 01:29
How do i get the web server root? "/" always is the absolute root....
dave@kineticenergy.com
28-Mar-2000 11:49
try this for your url
<pre>$filelocation=$HTTP_HOST.$PHP_SELF;
</pre> <pre>echo($filelocation);</pre>
raj@lauhala.com
17-Apr-2000 02:18
How to go back to the page I just came from without reloading it?
dar@dualhead.com
17-Apr-2000 10:09
How can I retrieve the 'last modified' date of a page? I need to create a PHP function similar to Perl's If-Modified-Since...
smeelen@signet.nl
19-Apr-2000 02:49
to go one page back without reloading
try this :
echo "<A href='javascript:history.go(-1)'>Back</A>";
succes !
upadhyay@goplay.com
20-Apr-2000 10:34
i want to create a page which ll refresh itself every 10 sec or if the page is modified since then....
how can i do that?
hercules@drinkspecials.com
22-Apr-2000 09:50
<pre>
To make a page that refreshes itself every 10 seconds, use a meta tag. <META HTTP-EQUIV="Refresh" CONTENT="10; URL=http://www.php.net">
The previous tag will cause the page that you are on to refresh in 10 seconds
to http://www.php.net .
</pre>
dhpainter@msn.com
26-Apr-2000 10:35
To create a link to the previous page you can use the <pre> getenv("HTTP_REFERER") </pre> command and set it up as a hyperlink. You might also want to put a IF condition on it so it won't get displayed if the user has gone straight in to the page.
Jeffrey Thompson <jeffrey@thompsonic.com>
29-Apr-2000 06:25
Determining the type of browser:
<PRE>
I need to code around Javascript incompatibility problems based on the
version and type of browser.
Info on get_browser() function:
http://www.php.net/manual/function.get-browser.php3
and I was looking on http://www.php.net/FAQ.php3 and found:
2.6 Where do I find the Browser Capabilities File?
You can find PHP's own browscap.ini file at
http://php.netvision.net.il/browscap/. There is also another
browscap.ini file at http://www.cyscape.com/asp/browscap/.
Hope it helps.
Jeffrey Thompson
Thompson Internet Communications, Inc.
http://www.thompsonic.com/
</PRE>
test@test.nl
11-May-2000 05:42
<meta http-equiv="Refresh" content="10; url=http://www.dds.nl">
peitje@dds.nl
11-May-2000 06:39
I believe...<meta http-equiv="Refresh" content="10; url=http://www.dds.nl">... The government...
jindra@vavruska.cz
15-May-2000 10:14
I was not able to make
<pre>
header("Content-type: application/xml")
</pre>
working if the method was POST. Instead, it returned the default
<pre>
Content-type: text/html
</pre>
and two error messages:
1. Warning: POST Error: Content-type missing in ...<path to the PHP script>... at line 0
2. Warning: cannot add more header information - the header was already sent ...
When I do the same with GET, no problem
(Apache 1.3.12/Win32, PHP 3.0.15/Win32 as CGI)
rob@OhReally.com
29-Jun-2000 08:59
To display the current URL, I'd rather use <PRE>$REQUEST_URI</PRE> or <PRE>$SERVER_NAME.$REQUEST_URI</PRE>. This will include the query-string.
Make a <PRE>phpinfo()</PRE> file to see all environment variables.
Rob
dadams@bulbs.com
07-Jul-2000 04:13
does anyone know how to redirect the user to another page?
rob@OhReally.com
07-Jul-2000 08:22
To redirect your visitors without interference (no warning/explanation) you should use <PRE>header("Location: http://some.server.com");</PRE>
If you would first like to tell your visitors what is going to happen ('You'll be redirected in 5 secs') you should consider meta-tags or JavaScript.
php@ohti.co.uk
10-Jul-2000 01:56
is there a way to retrieve the content of a web page that starts with https i have all user names, passwords and permission. I have tried file() and its equiv' but it dosn't appear to support it. pre TQ
statix_@hotmail.com
13-Jul-2000 04:12
Hey, I'm looking for a function that can return a directory listing of a website just as if you went to a page with no index. Any help would be great.
brian@backbonetechnology.com
17-Jul-2000 05:11
Is there a way to trap error or warning messages from the browser so that I can display my own?
paul@honeylocust.com
21-Jul-2000 09:28
Is there any way I can know if it's legal to send a Header() at any particular time? I'm writing an error handling function that will redirect the user to a new page if the error happens before any information has been output -- but sends a message with die() otherwise.
jay@webtechnw.com
25-Jul-2000 06:29
I need to parse a response from a webserver over https. A simple fopen statment seems to be close to what im looking for, however the default method is a GET request, where I must have a POST request. In short.. i need to post variables to a script on another server and then process its response.
james_k_m@yahoo.com
27-Jul-2000 06:55
I have a table showing results from a Mysql database. There are 4 columns. Now my problem is that on clicking on a particular row of any column it should send a value to the calling program to open another page.
jfbolus@m3com.com
31-Jul-2000 04:05
I've got a problem with Internet Information Server 4.0. Lets say, for example, I send header("HTTP/1.0 404 Not Found"). When I go to the page, I should get a 404 Not Found error right? Apparently not, cause it doesn't happen. This is the header information that IIS sends when I make a request for that page.
HTTP/1.1 200 OK <--Notice
Server: Microsoft-IIS/4.0
Date: Mon, 31 Jul 2000 13:59:35 GMT
HTTP/1.0 404 Not Found <--Notice
X-Powered-By: PHP/3.0.16
Content-type: text/html
Anybody have any ideas about what to do?
mkhenry@sympatico.ca
04-Aug-2000 05:23
Does anyone know how I can pick-up where an http request wants to go, and then based on that information, load their page?