PHP - Request_uri
I have the below php in my 404.php in wordpress. Recently we moved our main site url to wordpress from IIS. Company name is important. I want to treat any url that contains \prtaxsvc to not change from POST to GET as I need to run a WCF .svc file on the old server which runs IIS ( cant run a .svc on wordpress hosted site ) any clue on how to make this work. I think I need to make \prtaxsvc report as 308 or 307 and leave other old calls as 301. Right now it fails to send .svc to old server.. thanks
get_header(); header("Location: http://www.mysite.com{$_SERVER['REQUEST_URI']}"); exit(); ?> Similar TutorialsI currently have $_SERVER['REQUEST_URI'] which echos /dir/page etc How can I modify it so it only echo's /dir/ Otherwords I want to lose the page. Hello PHPers, Need help. I am using $_SERVER['REQUEST_URI']; in order to obtain the URL that the visitor came from. No matter what I try to change I get more info than required. IE. mojo/mojo.php?width=640&height=480&doc_location=/&doc_title=Marc%20Rob&doc_refer=http%3A//www.aaa.com.au/rob.html instead and what I should be getting is just http://www.aaa.com.au/rob.html Could somebody please help me and let me know why this is appearing with the extra info which I do not want. Thank you. HJ Hi all, title says it all: how do I get the request_uri from the parent frame. I do not have editing acces to the parent frame, but I want to know what page is called to behind the slash. The tag it is in is frameset and then frame, so not iframe. I hope someone knows the answer Thanks in advance, masteRens Hi I have some php webpages that where working OK. Now this error has suddenly appeared: Notice: Undefined index. REQUEST_URI in menu.php on line 4 Here are the first 6 lines from menu.php: Code: [Select] <div style="float: left; width: 150px; margin-left: 0; padding-left: 0;"> <ul style="margin-left: 0; padding-left: 0; color: white;"> <li class="accordionButton style="color: red;"<?php if (basename($_SERVER["REQUEST_URI"]) == "index.php") { echo " active_link"; } ?>"> <a class="rfpMenuBtn" style="color: grey;font-size: 11pt;" href="index.php">Home</a></li> Also when I click on a link from the above menu.php the php include files for the link are not parsed only the html in the actual file that I link to appears nothing from the php include files. I've recently tried to do some cleaning up on my pc in the process I ran "Free Windows Registry Repair 2.5" and SpeedUpMyPC 2011. I don't know if one of these caused the problem. My OS is Windows XP I've installed xampp with php for windows. I'm using HTML-Kit to write php pages. Another change I've noticed is that before the clean up, to preview pages in HTML-Kit I would first have to run: iisreset -stop , then start Apache from xampp control panel. Now the preview works with and without running iisreset and starting Apache. Some-one from another forum suggested I run print_r($_SERVER) this is the output I received: Code: [Select] Array ( [ALLUSERSPROFILE] => C:\Documents and Settings\All Users.WINDOWS [APPDATA] => C:\Documents and Settings\davidm.DAVID\Application Data [CLASSPATH] => .;C:\Program Files\QuickTime\QTSystem\QTJava.zip [CommonProgramFiles] => C:\Program Files\Common Files [COMPUTERNAME] => DAVID [ComSpec] => C:\WINDOWS\system32\cmd.exe [FP_NO_HOST_CHECK] => NO [HOMEDRIVE] => C: [HOMEPATH] => \Documents and Settings\davidm.DAVID [INCLUDE] => d:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\include\ [LIB] => d:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Lib\ [LOGONSERVER] => \\DAVID [NUMBER_OF_PROCESSORS] => 2 [OS] => Windows_NT [Path] => C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;D:\Program Files\Samsung\Samsung PC Studio 3 [PATHEXT] => .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH [PROCESSOR_ARCHITECTURE] => x86 [PROCESSOR_IDENTIFIER] => x86 Family 6 Model 23 Stepping 6, GenuineIntel [PROCESSOR_LEVEL] => 6 [PROCESSOR_REVISION] => 1706 [ProgramFiles] => C:\Program Files [QTJAVA] => C:\Program Files\QuickTime\QTSystem\QTJava.zip [SESSIONNAME] => Console [SystemDrive] => C: [SystemRoot] => C:\WINDOWS [TEMP] => C:\DOCUME~1\DAVIDM~1.DAV\LOCALS~1\Temp [TMP] => C:\DOCUME~1\DAVIDM~1.DAV\LOCALS~1\Temp [USERDOMAIN] => DAVID [USERNAME] => davidm [USERPROFILE] => C:\Documents and Settings\davidm.DAVID [VS71COMNTOOLS] => d:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\ [VS90COMNTOOLS] => d:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\ [windir] => C:\WINDOWS [__COMPAT_LAYER] => EnableNXShowUI [PHP_SELF] => [REQUEST_TIME] => 1315219257 ) PHP Notice: Undefined index: REQUEST_URI in menu.php on line 14 PHP Notice: Undefined index: REQUEST_URI in menu.php on line 19 PHP Notice: Undefined index: REQUEST_URI in menu.php on line 24 PHP Notice: Undefined index: REQUEST_URI in menu.php on line 29 PHP Notice: Undefined index: REQUEST_URI in menu.php on line 34 PHP Notice: Undefined index: REQUEST_URI in menu.php on line 39 PHP Notice: Undefined index: REQUEST_URI in menu.php on line 45 PHP Notice: Undefined index: REQUEST_URI in menu.php on line 50 PHP Notice: Undefined index: REQUEST_URI in menu.php on line 55 PHP Notice: Undefined index: REQUEST_URI in menu.php on line 60 PHP Notice: Undefined index: REQUEST_URI in menu.php on line 65 PHP Notice: Undefined index: REQUEST_URI in menu.php on line 70 PHP Notice: Undefined index: REQUEST_URI in menu.php on line 75 PHP Notice: Undefined index: REQUEST_URI in menu.php on line 81 This is all Chinese to me and I'm English. I'm a complete php novice. Any help greatly appreciated. Thanks David Hi there, I am having some issues with a page failing security tests because of a form. The form's text input files is getting sanitized when posted but the only thing I can think is that the form action="" is $_SERVER['REQUEST_URI'] and this then includes anything that is within the URL. <form name="zipcode" id="zipcode" action="<?php echo htmlentities($_SERVER['REQUEST_URI'], ENT_QUOTES, "UTF-8"); ?>" method="post"> <label for="zip" class="smalllbl">Zipcode: </label> <input type="text" class="smallzip" name="zip" id="zip" value="" /> </form> Has anyone else experienced this when running PCI Compliance style security tests? And if you have, why would this happen as the same form action is used elsewhere with no issues. Many thanks in advance Simon |