Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>HX's Guestbook v0.1</title>
- <link REL="stylesheet" TYPE="text/css" HREF="index.css">
- </head>
- <body>
- Powered by HX's Guest by Destroyer<br><br>
- <a href="?action=firma" ><font color='#FF0000'>Firma </font></a><br>
- <a href="?action=aggiorna" ><font color='#FF0000'>Aggiorna pagina </font></a><br>
- <a href="?action=admin" ><font color='#FF0000'>Admin </font></a><br><br>
- COMMENTI: <br><br>
- <?php
- include("guestfile/messaggi.txt");
- $action = $_GET['action'];
- switch($action) {
- case 'firma';
- echo"
- <br><br>
- <form action='' method=POST>
- Username: <br><input type=text name=user ><br>
- Messaggio: <br><textarea name = 'messaggio' rows = '10' cols = '50'><textarea><br><br>
- <input type=submit name=invia value=INVIA>
- </form>
- ";
- $user = $_POST['user'];
- $messaggio = $_POST['messaggio'];
- if (isset($_POST['invia'])) {
- $o = fopen('guestfile/messaggi.txt','a+');
- fwrite($o, "User: $user - Messaggio: $messaggio\n <br>");
- fclose($o);
- }
- break;
- case 'aggiorna';
- header("location:guestbook01.php");
- break;
- case 'admin';
- echo"
- <br>
- <form action='' method=POST>
- Inserisci la password:
- <input type='text' name='pass'><br><br>
- <input type='submit' value='Accedi'><br>
- ";
- $pass = $_POST['pass'];
- if ($pass == "abc"){
- echo"
- <br>
- <a href='?action=edit' >Edit txt </a><br>
- <a href='?action=delete' >Cancella txt </a><br>
- <a href='?action=exit' >Esci </a><br><br>
- ";
- $action = $_GET['action'];
- switch($action) {
- case 'edit';
- $file = ("guestfile/messaggi.txt");
- $fp = fopen ($file, "r");
- echo"
- <br>
- <form action='' method=POST>
- <textarea name = 'textfile' rows = '10' cols = '50'>'$fp'<textarea><br><br>
- <input type='submit' value='SAVE'><br>
- ";
- break;
- case 'delete';
- $file = "guestfile/messaggi.txt";
- if (file_exist($file))
- {
- unlink($file);
- echo "FIle rimosso";
- } else {
- echo "Il file non esiste";
- }
- break;
- case 'exit';
- header("location:guestbook01.php");
- break;
- }
- }
- break;
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement