mcdof001 Posted September 29, 2007 Share Posted September 29, 2007 Hi, Sorry To Bother You Again! I know how to send an input text to another php and a database, but i do not know how to send an already set variable on a php page to another php page. This is what I'm using :- <form action="compare.php" method="post" enctype="multipart/form-data" name="form1"> <input name="rating" type="hidden" id="rating" value="<? echo "$rating" ?>"> <input name="Compare Results" type="submit" id="Compare Results" value="Compare Results"> </form> I have got 'echo "$rat";' and '$rat = $_GET["rating"];' on compare.php. Why won't that work and has anybody got any other suggestions please? Quote Link to comment https://forums.phpfreaks.com/topic/71161-solved-sending-a-variable/ Share on other sites More sharing options...
pocobueno1388 Posted September 29, 2007 Share Posted September 29, 2007 You should be using POST, not GET. $rat = $_POST['rating']; Quote Link to comment https://forums.phpfreaks.com/topic/71161-solved-sending-a-variable/#findComment-357891 Share on other sites More sharing options...
jd2007 Posted September 29, 2007 Share Posted September 29, 2007 pocobeuno is rite.....the hidden input id and name is rating...do this also...change the input's id to a different name... Quote Link to comment https://forums.phpfreaks.com/topic/71161-solved-sending-a-variable/#findComment-357893 Share on other sites More sharing options...
mcdof001 Posted September 29, 2007 Author Share Posted September 29, 2007 Thanks. The POST thing worked. Quote Link to comment https://forums.phpfreaks.com/topic/71161-solved-sending-a-variable/#findComment-357895 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.