Naming URLs in a different way


DELTARE

Generally, we always see URLs like below ↓

The target file is ‘ detail.html ‘.

http://www.example.com/page.php?view=detail

The codes can be written just like this

===================================================================
<?php

if($_GET[‘view’] == ‘detail’) {

    include(‘detail.html’) ;

    exit() ;

?>
===================================================================

This is my version, changing into a shorter URL ↓

http://www.example.com/page.php?detail

===================================================================

<?php

if(preg_match(“/detail/”,$_SERVER[‘REQUEST_URI’])) {

    include(‘detail.html’) ;

    exit() ;

?>

===================================================================

 

 

● ○ Please feel free to use your own innovation applying to use    =)

View original post

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s