PHP Classes

need help with GetHTML()

Recommend this page to a friend!

      Ultimate MySQL  >  All threads  >  need help with GetHTML()  >  (Un) Subscribe thread alerts  
Subject:need help with GetHTML()
Summary:trying to hyperlink results to page and pass value through the U
Messages:2
Author:Jason Williams
Date:2008-07-17 01:30:47
Update:2008-07-17 03:02:45
 

  1. need help with GetHTML()   Reply   Report abuse  
Picture of Jason Williams Jason Williams - 2008-07-17 01:30:48
Fantastic class! Absolutely love it.

I'm trying to modify the GetHTML() function so the table values are hyperlinked to another page passing an invoice number of the particular record.

=============================================================
|idrecords|name|address |state|invoice|email |
| 1 |john|some address|asd |F123456|email@address.com|
| 2 |jane|an address |qwer |J189276|no@email.com |
=============================================================
etc...

I want the user to be able to click on any of the values for the row and have it pass the invoice via url...

invoice-details.php?inv=$____________

where $____________ is the invoice number for each row.

Can you please shed some light?

  2. Re: need help with GetHTML()   Reply   Report abuse  
Picture of Jason Williams Jason Williams - 2008-07-17 03:02:46 - In reply to message 1 from Jason Williams
OK... so perseverence got me there in the end.

[code]
$html .= "\t<tr onmouseover=\"this.style.backgroundColor='#F3F2BF';\" onmouseout=\"this.style.backgroundColor='';\">\n";
foreach ($member as $key => $value) {
$html .= "\t\t<td style=\"$td\"><a href='invoice-details.php?searchInvoice=".$member->invoice."&search=1'>" . htmlspecialchars($value) . "</a></td>\n";
}
$html .= "\t</tr>\n";
[/code]

So I've added a small bit of javascript and css to highlight the table row

Then included the <a> and referenced the column I wanted.
$member->invoice

This could be changed to a variable that is passed to the function to make it more flexible.