Jump to content


Photo

form buttons as text?


  • Please log in to reply
No replies to this topic

#1 spires

spires
  • Members
  • PipPipPip
  • Advanced Member
  • 492 posts

Posted 03 July 2006 - 06:23 PM

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

 
?>

How to make over $600 a day from AdSense? Discover EXACTLY how he does it in these videos:
http://www.adsense-online.com




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users