0

I want to make a "fake skype resolver" just for troll. Now i made a random IP generator

<?php $randIP = "".mt_rand(0,255).".".mt_rand(0,255).".".mt_rand(0,255).".".mt_rand(0,255); ?>

Now i want to store them in a database with the user they have posted:

<?php


     if (isset($_POST['send'])) {
        $username = $_POST['username'];
        $randIP = "".mt_rand(0,255).".".mt_rand(0,255).".".mt_rand(0,255).".".mt_rand(0,255);
        echo 'The IP of '.$username.' is '.$randIP.';
?>

        <form action="">
        <input type="text" name="username" id="username" size="40" value="Habbo">
        </form>
<input type="hidden" id="send" name="send" value=Resolve IP">
<input type="submit" id="submit" name="submit" value="Resolve IP">

The problem now is if they resolved again then it shows a new IP adres, how can i make that it shows the same IP like befour?

4

1 回答 1

0

为此,您必须使用例如将结果保存到数据库。PDO.

您也可以使用cookies。在你的情况下应该足够了。只需使用setcookie功能。

于 2013-09-16T15:20:31.887 回答