Jump to content

Archived

This topic is now archived and is closed to further replies.

phil321

Passing infromation from page to page

Recommended Posts

Hi there...

I want to design a page which has over 700 links on it, all of which link to a php file. Each link needs to pass 3 fields of information which always stays the same for each of those links. I originally thought of making each link a submit button in its own HTML form with 3 invisible fields set to their required static values. But these invisible fields still take up space on the web page even though they cant be seen, which ruins the webpage layout.

There must be a better way of figuring this out (or at least thats what Im hoping)! Can you help?

Thanks for your time!

Share this post


Link to post
Share on other sites
uh...

<?php
echo "<a href=\"link.php?var1=value&var2=value&var3=value\">link</a>
?>

Then you can use PHP's GET function to use those variables in the target page

Share this post


Link to post
Share on other sites
how are you making them invisable, that they take up space?

if you use:
[code]<input type="hidden" name="fieldName" value="fieldValue">[/code]

it will be invisable, take up no space, and the value will be passed as $_POST['fieldName']; on your server response.

or why not just pass the variables in the URL.

[code]<a href="http://www.mySite.com/filename.php?var1=blahblahblah&var2=value2&var3=whatever">my link</a>[/code]

these will be passed as $_GET['var1'] $_GET['var2'] etc...

Share this post


Link to post
Share on other sites
[quote]I originally thought of making each link a submit button in its own HTML form with 3 invisible fields set to their required static values. But these invisible fields still take up space on the web page even though they cant be seen, which ruins the webpage layout.[/quote]
That statement is not true. They take up space in the source, but are not displayed at all, no space is used on the screen.

Ken

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.