0

I got an error, i was using header location to redirect after verify a condition and with localhost it was great. But I uploaded the web and now I got an error. I know the problem its because I use header location a lot of times and not in head, but between html and php code.

What can I use to redirect users to another page in this case? You know between.

Thank you very much.

2
  • JavaScript: window.location Commented Sep 25, 2013 at 0:16
  • If you can handle the condition server side use header("Location: /newUrl"); Commented Sep 25, 2013 at 0:21

1 Answer 1

1

I am not sure I understand your issue properly, however you can always use JavaScript to perform a redirection.

if (someCondition) {
    window.location.href = 'newUrl';
}

However, it's probably better to perform the redirection server-side. Have you tried http_redirect?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.