I want to know how I can pass parameters between pages through the URL without having to add variables eg:
mydomain.com/file.php?var1=val1&var2=val2&...varN=valN
I want to use it as follows:
mydomain.com/file.php?val1-val2-...-valN
I also see in some website the URL is in the following format
mydomain.com/file/####
which redirects to another page without changing the URL as if this is the URL to the file.
You should use .htaccess
Here’s an example:
This basically means that if the URL is formatted according to the regular expressions above (number – slash – alphanumeric,dashes or underscores) than the content should be displayed from index.php while passing the file two parameters called var1 and var2, var1 having the value of the number and the second having the value of what’s after the first slash.
Example:
Would actually mean
Of course, in your index.php file you can simply take the values using
Cheers!