ich weiss ich nerve

Seite 1 von 1 - Forum: Coding Stuff auf overclockers.at

URL: https://www.overclockers.at/coding-stuff/ich_weiss_ich_nerve_34872/page_1 - zur Vollversion wechseln!


Dragonskin schrieb am 20.05.2002 um 23:45

Derzeit grüble ich an einen "Sehr Guten" passwortsystem.. nun hab ich das Problem das er die ips...

so schreibt

123.25.14565dannkeinabstand1565.0656.61

ich möchte es haben das er es so schreibt
123.25.14565
1565.0656.61 wie stellt man das an

Zitat
$ip = getenv(REMOTE_ADDR);
$datenbank = "ip.txt";
$datei = fopen($datenbank,"a");
fwrite($datei, $ip);
fclose($datei);


jives schrieb am 21.05.2002 um 00:05

häng ein " \n" an den ip-String.


Dragonskin schrieb am 21.05.2002 um 10:24

wenns i so mache:

fwrite($datei, $ip \n);


gets a ned gibts a error meldng


Murph schrieb am 21.05.2002 um 11:22

fwrite($datei, "$ip\n");


jives schrieb am 21.05.2002 um 12:04

Jop, genau :) Sorry dass ichs net glei gepostet hab, war scho spät ;)

Du nervst net (imo) immerhin samma ja da um zu helfen :)


Dragonskin schrieb am 21.05.2002 um 12:51

scho langsam nervt es ;((

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/www/web1/html/Grisu/Admin/php/login.php on line 56

Parse error: parse error in /home/www/web1/html/Grisu/Admin/php/login.php on line 56


jives schrieb am 21.05.2002 um 12:55

Probiers mal mit

$ip = $ip."\n";
fwrite($datei, $ip);


Dragonskin schrieb am 22.05.2002 um 21:08

Geht nu immer ned ;((( kann ma wer helfen?

Der ganze Script lite Edition
[QUOTE]
<?
srand ((double) microtime() * 1000000);
$zufall = rand(1000000,9999999); //zahl ermitteln
if ($pwd == lol)
{
echo <<<test
<html>
<head>
<title>:: Admin bereich ::</title>
</head>
<body bgcolor="#D8D8D8" text="black">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; text-align:center" bordercolor="#111111" width="47%" height="127" align="center">
<tr>
<td bgcolor="#B4B4B4" width="100%" height="19">
<p style="text-align: left"><b>:: Admin Bereich für <font color="red"> $User </font> ::</b></td>
</tr>
<tr>
<td width="100%" height="87">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="65">
<tr>
<BR>
<form action="news.php" method="post">
<td width="29%" height="19">News schreiben</td>
<td width="71%" height="19"><INPUT TYPE="HIDDEN" NAME="zot" VALUE="$zufall">
<input type="text" maxlength="8" size="20" name="rofl"><font size="-1" color="red"> *</font>  <input type="submit" value="OK"></form></td>
</td>
</tr>
<p>    
</tr>
<tr>
<td width="29%" height="19">
<p align="center">
<br>
</CENTER></form></td>
<td width="71%" height="19">
<font size="-1" color="red"> *</font> <font size="-1">Deine Automatisch generiert Nummer lautet: $zufall </font>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="#B4B4B4" width="100%" height="19">
<p align="right"><b><font size="2" color="#FFFFFF">© by [ETP]Grisu</font></b></td>
</tr>
</table>
</center>
</div>
</body>
</html>
test;
} else {
$ip = getenv(REMOTE_ADDR);
$datenbank = "ip.txt";
$datei = fopen($datenbank,"a");
fwrite($datei, $ip);
fclose($datei);
echo <<<muh
<html>
<head>
<title>:: Ip Added ::</title>
</head>
<body bgcolor="#D8D8D8" text="black">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; text-align:center" bordercolor="#111111" width="47%" height="127" align="center">
<tr>
<td bgcolor="#B4B4B4" width="100%" height="19">
<p style="text-align: left"><b>:: IP <font color="red"> Added </font> ::</b></td>
</tr>
<tr>
<td width="100%" height="87">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="316" height="65">
<tr>
<BR>
<td width="298" height="10">
<p align="center">Deine IP ( $ip ) wurde soeben <font color="#FF0000">gesperrt</font>.<p align="center"> </td>
<td width="19" height="19" rowspan="2"></td>
</td>
</tr>
<tr>
<td width="298" height="9">
</td>
</tr>
<p>    
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="#B4B4B4" width="100%" height="19">
<p align="right"><b><font size="2" color="#FFFFFF">© by [ETP]Grisu</font></b></td>
</tr>
</table>
</center>
</div>
</body>
</html>
muh;
}
?>
[/QUOTE]

Möchte das ma er endli die ******* ips untereinander hinschreibt ned nebeneinander die oberen Versuche mislinkten leider ;(


jives schrieb am 22.05.2002 um 22:52

Also bei mir funktioniert es tadellos, habs gerade getestet. Was genau geht denn nicht?

Code: PHP
$datei = fopen($datenbank, "a");
fwrite($datei, $ip."\n");
fclose($datei);

So geht es - bei mir zumindest. Wenn du die Liste mit html ausgeben willst, musst du zuerst die \n in <br> umwandeln:
nl2br($string);


watchout schrieb am 23.05.2002 um 17:01

hmmm weiss nicht, bei mir geht das \n auch fast nie - deswegen mach' ichs so...

Code: PHP
$crlf=chr(13).chr(10);
/* dann wasauchimmer.... */
echo "teeeeeeexxxxttttt" . $crlf;
kann sein, dass ich 13 und 10 vertausche, ich merk' mir das nie ;) auf jeden fall gehts sicher (wenn 13 und 10 in der richtigen Reihenfolge sind... :rolleyes: )

Edit: hab nachgeschaut: stimmt, die Reihenfolge :)
Edit2: damit iin HTML auch eine neue Zeile ausgeg. wird musst natürlich <BR> dazuschreiben!




overclockers.at v4.thecommunity
© all rights reserved by overclockers.at 2000-2025