Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //This script is to INSERT data into the db
- //This system will only have one user - so why have usernames and stuff stored in a database? That would be pointless!
- //Here, we are getting the username and password from the login form.
- $user=$_POST["username"];
- $password=$_POST["pass"];
- //K,so, Shizmeister, we need to check that the username is correct
- if ($username="editor") {
- if ($password="changethispass"){
- //And now the password
- include 'connect_to_mysql.php';
- //getting the data:
- $body=$_POST["body"]; //using the POST method!
- $title=$_POST["title"];
- $header=$_POST["head"];
- $pid=$_POST["title"];
- preg_replace(' ', '-', $pid);
- mysql_real_escape_string($pid);
- mysql_real_escape_string($title);
- mysql_real_escape_string($head);
- mysql_real_escape_string($body);
- //Inserting the data
- mysql_query("INSERT INTO cms_content (body, title, head, pid) VALUES ($body, $title, $head, $pid)");
- //Now close the connection! QUICK! BEFORE THE THIEVES GET INZ LULZ!
- mysql_close($conn);
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement