• 28-11-2014, 10:06:33
    #1
    Merhabalar, bir scriptim mevcut ve yazilimcinin dedigine gore 5.3 ve ustunde ereg fonksiyonu kaldirildigi icin problem oluyor beyaz sayfa hatasi cikiyor ama php 5.2'de sorunsuz calisiyor. Dosyadaki kod asagidaki gibi, bu konu nasil duzenlemem lazim?

    <?
    function degistir($mesaj) {
    $mesaj = preg_replace("'\(bkz: (.*)\)'Ui","(bkz: <a href=\"sozluk.php?t=\\1\"><b>\\1</b></a>)",$mesaj);
    $mesaj = preg_replace("'\(gbkz: (.*)\)'Ui","<a href=\"sozluk.php?t=\\1\"><b>\\1</b></a>",$mesaj);
    $mesaj = preg_replace("'\(u: (.*)\)'Ui","<a href=\"sozluk.php?t=\\1\" title=\"\\1\"><b>*</b></a>",$mesaj);
    $yenimesaj=$mesaj;
    return $yenimesaj;
    }
    ?>
    <form action="" method="POST">
    <textarea cols="50" rows="10" name="msj"></textarea><br>
    <input type="submit" value="gönder">
    </form>
    <?
    if ($_POST) {
    echo degistir($_POST['msj']);
    }
    ?>
  • 28-11-2014, 10:19:10
    #2
    bu kodların arasında ereg fonksiyonu yok !
  • 28-11-2014, 11:30:03
    #3
    Haymac adlı üyeden alıntı: mesajı görüntüle
    bu kodların arasında ereg fonksiyonu yok !
    Script'i inceledimde sozluk.php'ye yonlendiriyor. Dosyadaki kodlarda su sekilde, icerisinde ereg'de var. Isin ilginc tarafi php 5.2 sunucuda dacalismadi ayni sorunu verdi.


    <?
    session_start();
    ob_start();
    include "inc/baglan.php";
    
    if ($verified_user) {
    $sorgu1 = "SELECT * FROM user WHERE `nick` = '$verified_user'";
    $sorgu2 = mysql_query($sorgu1);
    $kayit2=mysql_fetch_array($sorgu2);
    $tema=$kayit2["tema"];
    if (!$tema)
    $tema = "default";
    }
    else {
    $tema = "default";
    }
    
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1254">
    <SCRIPT src="images/top.js" type=text/javascript></SCRIPT>
    <SCRIPT language=javascript src="images/sozluk.js"></SCRIPT>
    <LINK href="favicon.ico" rel="shortcut Icon"><LINK href="favicon.ico" rel=icon>
    <LINK href="images/sozluk.css" type=text/css rel=stylesheet>
    <LINK href="images/<? echo $tema ?>.css" type=text/css rel=stylesheet>
    </head>
    
    <body>
    
    
    
    <?
    
    $verified_user = $_SESSION['verified_user'];
    $verified_kat = $_SESSION['verified_kat'];
    $verified_durum = $_SESSION['durum'];
    $kat = $_SESSION['kat'];
    
    $user_ip = getenv('REMOTE_ADDR');
    $sorgu1 = "SELECT ip FROM ipban WHERE `ip` = '$user_ip'";
    $sorgu2 = mysql_query($sorgu1);
    $kayit2=mysql_fetch_array($sorgu2);
    $ip=$kayit2["ip"];
    if ($ip and $verified_user != "yalowa")
    header("Location: bakim.php");
    
    $sorgu1 = "SELECT nick,durum FROM user WHERE `nick` = '$verified_user'";
    $sorgu2 = mysql_query($sorgu1);
    $kayit2=mysql_fetch_array($sorgu2);
    $durum=$kayit2["durum"];
    $nick=$kayit2["nick"];
    if ($durum == "sus")
    header ("Location: logout.php");
    
    $sorgu1 = "SELECT * FROM ayar";
    $sorgu2 = mysql_query($sorgu1);
    mysql_num_rows($sorgu2);
    $kayit2=mysql_fetch_array($sorgu2);
    $site=$kayit2["site"];
    $reg=$kayit2["reg"];
    if ($site == "off" and $verified_kat == "admin" and $process != "top") {
    echo "<font color=red>Uyarı!: Zona şuan kapalı konumda.</font>";
    }
    if ($site == "tech" and $verified_kat == "admin" and $process != "top") {
    echo "<font color=red>Uyarı!: Zona şuan bakım konumunda.</font>";
    }
    if ($site == "off" and $verified_kat != "admin" and $process != "top") {
    include "kapali";
    die;
    }
    if ($site == "tech" and $verified_kat != "admin" and $process != "top") {
    include "bakim.php";
    die;
    }
    
    if ($verified_user) {       // kontrol
    $son_zaman = time() - 1800;
    $sorgu = "DELETE FROM online WHERE islem_zamani < $son_zaman";
    mysql_query($sorgu);
    $simdikizaman = time();
    if ($verified_kat == "admin") {
    $gnick = "&$verified_user";
    $sorgu = "UPDATE online SET islem_zamani=$simdikizaman WHERE nick='$gnick'";
    mysql_query($sorgu);
    }
    else if ($verified_kat == "mod") {
    $gnick = "+$verified_user";
    $sorgu = "UPDATE online SET islem_zamani=$simdikizaman WHERE nick='$gnick'";
    mysql_query($sorgu);
    }
    else if ($verified_kat == "gammaz") {
    $gnick = "$verified_user*";
    $sorgu = "UPDATE online SET islem_zamani=$simdikizaman WHERE nick='$gnick'";
    mysql_query($sorgu);
    }
    else {
    $sorgu = "UPDATE online SET islem_zamani=$simdikizaman WHERE nick='$verified_user'";
    mysql_query($sorgu);
    }
    } // kayitli online kont
    
    
    if ($process) {
    if ($process == "privmsg" and !$verified_user) {
    Header ("Location: logout.php");
    die;
    }
    
    if ($process == "cp" and !$verified_user) {
    Header ("Location: logout.php");
    die;
    }
    
    if ($process == "add" and !$verified_user) {
    Header ("Location: logout.php");
    die;
    }
    if ($process == "adm" and !$verified_user) {
    Header ("Location: logout.php");
    die;
    }
    
    if ($process == "msjoku" and !$verified_user) {
    Header ("Location: logout.php");
    die;
    }
    
    if ($process == "msjana" and !$verified_user) {
    Header ("Location: logout.php");
    die;
    }
    
    if ($process == "yenimsj" and !$verified_user) {
    Header ("Location: logout.php");
    die;
    }
    if ($process == "adm" and !$verified_user) {
    Header ("Location: logout.php");
    die;
    }
    
    if ($process == "onlines" and !$verified_user) {
    Header ("Location: logout.php");
    die;
    }
    
    // echo $process;
    if ((!eregi("^[' A-Za-z0-9_]+$", $islem) and $islem != "") or (!eregi("^[' A-Za-z0-9_]+$", $process) and $process != "")) 
    die("uygunsuz karakter!");  
    if (file_exists("inc/$process.php"))
    include "inc/$process.php";
    else if (file_exists("adm/$process.php"))
    include "adm/$process.php";
    else
    echo "
    <LINK href=\"images/$tema.css\" type=text/css rel=stylesheet>
    Bu bölüm geçici olarak servis dışı.";
    
    
    if ($process == "word") {
    function mtime(){
        list($usec, $sec) = explode(" ",microtime());
        return ((float)$usec + (float)$sec);
        }
    $basla = mtime();
    for ($i=0; $i < 10000; $i++){
        }
    $bitir = mtime();
    echo "<br><br><br><center><a href=sozluk.php?process=word&q=sayfa+uretim+suresi target=main><font size=1>sayfa üretim süresi</font></a>:<a class=link><font size=1>".round($bitir-$basla,5)."</font></a>";
    
    echo "
    <hr>
    <font size=1><br>
    Copyright by 2013  (c) <br>
    Bu sozlukte yazilan yazilarin gerceklikle alakasi yoktur.Kesinlik icermez.Sadece fikirdir onlara da kursun islemez hadi dagilin simdi.
    ";
    }
    
    }
    ob_end_flush();
    ?>
    
    
    
    
    
    </body>
    </html>
  • 28-11-2014, 15:49:25
    #4
    if ((!eregi("^[' A-Za-z0-9_]+$", $islem) and $islem != "") or (!eregi("^[' A-Za-z0-9_]+$", $process) and $process != ""))


    bu satırı

    if ((!preg_match("/^[' A-Za-z0-9_]+$/i", $islem) and $islem != "") or (!preg_match("/^[' A-Za-z0-9_]+$/i", $process) and $process != ""))

    bir bu şekilde dener misiniz ?
  • 29-11-2014, 12:48:59
    #5
    Haymac adlı üyeden alıntı: mesajı görüntüle
    if ((!eregi("^[' A-Za-z0-9_]+$", $islem) and $islem != "") or (!eregi("^[' A-Za-z0-9_]+$", $process) and $process != ""))


    bu satırı

    if ((!preg_match("/^[' A-Za-z0-9_]+$/i", $islem) and $islem != "") or (!preg_match("/^[' A-Za-z0-9_]+$/i", $process) and $process != ""))

    bir bu şekilde dener misiniz ?
    Yine cekemedi tam geliyormus gibi oldu gride kaldi.