PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Thu Oct 19, 2017 1:18 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Thu Aug 10, 2017 10:02 am 
Offline
DevNet Master

Joined: Wed Oct 08, 2008 3:39 pm
Posts: 4349
Location: United Kingdom
I need to get hold of the URL to identify if it is a /blog/ URL.

I have tried this on PHP7.1, but it is echoing nothing.

Syntax: [ Download ] [ Hide ]
<?php  
echo "The query string is: ".$_SERVER['QUERY_STRING'];  
?>

What am I doing wrong?

_________________
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.


Top
 Profile  
 
PostPosted: Thu Aug 10, 2017 11:46 am 
Offline
Spammer :|
User avatar

Joined: Wed Oct 15, 2008 2:35 am
Posts: 6573
Location: WA, USA
$_SERVER[QUERY_STRING] is half right.


Top
 Profile  
 
PostPosted: Fri Aug 11, 2017 3:10 am 
Offline
DevNet Master

Joined: Wed Oct 08, 2008 3:39 pm
Posts: 4349
Location: United Kingdom
$url = $_SERVER['REQUEST_URI'];

_________________
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.


Top
 Profile  
 
PostPosted: Fri Aug 11, 2017 11:57 am 
Offline
Forum Contributor

Joined: Fri Jul 20, 2007 11:29 am
Posts: 338
var_dump( $_SERVER );

And look at all the things you have to choose from. Google the key names to find out more about each.

_________________
Warning: I have no idea what I'm talking about.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: Bing [Bot] and 19 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group