Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detecting which reply button is pressed in a web blog and passing data

Status
Not open for further replies.

sarcus25

Programmer
Apr 14, 2005
27
0
0
Hi,

I am creating a web blog and what I have is this code that creates a table that has a reply button and a quote button for each message that a member has posted. What i want to do Is pass the Subject line of that customers post to the next form but this all depends on which one fo the 100 or so reply buttons that i press. How do I detect which one has been pressed and then pass that members subject line to the next form. Thanks in advance.

<?php
//Connecting to a database using the require statment
//*****************************************************
require 'Connect.php';
//*****************************************************






//Preforming an sql query for the Posts Table
//*******************************************************************************
$queryPosts = 'SELECT * FROM posts ORDER BY `Record#` DESC';
$resultPosts = mysql_query($queryPosts) or die ('Sql query Failed:'.mysql_error());
//*******************************************************************************




//Counting the number of rows returned by the query in the posts table
//*******************************************************************************
$num = mysql_numrows($resultPosts);
//echo 'The total number of records is '.$num.'<br><br><br><br><br><br><br>';
//*******************************************************************************
//Note: Neeed to imput the picure acording to what username is being generated at the time

$scolor = false;
//Lopping through each row in the post table and storeing the user names to display per each post //*********************************************************************************************************
$i=0;
while ($i < $num) {
$postedby[$i]=mysql_result($resultPosts,$i,'Postedby');

//echo 'This Post was written by '.$postedby[$i].'<br>';
//echo 'The current value of this array is '.$i.'<br>';



//Preforming an sql query for the Accounts table
//*******************************************************************************
$queryAccount = "SELECT * FROM account WHERE `UserName`='$postedby[$i]'";
$resultAccount = mysql_query($queryAccount) or die ('Sql query Failed:'.mysql_error());

$Num_Posts= mysql_result($resultAccount,0,'Num_Posts');
$Pic[$i]= mysql_result($resultAccount,0,'Char_Pic');
//echo 'The picture for this member is located in '.$testing1[$i];
//*******************************************************************************






$rank[$i]=mysql_result($resultPosts,$i,'Rank');
$time[$i]=mysql_result($resultPosts,$i,'Time');
$Post[$i]=mysql_result($resultPosts,$i,'Post');
//*********************************************************************************************************

if ($scolor == false){
$tblcolor = '#212021';
}else{
$tblcolor = '#000000';
}

//Creating the table
//*********************************************************************************************************
echo "<table width='100%' border='0' align='center' cellpadding='0' cellspacing='0' id='tblmaster' bgcolor=$tblcolor>
<tr>
<th scope='col'><table width='100%' border='0' cellpadding='0' cellspacing='0' id='tblmain'>
<tr>
<th scope='col'><table width='85%' height='160' border='0' align='right' cellpadding='0' cellspacing='0' id='tblPost'>
<tr>
<th height='18' scope='col'><table width='100%' border='0' cellpadding='0' cellspacing='0' id='tblPheaded'>
<tr>
<th align='left' scope='col'>$subject[$i] | $time[$i] </th>
<th width='63' height='18' scope='col'><a href='./PostingForm.php'><img src='./Pictures/quote.gif' width='63' height='18' border='0' align='right' /></a></th>
<th width='63' height='18' scope='col'><a href='./PostingForm.php'><img src='./Pictures/reply.gif' width='63' height='18' border='0' align='right' /></a></th>
</tr>
</table></th>
</tr>
<tr>
<td align='left' valign='top'><p>$Post[$i]</p>
<p>&nbsp;</p>

<p>&nbsp;</p>

</td>
</tr>
</table>
<table width='15%' border='0' align='left' cellpadding='0' cellspacing='0' id='tblPic'>
<tr>
<th scope='col'><p><img src='$Pic[$i]' width='68' height='118' /></p>
<p>$postedby[$i] - $rank[$i]</p></th>
</tr>
</table></th>
</tr>
</table></th>
</tr>
</table>";
//*****************************************************************************************************




$i++;

$scolor = !$scolor;
}


//Closing the Database
//****************************************************
mysql_close();
//****************************************************




?>



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top