MySQL Forums
Forum List  »  PHP

php-mysql help. Need to create a dynamic url based on the table value
Posted by: Simon Mandy
Date: March 21, 2013 02:00AM

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 &amp; 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?

Options: ReplyQuote


Subject
Written By
Posted
php-mysql help. Need to create a dynamic url based on the table value
March 21, 2013 02:00AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.