me1000 Posted October 6, 2007 Share Posted October 6, 2007 So I am using iUI to develop my iPhone application, problem is I need to be able to pass a variable through a URL without using a link such as page.php?var=123 iUI reformats the URL, and the variable is not saved as a result. so is there a way I can make a link setting a value to a variable, but have it saved by the browser or something, and not the url. thanks, Quote Link to comment https://forums.phpfreaks.com/topic/72051-pass-variables-through-a-link/ Share on other sites More sharing options...
teng84 Posted October 6, 2007 Share Posted October 6, 2007 hmm not clear enough! Quote Link to comment https://forums.phpfreaks.com/topic/72051-pass-variables-through-a-link/#findComment-363074 Share on other sites More sharing options...
me1000 Posted October 6, 2007 Author Share Posted October 6, 2007 ok well my page has a list of each letter my links looks similar to this, <a href="letter.php?letter=a>A</a> <a href="letter.php?letter=b>B</a> and so on, problem with that is iUI reformats the link (using javascript) so the variable is never passed through when the page is rendered on the server. is there anyway to pass a variable for php to read through the link, in a different way? Quote Link to comment https://forums.phpfreaks.com/topic/72051-pass-variables-through-a-link/#findComment-363077 Share on other sites More sharing options...
teng84 Posted October 6, 2007 Share Posted October 6, 2007 if you will use post data u can use hidden field and if you will use get method u can use session Quote Link to comment https://forums.phpfreaks.com/topic/72051-pass-variables-through-a-link/#findComment-363079 Share on other sites More sharing options...
MasterACE14 Posted October 6, 2007 Share Posted October 6, 2007 yeah, the hidden field is probably the best way to do it: <?php // variables to pass $letter1 = "a"; ?> <form action="page.php" method="post"> <input type=hidden name="letter" value="<?=$letter1?>"> </form> Regards ACE Quote Link to comment https://forums.phpfreaks.com/topic/72051-pass-variables-through-a-link/#findComment-363399 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.