Hey everyone,

I'm having a trouble with the navigation bar when redirecting users to other pages. For example, if a user logs in, then they will be redirected to the main page (mysite/index.php) but the url displays as mysite/login.php which is the pure PHP script that doesn't contain any HTML lines in it. I guess that is fine, but the nav bar on the main page disappears unless I refresh the page to get it back.

I hope to hear from someone here. cheers

Recommended Answers

All 3 Replies

redirected to the main page (mysite/index.php) but the url displays as mysite/login.php

So, I know more about asp.net than PHP, but it doesnt sound like the client is an actually being redirected. It appears that the web server is just providing the client with the contents of index.php in its response to the login process. The equivalent in asp.net is server.transfer().

it is to do with jQuery framework. In php, we have header('Location:yoursite') which I assume does similar thing to server.transfer()..

I solved it. For anyone who is having the same problem, this line needs to be added data-ajax="false" to anchor tags. So you'd end up having a similar line to this

<a href="index.php" rel="external" data-ajax="false"> home </a>

I hope this thread helps you if you're reading it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.