0

I'm starting to learn some web design and integrating PHP scripts with ajax calls to avoid browser refreshes and noticed that my companies site (which I don't have access to the files) has a weird thing going on with the address bar.

So usually the address is like www.site.com/admin.php, and if I click a link that brings me to www.site.com/Users.php (hovering shows this address) BUT the address stays at www.site.com/admin.php.

Heres the weird part. If I middle click the link(open in a new tab) the address will then become www.site.com/Users.php and all of the $_POST and $_GET calls will show up in the address bar like www.site.com/Users.php?user=Adam.

I use this a lot because if i try to refresh the users page, it goes back to the default admin.php page unless I opened it in a new tab.

I was wondering if there is a reason why clicking a link normally keeps the address the same and doesnt change the admin.php to Users.php?

Eric G
  • 928
  • 1
  • 9
  • 29
  • Check if there is an html iframe element inside the code, that would explain the behaviour – PAlphen Dec 16 '15 at 21:58
  • This sounds like it must be the result of existing AJAX code on your site, which is trying to load any linked content into the current document. This doesn't happy generally, and we don't know what code is running on your site. – Jeremy Dec 16 '15 at 21:58
  • the site probably uses `frames` – cmorrissey Dec 16 '15 at 21:58
  • Clicking on the link is running some Javascript that updates the page instead of going to the URL in the link. It either performs an AJAX query to update the page, or it changes an iframe to point to a different source. – Barmar Dec 16 '15 at 22:05
  • I can confirm that there are frames. So there is a frame for the navigation of panels via menus on the right side which disappears when you open a link in a new tab. If you click a link instead, the frameset is being updated. – Eric G Dec 16 '15 at 22:05
  • 1
    It is probably too late to change your system, but [Frames are bad](http://stackoverflow.com/questions/3073706/why-frames-are-bad). Make your boss knows it hurts *your* efficiency and, next time (if there is a next time), have the developer promise not to use them. – Sheepy Dec 17 '15 at 00:38

1 Answers1

1

The website is probably using frames to load its pages. So although you are navigating to site.com/Users.php, this is all really going on inside a frame view.

See this code for example:

<html>

<iframe name="frame"></iframe> 

<span><a href="Users.php" target="frame">Go to Page</a></span>

</html>

You can click on the link, and although the frame will display the content at Users.php, you will still be on the original page you landed on.

Nicholas F
  • 141
  • 4