How can I do in such a way that when someone enters on Web,automatically from the database is shown his name taking information from IP desc if he is register

<?php
$ip_demo = getenv("REMOTE_ADDR");
include"sec/db.php";
$result = mysql_query("SELECT * FROM blog_name");
while($row = mysql_fetch_array($result))
{
$name_demo = $row["name_demo"];	
$ip = $row["ip"];
if ($ip_demo = $ip)
........
}
?>

some licke this if im not wrong Please help

This will work:

<?php
$user_ip = $_SERVER['REMOTE_ADDR'];
include("sec/db.php");
$query = "SELECT * FROM blog_name WHERE ip='".$user_ip."'";
$result = mysql_query($query) or die("Could not execute query");
if ($row = mysql_fetch_array($result)) {
//.... Do something....
}

?>

~G

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.