didgydont Posted December 17, 2007 Share Posted December 17, 2007 hi all i am a noob to php but have managed to make a result a link as a form button but it creates pretty big gapps between the buttons i would prefer if i could make just a text style link if i can does anyone know how ? this is the code i have echo "<h2>Client Names</h2>"; while($row = mysql_fetch_array($result)) { $uid = $row['Uid']; $name = $row['FirstName'] ." ". $row['LastName']; echo "<form action=\"idsearch.php\" method=\"post\">"; echo "<input type=\"hidden\" name=\"Uid\" value=\"$uid\">"; echo "<input type=\"submit\" VALUE=\"$name\">" ; echo "</form>"; } mysql_close($con); Quote Link to comment Share on other sites More sharing options...
lemmin Posted December 17, 2007 Share Posted December 17, 2007 Do you mean that you want a text link to submit a form to another php file? You can do that with javascript: <form id="tForm" method=POST> <input type=HIDDEN> <a href=# onClick="tForm.submit()>Visible Link</a> </form> But, I'm not sure that is what you are trying to do. Also, your code will make a brand new form for every result in the query. You should probably put the form tag outside of the loop. Quote Link to comment Share on other sites More sharing options...
revraz Posted December 17, 2007 Share Posted December 17, 2007 Would be much easier if you used a link like newpage.php?user=1 And then used $_GET on the newpage.php Quote Link to comment Share on other sites More sharing options...
didgydont Posted December 17, 2007 Author Share Posted December 17, 2007 Do you mean that you want a text link to submit a form to another php file? You can do that with javascript: <form id="tForm" method=POST> <input type=HIDDEN> <a href=# onClick="tForm.submit()>Visible Link</a> </form> But, I'm not sure that is what you are trying to do. Also, your code will make a brand new form for every result in the query. You should probably put the form tag outside of the loop. i think i want a new form each time because every button takes you to different results Quote Link to comment 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.