Page 1 of 1

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!

Pre-Selecting Tabbe...
Clear all

[Solved] Pre-Selecting Tabbed Menu Items on PHP Page

2 Posts
2 Users
0 Reactions
Joined: 1 second ago
Posts: 0
Topic starter  

I’m a UX designer who has to do some web development on a vendor’s platform. The vendor’s system is php and frequently uses iframes to place content, so I spend a lot of time trying to find ‘creative’ solutions to pages I have to build myself.

I’m creating a basic css tab menu. I need to be able to link users to this page with specific tabs open for different use cases. Our vendor says they can’t help us with this “because it’s a php page”. I feel like this should be possible, but I don’t have deep dev knowledge.

Stripped down example:

I appreciate any suggestions. Thank you!

Famed Member Admin
Joined: 11 years ago
Posts: 2726

So, if I understand you correctly: You have a page a tab menu, something like the screenshot below;

Now you want to be able to send a link to a user, which right away opens a specific tab, say the "FAQ" page.

In that case, PHP is most certainly possible, but probably not your best choice.
Note: I'd probably walk away from a vendor that cannot handle PHP - kind-a basic knowledge if you ask me.

If you decide to do this in PHP, then you could use GET or POST (FORMs) to set the CSS style accordingly - if this is the same PHP file or engine that is generating the page.
So the PHP file (or Engine like WordPress, Joomla, etc) that generates this HTML document, will have to set the CSS properly before the user gets the HTM page.

However ... probably a better option is using JavaScript.

You can use the FORM GET approach, for example a link
Of course no you need to catch the incoming GET value "activetab" and set "faqTab" to active tab with the function you already have:

openTab(event, 'faqTab');