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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

perl, mysql and html links

Status
Not open for further replies.

martinasv

Technical User
Feb 12, 2006
24
0
0
HR
Hi, everyone!

I wrote a perl script which extracts data from mysql table and prints those data to html table. Those data include MAC, IP addresses, dates, times, etc. Now, what I did next was - I turned each MAC address into a link, like this:

while($Row=$Select->fetchrow_hashref)
{
print "<tr><td><a href=\"/cgi-bin/oMAC.pl\" target=\"_blank\">$Row->{MAC} </a> <td>$Row->{IP} <td>$Row->{date} <td>$Row->{time}";
}

As you can see, this link points to another perl script (oMAC.pl). I'd like that script to print out all the information about the MAC address I click on. But click on a link doesn't produce any post information, so I don't know how to make my script recognize which MAC address I clicked on.

Any suggestions?
I'd really appreciate it.
 
Code:
print "<tr><td><a href=\"/cgi-bin/oMAC.pl[COLOR=red][b]?id=$whatever_your_key_is[/b][/color]\" target=\"_blank\">$Row->{MAC} </a>   <td>$Row->{IP}   <td>$Row->{date} <td>$Row->{time}";
Hope that helps, I'll report the other post for deletion

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
OK. Now I'm getting the MAC address that I clicked on in URL space of my browser. Is there any way I can use that MAC address in my script?

I should be able to say:

print "select * from table where MAC=$MAC";

where $MAC is that address shown in the URL space.
 
top of your script
Code:
#!/usr/bin/perl
use CGI;
use DBI;
my $q=new CGI;
$MAC=$q->param{"id");

HTH


Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top