Jump to content


Photo

Passing infromation from page to page


  • Please log in to reply
3 replies to this topic

#1 phil321

phil321
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 05 July 2006 - 03:24 PM

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!

#2 DaveLinger

DaveLinger
  • Members
  • PipPipPip
  • Advanced Member
  • 268 posts
  • LocationWV, USA

Posted 05 July 2006 - 03:27 PM

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
http://www.DaveLinger.com
dave at linger dot com

#3 micah1701

micah1701
  • Members
  • PipPipPip
  • Advanced Member
  • 613 posts
  • LocationEllington, CT USA

Posted 05 July 2006 - 03:29 PM

how are you making them invisable, that they take up space?

if you use:
<input type="hidden" name="fieldName" value="fieldValue">

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.

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

these will be passed as $_GET['var1'] $_GET['var2'] etc...
"Confidence in the face of risk."

#4 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 05 July 2006 - 03:38 PM

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.

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users