html - Using link data as PHP variable input -


i have link. eg. abc.com/qwerty. want extract part after / of every input examples below , use php input value , store variable $page. essentially, link abc.com/qwerty should work abc.com/proc.php?x=qwerty

typed link        part used php input  abc.com/cvbx      cvbx abc.com/ghvs      ghvx abc.com/pabc      pabc 

how can this?

you can use: $_server['request_uri']

$request_uri = $_server['request_uri']; //returns '/cvbx' $segments = array_filter(explode('/', $request_uri)); //array_filter remove empty elements. 

Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -