$_SERVER['REQUEST_URI'] Not Working

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
AliasBDI
Forum Contributor
Posts: 286
Joined: Fri Nov 15, 2002 10:35 am
Location: Spring, TX, USA

$_SERVER['REQUEST_URI'] Not Working

Post by AliasBDI »

I have a page where I am trying to grab the URL and explode it into arrays. But the $_SERVER['REQUEST_URI'] returns nothing. Here is my code:

Code: Select all

<?php
$req = $_SERVER['REQUEST_URI'];
echo $req;
?>
What should I do?
User avatar
bokehman
Forum Regular
Posts: 509
Joined: Wed May 11, 2005 2:33 am
Location: Alicante (Spain)

Post by bokehman »

This is a server issue. If it is not there it is because the server is not passing it to PHP. You could always try a combination of $_SERVER['HTTP_HOST'] and $_SERVER['PHP_SELF'].
Post Reply