Jump to content

make a result a link


didgydont

Recommended Posts

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);

Link to comment
https://forums.phpfreaks.com/topic/82095-make-a-result-a-link/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/82095-make-a-result-a-link/#findComment-417168
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/82095-make-a-result-a-link/#findComment-417214
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.