Jump to content

form buttons as text?


spires

Recommended Posts

Hi,

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:
http://spirestest.com/login2/news

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:

<?php

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


if (empty($offset)) {
    $offset=0;
}

$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
</TD>
</TR>';
echo '<tr>
  <td width="30">
  &nbsp;
  </td>
  <td>';
   

$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">
  <tr>
  <td align="center" class="loginBox_text">
  <br>'.$row['date'].'
  </td>
  <tr>
 
<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">
  &nbsp;
    </td>
  </tr>
  </table>';
 
echo '</center>';

 
?>
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.