I have had a couple problems, and most have been solved. But just for information, I am making a Pastie script, with thats completely customizable. While developing through this (and getting kinda far) I am having a few questions…
My original idea was to MD5 a random string of text create it for the paste document. (This was easy to create, but doesnt look really good), so now I had the idea, create them in numerical order based on the last one made. While I posted this (and I am still a little fuzzy on this whole idea) is to store all the pastes in a database, with all the information and use a column called “id” to numerically create the Pastes in order to help organize the pastes, and I also want to be able to edit them at any time without struggling to find the document in a mess of random PHP documents.
So my first question here, is does anybody have ideas how I could make it extract the data from the database (everytime) the paste is looked at, so the data can be editted (if inappropiate or something) or any other reason. Can I get some help here?
Problem 2 is, while making it so people can paste things freely, how do I make it so tags cannot disrupt the page, so that if someone were to make a paste like this:
<html> <head> <title>Just a test</title> </head> <body> <p>This is just a test!</p> </body> </html>
How do I make it so the paste would actually show up like that so that there would be no risk of XSS or anything as well as they can post code snippets to friends or whatever so I dont have to make it so it strips_tags(); ?
Thanks so much for your time, and thanks if you can help.