IvanSerrano Posted May 6, 2012 at 08:03 PM Report #453451 Posted May 6, 2012 at 08:03 PM Boa noite Eu criei um site e precisei de redireccionar amigos e faço através do seguinte código http://localhost/partilha/individuo.php?idamigo=2'>http://localhost/partilha/individuo.php?idamigo=2 se o utilizador alterar isso para http://localhost/partilha/individuo.php? Vai dar muitos erros na pagina... A minha duvida é a seguinte, como e que eu redirecciono uma url por exemplo se tiver assim http://localhost/partilha/individuo.php? manda o utilizador para o index por exemplo. Cumprimentos
ruiFernandes Posted May 6, 2012 at 08:24 PM Report #453455 Posted May 6, 2012 at 08:24 PM Boas, fazes a verificação da variável no inicio da página "individuo.php", algo como: if(isset($_GET['idamigo']) && $_GET['idamigo'] != 0){ // executa o código }else{ header("Location: index.php"); // Redirecciona para o index.php } Cumprimentos, - Rui Fernandes
IvanSerrano Posted May 6, 2012 at 09:21 PM Author Report #453464 Posted May 6, 2012 at 09:21 PM Obrigado =)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now