Why does this URL act squirrely?

Here's my URL: http://localhost/southArea/org_chart_results.php?manager=Candace%20Blaquiere#25

The first part of the URL (manager) tells what portion of the page (which is normally hidden) needs to be visible. The "#" tells the page where to situate itself so the user is immediately directed to that part of the page where the name is visible.

What's happening is everything works fine, as far as the portion of the page that needs to be visible is seen, but the second part - the "#" doesn't. But here's where it gets weird. If I refresh the page, THEN it goes to the part of the list where the "<a name" is 25.

it's an intranet site, so to re-create the dynamic would require me to duplicate the database and put the whole infrastructure on a publicly accessible interface and I can do that, but I'm hoping that just the appearance of the URL, if it appears flawed to a mind greater than my own, can make a suggestion.

Bottom line: Is there something that I can do "better" in the way I'm structuring my URL so I can get an accurate "placement" of my page's content at first brush rather than having to refresh the page in order to position it correctly?

You can see what the page looks like by heading out to http://brucegust.com/portfolio/verizon/test.php. This is a static version of the page that's fed by a database normall. But with this example, you can see how I've postioned the id of every team member with a span and hopefully that gives you enough of a view under the hood where you can tell if there's something else / better I should be doing.

Thanks!
Bruce GustPHP DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
The '#' anchor is only guaranteed to work on the current page and is obsolete in HTML5.  http://www.w3schools.com/tags/att_a_name.asp  Also... it is bad practice to start a name on a page with a number.  Javascript in particular does not like that.
0
Bruce GustPHP DeveloperAuthor Commented:
Dave, I can reconfigure my search function, but is there a way that I can accomplish the effect that I'm looking for using a different approach? I just like being able to respond to the search criteria with the name referenced as part of a list. Is there a way to do that correctly?
0
Dave BaldwinFixer of ProblemsCommented:
Probably but 'named anchors' is not guaranteed to work.  And is obsolete in HTML5.  You could use PHP to re-arrange the search results.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bruce GustPHP DeveloperAuthor Commented:
OK, Dave!

I'm going to try a Javascript route.

Thanks for steering me in the right direction.
0
Dave BaldwinFixer of ProblemsCommented:
You're welcome.  Remember that names in javascript including HTML element names must start with a letter and not a number.  See here: http://www.w3schools.com/js/js_variables.asp
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.