derrick1123 Posted March 21, 2008 Share Posted March 21, 2008 $id = 1; echo "<form method='POST' action='update.php'>"; echo "<input type='text' name='id' size=30><br>"; echo "<input type='submit'' type='text' value='$id'>"; echo "</form>"; I need to make 1 (id number) just an html link that will post to update.php... Would something like this work? Link to comment https://forums.phpfreaks.com/topic/97264-how-to-use-as-link/ Share on other sites More sharing options...
rhodesa Posted March 21, 2008 Share Posted March 21, 2008 One small change, and yes, but it will be a button $id = 1; echo "<form method='POST' action='update.php'>"; echo "<input type='submit' name='id' value='$id'>"; echo "</form>"; Link to comment https://forums.phpfreaks.com/topic/97264-how-to-use-as-link/#findComment-497675 Share on other sites More sharing options...
derrick1123 Posted March 21, 2008 Author Share Posted March 21, 2008 Is it possible to make it a link? Link to comment https://forums.phpfreaks.com/topic/97264-how-to-use-as-link/#findComment-497676 Share on other sites More sharing options...
Jeremysr Posted March 21, 2008 Share Posted March 21, 2008 You could use Javascript to submit it... Here's some code I found with Google: http://javascript.internet.com/forms/submit-link.html Link to comment https://forums.phpfreaks.com/topic/97264-how-to-use-as-link/#findComment-497682 Share on other sites More sharing options...
BlueSkyIS Posted March 21, 2008 Share Posted March 21, 2008 you have to use javascript for a link to submit. something like this: $id = 1; echo "<form method='POST' action='update.php'>"; echo "<input type='text' name='id' size=30><br>"; echo "<A href='javascript:document.forms[0].submit();'>$i</A>"; echo "</form>"; Link to comment https://forums.phpfreaks.com/topic/97264-how-to-use-as-link/#findComment-497683 Share on other sites More sharing options...
derrick1123 Posted March 21, 2008 Author Share Posted March 21, 2008 OK that works for the post...thank you. -- But how would I be able to send $id to the next page? http://smfhost.info/my_site/remember/forgot.php Link to comment https://forums.phpfreaks.com/topic/97264-how-to-use-as-link/#findComment-497691 Share on other sites More sharing options...
jkewlo Posted March 21, 2008 Share Posted March 21, 2008 why do u need it as a link? and not a submit button ?? on the next page after submit you just ask for the id number $url = @$_POST['id']; Link to comment https://forums.phpfreaks.com/topic/97264-how-to-use-as-link/#findComment-497699 Share on other sites More sharing options...
derrick1123 Posted March 21, 2008 Author Share Posted March 21, 2008 Because it is a table...OR i guess i can change it. Link to comment https://forums.phpfreaks.com/topic/97264-how-to-use-as-link/#findComment-497724 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.