Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Mantux94 [PHP] Darbai.

Parašė Mantux94· 2009 Vas. 8 21:02:00
#57

niekaip nesigauna...

Kodas:
<?php
function br2nl($str) {
return preg_replace('=<br */?>=i', "", $str);
}
$action=$_POST['action'];
$textarea=$_POST['textarea'];
$url = "db.txt"; 
$return="edit.php";
$data = implode("", file($url));
if (isset($_POST['submit'])) {
    if ($action=="save") {
       if ($_POST['pass'] == 'slaptazodis') {
      $newtext=stripslashes($textarea);
      $newtext = str_replace("<?", "", $newtext);
      $newtext = str_replace("?>", "", $newtext);
      $newtext = nl2br($newtext);
      $fh = fopen($url, 'w') or die("can't open file");
      fwrite($fh, $newtext);
      fclose($fh); 
      header ("location: edit.php");
    } else {
echo"
<html>
<head>
<style>
body,html{
margin:0px auto;
width:700px;
text-align:center;
}
#content{
margin:0px auto;
width:700px;
}
#middle h1 {
    color: transparent;
    font-family:georgia;
    font-size:12pt;
    margin:0;
    color: #dF9100;
    padding:10px 0px 15px 0px;
    text-align:left;
}
</style>
<body>
<div id='content'>
";
$ta=br2nl($data);
echo "<br>
<form action='edit.php' method='post'>
<input type='hidden' name='action' value='save'>
<input type='hidden' name='p' value='$page'>
<input type='hidden' name='n' value='$n'>
<textarea name='textarea' rows='25' cols='80'>$ta</textarea>
<br />
<input type='submit' name='submit' value='I&#353;saugoti'>
</form>

<div id='middle' style='width:680px; text-align:left; padding-left:20px; border:1px solid #ccc;'>
</div>
</div>
</body>
</html>";
       }
    } else {
    echo "pass netoks";
    }
function form() {
?>
<form method="post">
Slaptažodis: <br><input name="pass" type="password" /><br>
<input name="login" type="submit" value="Prisijungti" />
</form>

<?php
}
?>



Eroras:
Parse error: syntax error, unexpected $end in /home/mantux94/domains/mantux94.wu.lt/public_html/banner/edit.php on line 77



Redagavo Mantux94· 2009 Vas. 8 21:02:12