Jump to content


form buttons as text?

  • Please log in to reply
No replies to this topic

#1 spires

  • Members
  • PipPipPip
  • Advanced Member
  • 492 posts

Posted 03 July 2006 - 06:23 PM


i'm creating a cms news section, just to see how to do it.

I have almost finished, but was woundering if i can have my links to the articles as text links and not buttons.

I'm not to good at explanning, so please goto:

I'm using a for loop to pull the info from the database. The form is within the loop, giving each button its own hidden ID fields.
Taking you to the correct article.

But I would really like them to be text not buttons.

I have tryed:
<A HREF="javascript:document.excel1.submit();">'.$row['title'].'</a>

This work, ONLY if the form is out side the loop. Which is no good.

Any ideas Please.

Thanks for reading.

Here i the block of code:


$numresults=mysql_query("SELECT date, title FROM $db_tbl")
or die("query 1 failed");

if (empty($offset)) {

$query = "SELECT * FROM $db_tbl ORDER by ID DESC limit $offset,$limit";
$result = mysql_query($query)
or die ("query 2 failed");

echo '<center>';

echo '<table class="TLRB_border" bgcolor="#EEEEEE" width="400"  cellpadding="5" cellspacing="0">';
echo '<TR bgcolor="#CCCCCC">
<TD class="Title" colspan="3">
Select A News Article
echo '<tr>
  <td width="30">

$count = mysql_num_rows($result);

if($count < 1) {
echo "No news";
} else {

for ($i = 0; $i < $count; $i++) {
$row = mysql_fetch_array($result);

echo '<form name="excel1" action="news_art.php" method="post">';

      echo "<INPUT type='hidden' name='ID' value='".$row['ID']."'> \n";
  echo "<INPUT type='hidden' name='date' value='".$row['date']."'> \n";
  echo "<INPUT type='hidden' name='title' value='".$row['title']."'> \n";
  echo "<INPUT type='hidden' name='art' value='".$row['art']."'> \n";

echo '<table width="340" bgcolor="#FFFFFF" cellpadding="0" cellspacing="0" align="center">
  <td align="center" class="loginBox_text">
<TD align="center" width="50"><A HREF="javascript:document.excel1.submit();">'.$row['title'].'</a><br></TD>';
echo '</form>';
echo '</tr>';
echo '</table>';

echo '</td>
  <td width="30">
echo '</center>';


How to make over $600 a day from AdSense? Discover EXACTLY how he does it in these videos:

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users