Jump to content

php-mysql help. Need to create a dynamic url based on the table value


sim_tcr

Recommended Posts

I have a database named 'counter' and a table named 'info'. which stores the information of client ip address (ip_address), client brower details (user_agent) and date and time visited my website (datetime).

 

I have a php webpage which displays above information in a table format code is below,

 

<?php

// ########################
// ### Display visitors ###
// ########################

echo '<h3> Visitors </h3>' ;

$result = mysql_query("SELECT * FROM $dbtableinfo ORDER BY id DESC")
or die(mysql_error()); 

echo "<table width='100%' border='0'>";
echo '<tr> <td width="200" bgcolor="#1AC414">  IP </td> <td height="2" bgcolor="#1AC414" width="400">User agent</td> <td height="2" bgcolor="#1AC414" width="169"> Date & Time</td></tr>';

// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result ))
{
   // Print out the contents of each row into a table
   echo '<tr><td bgcolor="#75D169">';
echo $row['ip_address'];
   echo '</td><td bgcolor="#75D169">';
   echo $row['user_agent'];
   echo '</td><td bgcolor="#75D169">';
   echo $row['datetime'];
   echo "</td></tr>";       
}
   echo "<tr><td bgcolor=\"#1AC414\"> <strong> Total unique IP´s </strong> </td><td bgcolor=\"#1AC414\"> <strong> $totalips </strong> </td></tr>" ;
   echo "</table><br /> ";

   ?>
 


First coulmn in the web page is the ip address of the client. Now I would like to make that as a hyperlink with this url http://iplocation.truevue.org/<ip_address>.html

 

Can someone assist?

Archived

This topic is now archived and is closed to further replies.

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