• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

PHP Url

Raggaer

Godly Member
Joined
Jul 25, 2012
Messages
1,557
Solutions
8
Reaction score
957
Location
Spain
Hello, im making a simple pastebin site to train my php skills but I cant figure out how to show the pastecode you type in a new link
PHP:
    <?PHP
	
require("functions/core.php");
pastes();
connectt();

	if ($_POST['submit']) {
		
		$title = $_POST['title'];
		$body = $_POST['body'];
		$date = date("Y-m-d");	
		
		if ($title && $body) {
			
			$query = mysql_query("INSERT INTO codes VALUES('','$title','$body','$date')");
			$filename = "w".$title.".txt";
			$handle = fopen('pastes\\'.$filename, 'w');
			fwrite($handle,$body);
			fclose($handle);
			die( 'Share added correctly<br>
			Your paste link is :<b> pastes/w'.$title.'.txt</b>
			
			');
		} else {
			
		echo 'Fill all fields';
			echo'<br>';
			echo'<br>';
		}
		
	
	}
?>

With that you can see the code in ex: localhost/pastes/file.txt but to see it like pastebin.com does? any idea?
 
@Zisly so this will be a safe mode to get that data?

PHP:
$title = mysql_real_escape_string($_POST['title']);

@xitoz2 I mean something like pastebin uses when u send a paste you get for example 'www.pastebin.com/xDDskf' how they do that ? I cant figure out
 
Back
Top