How to create a hastebin.io website

Does anyone have a glitch template like the website hastebin.io, pastebin.io, or throwbin.io any one of those. Would be appreciated!

The code for hastebin.com can be found at the following links:

4 Likes

You could try P2Pbin (remix) which is a static pastebin based on IPFS.

1 Like

Yeah all yah have to do is clone the repo into glitch, it takes like 1 minute to setup that way because the package.json file is setup so it’s compatible with glitch however it was lagging for me when I installed my instance so it ended up taking 5 minutes lol

Well, you could learn from a template. That’s how I learned more express using the hello-express template.

That’s a really crappy thing to say.

Maybe OP knows Node.js but not know how to store data that well.

That is rude. That might brake them feelings. I flagged it.

2 Likes
<style>*{background-color:black;color:white;font-family:"roboto";}</style>
<style>*{background-color:black;color:white;font-family:"roboto";}</style>
<input type="textbox" id="lbs" placeholder="
<?php

$s = strval(rand(1,1000000000000000));
echo "saved at " . $s;
// configuration
$url = '/';
$date = new DateTime();
$s=$date->getTimestamp();
$file = '/' . $s;
// check if form has been submitted
if (isset($_POST['text']))
{
    // save the text contents
    shell_exec("echo something > " . $s . ".html");
    file_put_contents($file, $_POST['text']);
    // redirect to form again
    header(sprintf('Location: %s', $url));
    printf('<a href="%s">Moved</a>.', htmlspecialchars($url));
    exit();
}

// read the textfile
$text = file_get_contents($file);

?>"/>
<!-- HTML form -->
<form action="" method="post">
<br><textarea name="text"><?php echo htmlspecialchars($text) ?></textarea>
<br><input type="submit" />
<br><input type="reset" />
</form>

Erm, this seems like a very bad idea. You could easily insert:

Hello!" && rm -rf * and delete everything.

4 Likes

I added it to use unix timestamps instead of shell_exec

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.