Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I think what you are looking for is to use hidden inputs to keep your variables being passed from page to page.</p> <p>Use something like this in a form:</p> <pre><code>&lt;form method='get'&gt; &lt;input type='hidden' name='client' value='1'&gt; // Your other inputs &lt;/form&gt; </code></pre> <p>This way when you get one input, you can keep passing it from page to page using some simple PHP code to pick it up from the URL and display it again as needed.</p> <p>Edit: (Further explanation)</p> <p>When you are passing data through the URL from one page to another you can use some simple PHP code to see if something exists to pass it further along - like this:</p> <pre><code>&lt;?php //page1.php if(isset($_GET['user'])) { $user=htmlspecialchars($_GET['user']); } if(isset($_GET['photo'])) { $photo=htmlspecialchars($_GET['photo']); } // Check for anything else you want as needed. ?&gt; </code></pre> <p>Then, when actually making your links you can do something like:</p> <pre><code>&lt;?php $baseAddress="&lt;a href='thePageIwant.php?thisVar=3"; if(isset($user)) { $baseAddress.="&amp;user=".$user; } if(isset($photo)) { $baseAddress.="&amp;photo=".$photo; } // Add any other variables as needed $baseAddress.="'&gt; ?&gt; </code></pre> <p>In the HTML output section of your page, you can then use this:</p> <pre><code>&lt;p&gt;Some text and then a link &lt;?php echo $baseAddress;?&gt;Your Link Text&lt;/a&gt;&lt;/p&gt; </code></pre> <p>And your link will appear with all the other variables being passed via the URL. In this case, if user was passed to the page with ID 4, and photo was passed to the page with ID 6, the HTML output would be:</p> <pre><code>&lt;p&gt;Some text and then a link &lt;a href='thePageIwant.php?thisVar=3&amp;user=4&amp;photo=6'&gt;Your Link Text&lt;/a&gt;&lt;/p&gt; </code></pre> <p>If only the user was passed in the URL, and there was no <code>photo=6</code> the output would be like this:</p> <pre><code>&lt;p&gt;Some text and then a link &lt;a href='thePageIwant.php?thisVar=3&amp;user=4'&gt;Your Link Text&lt;/a&gt;&lt;/p&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload