Jump to content
vkg

BanList Page

Recommended Posts

Ar merge cu php foarte usor chiar.

Asta este daca ai fisier-ul pe acelasi host cu script-ul php:

<?php
$a = file("host/nume.extensiefisier");
echo "<table border='1'><tr>";
for ($i = 1; $i < count($a); $i++)
{echo "<td>".$a[$i]."<br />"."</td><tr>";
}
echo "</tr></table>";
?>


<?php
$a = file_get_contents("http://localhost/alt/c.txt");
$a = explode("\n" , $a);
echo "<table border='1'><tr>";
for ($i = 1; $i < count($a); $i++)
{echo "<td>".$a[$i]."<br />"."</td><tr>";
}
echo "</tr></table>";
?>

Edited by razer_krait
Link to comment
Share on other sites

dar fi atent eu am fisierul pe un host de SERVER SAMP , adica as vrea un script sa se connecteze la ftp pt a deschide fisierul ... adica este un ban.log , intelegi ? este un log si as vrea sa l arate pe pagina, vezi daca gasesti asa ceva :)

Exemplu : eu am fisierul aici : /home/gmisamp/195.225.59.100-7777/samp03/scriptfiles/FTGF/Logs/ban.log , Scriptul nu poate citi fisierul daca nu se connecteaza la FTP nu ? eu as vrea ca scriptul sa se connecteze la ftp si sa ia datele din acel log

Edited by vkg
Link to comment
Share on other sites


<?php
$source = "ban.log";
$target = fopen("target.txt", "w"); //Fisierul situat pe host-ul unde ai pus script-ul php

$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"username-ul tau","parola ta");

ftp_fget($conn,$target,$source,FTP_ASCII);

ftp_close($conn);
$a = file("target.txt");
echo "<table border='1'><tr>";
for ($i = 1; $i < count($a); $i++)
{echo "<td>".$a[$i]."<br />"."</td><tr>";
}
echo "</tr></table>";
?>

Banuiesc ca nu-ti trebuie mai mult.Mai posteaza daca ai nevoie...

Link to comment
Share on other sites

Eroare:

Warning: ftp_login() [function.ftp-login]: Login authentication failed in /home/dwdga/public_html/bans.php on line 6

Warning: ftp_fget() [function.ftp-fget]: You aren't logged in in /home/dwdga/public_html/bans.php on line 8

Warning: file() [function.file]: Unable to access home/gmisamp/195.225.59.100-7777/samp03/scriptfiles/FTGF/Logs/ban.log in /home/dwdga/public_html/bans.php on line 11

Warning: file(home/gmisamp/195.225.59.100-7777/samp03/scriptfiles/FTGF/Logs/ban.log) [function.file]: failed to open stream: No such file or directory in /home/dwdga/public_html/bans.php on line 11

Spunemi unde am gresit cu scriptul:

<?php 
$source = "ban.log";
$target = fopen("target.txt", "w"); //Fisierul situat pe host-ul unde ai pus script-ul php

$conn = ftp_connect("ftp.gamesiasi.ro") or die("Could not connect");
ftp_login($conn,"gmisamp","*******");

ftp_fget($conn,$target,$source,FTP_ASCII);

ftp_close($conn);
$a = file("home/gmisamp/195.225.59.100-7777/samp03/scriptfiles/FTGF/Logs/ban.log");
echo "<table border='1'><tr>";
for ($i = 1; $i < count($a); $i++)
{echo "<td>".$a[$i]."<br />"."</td><tr>";
}
echo "</tr></table>";
?>

cum il vezi mai sus exact asa lam pus, doar ca am pus parola aici am pus ****** sa nu afisez parola !

Link to comment
Share on other sites

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.   Paste as plain text instead

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