View file pm.php

File size: 1.02Kb
<?php include "head.php"; if($_GET["action"]=="spm") { if($_POST["text"]==""){ echo '<center>Error, pm left blank please go back and fill it.</center>'; include 'foot.php'; exit(); } } $_POST["text"] = str_replace($filter,'*',$_POST["text"]);
$action=$_GET["action"]; if($action=="") {echo '<center><b>Send a private popup to your Friends</b></center>'; echo '<form action="pm.php?action=spm" method="post"><center><br/>Friends Name<br/><input name="name" type="text"/>';
echo '<br/>Message</br><textarea name="text"></textarea><input type="submit" value="Send Popup!"/></center></form>';
} if ($action=="spm"){$f=fopen("popup.php","a+");
fwrite($f,'<?php if($_SESSION["userName"]=="'.$_POST["name"].'"){echo "<script language=\"javascript\"> alert(\"'.$_SESSION["userName"].': '.$_POST["text"].'\"); </script>";
$old=file_get_contents("popup.php"); $new=str_replace("'.$_POST["name"].'","code6",$old); $f=fopen("popup.php","w+"); fwrite($f,$new); fclose($f); } ?>'); fclose($f); echo '<center>Your pm was sent!</center>'; } include "foot.php"; ?>