Jump to content

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


Go to solution Solved by 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?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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