Reputation: 121
I would like to use a php header('Location: newpage.php') to redirect.
I got no error, but Jquery mobile seems to fail loading the destination page and the address bar stays with the old address.
Do you have an advice please ?
Thanks!
Upvotes: 12
Views: 11392
Reputation: 3470
I had the same problem on Node.js + JQM and the answer wenkhairu gave fixed it.
The problem is that JQM hijacks navigation behavior and use ajax to navigate, if you put data-ajax=false
as wenkhairu suggested you tell JQM not to hijack navigation for this form and use regular link/submit behavior
Upvotes: 0
Reputation: 4826
Try turning error reporting on:
ini_set('error_reporting', E_ALL);
ini_set("display_errors","1");
Upvotes: -1
Reputation: 1174
I do a header('Location: newpage.php') combined with JQuery Mobile all the time and it works no problem.
I suspect you are trying to send the header after loading any html, which will not work. The php header must occur before any output, including html, JQuery Mobile, etc.
Upvotes: 0
Reputation: 1310
try to add data-ajax="false"
when you call that page, before redirecting using php header()
Upvotes: 14
Reputation: 13511
That code sends a 302 redirect header to the user's browser, instructing it to redirect to the provided URL. It should work. Have you checked the syntax? Information here: http://www.php.net/manual/en/function.header.php
Upvotes: 1