Passing Arrays thru url
Posted: Fri Jan 09, 2009 10:18 am
I tried to create array and pass it thru url but I am not sure what I did wrong. I am getting 'link[1]' instead of page1.html in the form field. Here is the sample of my code. Can someone please take a look and help me out?
What I am trying to accomplish is to pass the value 'page1.html' to a form thru url. The url is very long and therefore I do not want to include it in the link itself.
Thanks.
1st page with the links.
form.php
What I am trying to accomplish is to pass the value 'page1.html' to a form thru url. The url is very long and therefore I do not want to include it in the link itself.
Thanks.
1st page with the links.
Code: Select all
<?php
session_start ();
$link[1] = 'page1.html';
$link[2] = 'page2.html';
.....
?>
<body>
<a href="form.php?name='link[1]'">link 1</a>
......
</body>form.php
Code: Select all
<?php
session_start ();
$link = $_GET['name'];
?>
<form action="process.php" method="post">
<input name="link" type="text" value="<?php echo $link?>" readonly>
</form>