php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38082 $_SERVER['REQUEST_URI'] print different string in the same script
Submitted: 2006-07-12 16:38 UTC Modified: 2006-07-20 15:54 UTC
From: antonio dot riva at gmail dot com Assigned:
Status: Not a bug Package: Output Control
PHP Version: 4.4.2 OS: Linux
Private report: No CVE-ID: None
 [2006-07-12 16:38 UTC] antonio dot riva at gmail dot com
Description:
------------
when i load a page with a url like this "test.php/ciao/ciao/ciao" i want to execute the script test.php and store the content of $_SERVER['REQUEST_URI'] in a the session array or in a file...

the problem is that the browser execute a new request for the favicon and the url is saved in the file or in the session but if i print the $_SERVER['REQUEST_URI'] to screen it shoe the right value

Reproduce code:
---------------
<?php
	session_start();
?>
<html><head>
<link rel="shortcut icon" href="./favicons.ico"/>
</head><body>
<?
	$string = $_SERVER['REQUEST_URI'];
	$f=fopen("temp",'w');
	fwrite($f,$string);
	fclose($f);
	$_SESSION['variabile']=$string;
	echo "<b>variabile:</b> ".$_SESSION['variabile'];
?>
</body></html>


this is the url that generate the bug: test.php/ciao/ciao/ciao

Expected result:
----------------
test.php/ciao/ciao/ciao in the file
test.php/ciao/ciao/ciao to screen

Actual result:
--------------
test.php/favicons.ico in the file
test.php/ciao/ciao/ciao to screen

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-07-20 15:54 UTC] tony2001@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

This is expected since Apache redirects all requests to the PHP file when you use such URLs.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 03:01:28 2024 UTC