herghost Posted September 24, 2009 Share Posted September 24, 2009 Hi all, Sorry couldn't decide if this was ajax or php... Basically I have an ajax function that opens a page in the <main> div tags set in my css. The look like this: <a href="javascript:ajaxpage('about.php', 'main');">About</a> How would I go about formating this to work in an php header tag? <?php header ("Location:??????????"); ?> Many Thanks Quote Link to comment https://forums.phpfreaks.com/topic/175342-ajax-in-header/ Share on other sites More sharing options...
trq Posted September 24, 2009 Share Posted September 24, 2009 You wouldn't. Do you even know what the php header function does? Quote Link to comment https://forums.phpfreaks.com/topic/175342-ajax-in-header/#findComment-924042 Share on other sites More sharing options...
herghost Posted September 24, 2009 Author Share Posted September 24, 2009 As far as I am aware (or what i have been using it for!) is to redirect the user after a database query has been successful Quote Link to comment https://forums.phpfreaks.com/topic/175342-ajax-in-header/#findComment-924052 Share on other sites More sharing options...
trq Posted September 24, 2009 Share Posted September 24, 2009 It is for setting http headers. One of those headers happens to redirect the page. Quote Link to comment https://forums.phpfreaks.com/topic/175342-ajax-in-header/#findComment-924462 Share on other sites More sharing options...
Alex Posted September 24, 2009 Share Posted September 24, 2009 It's always good to read the guide when uncertain, header() Quote Link to comment https://forums.phpfreaks.com/topic/175342-ajax-in-header/#findComment-924463 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.