0

Hi all I have a page with a nav bar on top with several options like Home, Forms, etc. When any of these nav options are clicked you get redirected to another php page.
Problem: user clicks on a form notification from the Home (home.php) page, it should redirect them to the correct landing page in this case forms.php and open up the form that they selected. I assume I need to pass the formID somehow so I can open it up in the correct form, but how do I do that?

<ul class="mainNav">
                    <li class="nav-one"><a href="">Home</a></li>
                    <li class="nav-two"><a href="forms.php">Forms</a></li>
                    <li class="nav-three"><a href="dash.php">Dashboard </a></li>

                </ul>

1 Answer 1

1

If the form ID isn't sensitive data then could you add it as a query string to the link?

i.e.

<li class="nav-two"><a href="forms.php?formId=someId">Forms</a></li>

you could then access this by using

$_GET["formId"])
Sign up to request clarification or add additional context in comments.

4 Comments

I see. I'm going to try that out right now. wait so what would happen if I sent the formID like so forms.php?formId=someId would I be able to remove that when I landed on the forms.php? I ask because forms.php holds all the forms that belong to that person. In other words would having the form ID in the url affect anyof the oter forms?
If you only want to access one form at a time it should be ok. You would only be using the query parameter to filter with?
yeah basically. Essentially a user would be on the home page click the notification that pertains to that form and land on the forms.php with the form opened. However they would have a list of all other forms. SO in other words when the user clicks on another form does the paramters remain in the URL?
When a user clicks on another form you would change the query parameter to the id of the new form

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.