If you have used, say the the following url to get to a page:
[url]http://www.your_domain/somepage.php?variable=1;[/url]
Is it possible to change that page url to, i.e. remove the variable passed
[url]http://www.your_domain/somepage.php[/url]
If you have used, say the the following url to get to a page:
[url]http://www.your_domain/somepage.php?variable=1;[/url]
Is it possible to change that page url to, i.e. remove the variable passed
[url]http://www.your_domain/somepage.php[/url]
Hey I am n00b, but hey i wanna contribute as well...
i think there are 4 solutions to your problem.
3 solutions that keep the variable passed in memory
- use form to submit the variable, but i assume u considered that
- use javascipt to change tha url value. dunno if thats possible
- use php sessions, then u dont need to work with variables in the url, however peeps referred from the page that does not start the session will keep the url with variable
1 solution that neglects the variable passed
- use header('location:somepage.php'); te refresh
if your using apache you might also look into using mod_rewrite
Thanks to all for there tips and hints, i found that it was a small problem - a misplaced /. BUT your suggestions were much appreciated....
What i have is a Submit button (Main) that points to Main.php which i want to go to when the button is pressed.
I use the following
if (isset($_POST['MainPage'])) {
header("Location: Main.php");
exit;
}
BUT on the pages accessed with a variable in the URL this wasn't working due to a / in the URL before the variable.
-SEE EXAMPLE
EXAMPLE:
IF URL IS [url]http://www.your_domain/somepage.php/?variable=1; [/url]
AND YOU PRESS MAIN BUTTON you end up with NEW URL = [url]http://www.your_domain/somepage.php/Main.php[/url]
BUT IF THE URL IS [url]http://www.your_domain/somepage.php?variable=1;[/url]
-i.e. same URL without the / before the ?variable=1
AND YOU PRESS MAIN BUTTON you end up with NEW URL = [url]http://www.your_domain/Main.php[/url]