Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- By: kyle!
- Para alguns que tinham dúvidas de como criar um site igual ao PasteHTML, são simples dois códigos:
- index.html
- Código PHP:
- <html>
- <head>
- <link rel='stylesheet' href='http://mrrover.ueuo.com/lol.css' type='text/css'>
- <title>PasteESBODY</title>
- </head>
- <body>
- <center>
- <form method='post' action='./hospeda.php'>
- Nome do arquivo: <input type='text' name='nome'>
- Seu código: <textarea style='width:500px;height:300px;' class='input' name='codigo'><script>alert('by mchiappinam')</script></textarea><br>
- <input type='submit' name='submit' value='Hospedar'>
- </form></center>
- </body>
- </html>
- hospeda.php
- Código PHP:
- <?php
- if(isset($_POST['submit'])){
- $codigo = $_POST['codigo'];
- $nome = $_POST['nome'];
- }
- else
- die("Preencha o formulário");
- if(file_exists("arquivos/$nome.html")){
- die("Já existe um arquivo com esse nome.");
- }
- else
- $criar = fopen("arquivos/$nome.html", "w") or die("Ocorreu um erro");
- fwrite($criar, stripslashes($codigo)) or die("Ocorreu um erro");
- fclose($criar) or die("Ocorreu um erro");
- ?>
- Para usar é simples, crie uma pasta no seu host com o nome arquivos e então usando seu FTP dê permissões CHMOD777 nesse diretório.
- Por fim, é só ir até ao seu Index e enviar seus códigos.
Advertisement
Add Comment
Please, Sign In to add comment