1

Iam using below line in my script tag, here is that line:

var url = "<?php echo $_SERVER['PHP_SELF']; ?>";

The above line working fine and its redirecting to http://mysite.com , but I want it to redirect to http://mysite.com/shop/c/mycategoryname

where mycatgeoryname should be whatever the category-name it was in url, that I shud get..

can anyone pls..?

user1814852
  • 135
  • 1
  • 1
  • 5

1 Answers1

0

You are looking for $_SERVER['PATH_INFO']

This will return an array with all the information related to the path. You should be able to see what is returned by doing print_r($_SERVER['PATH_INFO']);

Hope this helps.

Farhan Ahmad
  • 5,148
  • 6
  • 40
  • 69