• 11-06-2009, 19:16:09
    #1
    arkadaşlar aşağıda 2php dosya verdim onlara replace uygulayıp verebilirmisin çok acil tr karakter sorunu için

    dosya 1
    <?php
    // /////////////////////////////////////////////
    // ask_rave: QUESTION AND ANSWER SCRIPT
    // Copyright 2004-2006: Some Rights Reserved
    // url: http://rave.jk-digital.com
    // /////////////////////////////////////////////
    // Start
    if (file_exists("install.php")) { die("Install file exists. Please either install before use, or if you have set the configuration file, please delete <b>install.php</b>, as it poses as a security risk."); };
    include_once ("start.php");
    
    echo "<div class=\"qcontent\">"; // start content div
    
    echo "Ask <b>$yourname</b> <br /><br />";
    echo "\n \n";
    
    echo "Abi Yha  $yourname .<br />";
    if ($emoenable == "y") { echo "ifadeler icin. <a href=\"emoticonlist.php\" target=\"_blank\" onclick=\"window.open('emoticonlist.php','emoticons','height=600,width=520,toolbar=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes'); return false;\">Buraya Tikla.</a>"; } else { echo "Emoticons are disabled."; };
    echo "<br /><br />\n \n";
    ?>
    
    <form action="ask2.php" method="post">
    <label for="name">ismin:</label> <input type="text" id="name" name="username" value="" /><br />
    <?php if ($visitorurl == "y") { ?>
    <label for="email">Email:</label> <input type="text" id="email" name="email" value="" /> (leave blank if none)<br />
    <label for="url">URL:</label> <input type="text" id="url" name="url" value="http://" /> (leave blank if none)<br />
    <?php }; ?><br />
    <label for="question"><strong>Ne Soracaktin?:</strong></label> <input type="text" id="question" name="userquestion" value="" size="50" /><br />
    <label for="submit">&nbsp;</label> <input type="submit" id="submit" value="Sor Gitsin!">
    </form>
    </div>
    
    <?php
    // End
    include_once ("end.php");
    ?>
    Dosya 2.

    <?php
    // /////////////////////////////////////////////
    // ask_rave: QUESTION AND ANSWER SCRIPT
    // Copyright 2004-2006: Some Rights Reserved
    // url: http://rave.jk-digital.com
    // /////////////////////////////////////////////
    session_start(); // start session
    // This is an admin page.
    // Admin Start
    include_once ("adminstart.php");
    
    echo "<div class=\"content1\">";
    
    if ($_SESSION["attuser"] == NULL) { die("You have not attempted to login.</div>"); };
    // check for correctness
    if ($_SESSION["attuser"] != $adminuser || $_SESSION["attpass"] != $adminpass) { die("Your login details are incorrect.</div>"); };
    
    // data file checking
    if (!file_exists("../data.txt")) { die("Data file (data.txt) does not exist. Please reupload this file."); };
    if (!file_exists("../dataedit.txt")) { die("Data file (dataedit.txt) does not exist. Please reupload this file."); };
    
    $doweneedto = filesize("../dataedit.txt");
    if ($doweneedto == "1") {
    echo "Sorry, you have <strong>no</strong> questions to answer.\n";
    } else {
    
    $linesfile = file("../dataedit.txt");
    $lines = count($linesfile);
    echo "<h1>You have $lines question"; if ($lines != 1) {echo "s";}; echo " to answer.</h1>";
    echo "<sub>If there are empty boxes, you may need to manually edit your awaiting questions (dataedit.txt) to the correct syntax, as there will have been an error.</sub><br /><br />";
    
    if ($emoenable == "y") { echo "<a href=\"../emoticonlist.php\" target=\"_blank\" onclick=\"window.open('../emoticonlist.php','emoticons','height=600,width=520,toolbar=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes'); return false;\">Emoticons are enabled. Click here for the full list.</a>"; } else { echo "Emoticons are disabled."; };
    
    echo "</div>\n";
    
    $lines = $lines - 1;
    
    $filename = "../dataedit.txt";
    $handle = fopen($filename, "r");
    $tosub = fread($handle, filesize($filename));
    $tosub = stripslashes($tosub);
    echo "<form action=\"admin_answerprocess.php\" method=\"post\">";
    
    $pieces = explode("\n", $tosub);
    
    // DEBUG ONLY //
    //echo "<pre>";
    //print_r($pieces);
    //echo "</pre><br />";
    
    // loopage
    // QUESTION|**|ANSWER|**|NAME|**|DATE|*1|EMAIL|*2|URL
    $togo = 0;
    while ($togo <= $lines) {
       echo "<div class=\"content1\">"; // new div (cosmetic)
          echo "<span class=\"questioncount\">\n";
    		$togo++;
       echo $togo;
    		$togo--;
       echo "</span>";
       
       // START GETTING DATA
       // QUESTION, ANSWER, NAME, DATE
       $bitstotake = explode("|**|", $pieces[$togo]);
       
       $linequestion = $bitstotake[0]; // question
       $lineanswer = $bitstotake[1]; // answer
       $linename = $bitstotake[2]; // name
       
       $emailstatus = substr_count($bitstotake[3], '|*1|'); // email
       $urlstatus = substr_count($bitstotake[3], '|*2|'); // url
       if ($urlstatus == "1" and $emailstatus == "1") {
       $bothstatus = "1"; } else { $bothstatus = "0"; };
       
       if ($bothstatus == "1") { // if both are present
       $leftovers = explode('|*1|', $bitstotake[3]);
       $linedate = $leftovers[0]; // date
       $leftovers2 = explode('|*2|', $leftovers[1]);
       $lineemail = $leftovers2[0]; // email
       $lineurl = $leftovers2[1]; // url
       }
       elseif ($emailstatus == "1") { // email only
       $leftovers = explode('|*1|', $bitstotake[3]);
       $linedate = $leftovers[0]; // date
       $lineemail = $leftovers[1]; // email
       } 
       elseif ($urlstatus == "1") { // urlonly
       $leftovers = explode('|*2|', $bitstotake[3]);
       $linedate = $leftovers[0]; // date
       $lineurl = $leftovers[1]; // url
       }
       else {
       $linedate = $bitstotake[3];
       };
       
       // FINISH GETTING DATA
       // QUESTION|**|ANSWER|**|NAME|**|DATE|*1|EMAIL|*2|URL
       // START DISPLAYING DATA
       
       // <table border="0">
       // <tr><td>#</td><td>#/#/#</td><td>Question</td><td>Name</td><td>Date</td></tr>
       // <tr><td>Email: [Email]</td><td>URL: [URL]</td></tr>
       // <tr><td>Answer: [Answer]</td></tr>
       
       echo "<input type=\"hidden\" name=\"tbi[$togo][0]\" value=\"$linequestion\">";
       echo "<b>Q. $linequestion</b><br /><br />";
       
       echo "<table border=\"0\" cellpadding=\"2\"><tr><td>";
       echo "asked by:</td><td><input type=\"text\" name=\"tbi[$togo][2]\" value=\"";
       echo "$linename";
       echo "\" size=\"28\"></td>";
       
       echo "<td>date asked:</td><td>$linedate<input type=\"hidden\" name=\"tbi[$togo][3]\" value=\"";
       echo "$linedate";
       echo "\" size=\"28\"></td>";
       echo "</td></tr>\n";
       
       // if email or url exists
       if ($emailstatus == "1" || $urlstatus == "1") {
       echo "<tr>";
       };
         
       if ($emailstatus == "1") { // if email exists
       echo "<td>";
       echo "email:</td><td><input type=\"text\" name=\"tbi[$togo][4]\" value=\"";
       echo "$lineemail";
       echo "\" size=\"28\">";
       echo "</td>";
       };
       
    
       if ($urlstatus == "1") { // if url exists
       echo "<td>";
       echo "url:</td><td><input type=\"text\" name=\"tbi[$togo][5]\" value=\"";
       echo "$lineurl";
       echo "\" size=\"28\">";
       echo "</td>";   
       };
       
       // if email or url exists
       if ($emailstatus == "1" || $urlstatus == "1") {
       echo "</tr>";
       };
     
       echo "</table>\n";
       
       echo "&nbsp;your answer: <input type=\"text\" name=\"tbi[$togo][1]\" value=\"\" size=\"60\">";
       echo " <sub>[$emailstatus/$urlstatus/$bothstatus]</sub>";
       
       // FINISH DISPLAYING DATA
       // DONE!
       
        $togo++;
        
       echo "</div>\n \n";
    
    };
    // end loopage
    
    echo "<div class=\"content1\" align=\"center\">"; // new div (cosmetic)
    
    echo "<b>Are you done?</b><br /><br />";
    echo "<input type=\"submit\" value=\"Submit Data\"> <input type=\"reset\" value=\"Mistake?\">";
    echo "</form>";
    
    fclose($handle);
    
    echo "<br /><br /><sub>E/U/B is the internal process of checking if the question has an email, url or both attached to it. It's there for debug, just ignore it.</sub>";
    echo "</div>";
    };
    
    echo "</div>";
    
    // Admin End
    include_once ("adminend.php");
    ?>
    yardımlarınızı bekliyorum...
  • 11-06-2009, 20:01:13
    #2
    nerede nasıl bir replace ?

    takıldığınız yer lütfen çok zahmet olacak ama.
  • 11-06-2009, 20:46:35
    #3
    <form action="ask2.php" method="post">
    <label for="name">ismin:</label> <input type="text" id="name" name="username" value="" /><br />
    <?php if ($visitorurl == "y") { ?>
    <label for="email">Email:</label> <input type="text" id="email" name="email" value="" /> (leave blank if none)<br />
    <label for="url">URL:</label> <input type="text" id="url" name="url" value="http://" /> (leave blank if none)<br />
    <?php }; ?><br />
    <label for="question"><strong>Ne Soracaktin?:</strong></label> <input type="text" id="question" name="userquestion" value="" size="50" /><br />
    <label for="submit">&nbsp;</label> <input type="submit" id="submit" value="Sor Gitsin!">
    </form>
    </div>
    burda Ne Soracaktin? yerinde kutucuk var bu soru cevap scriptinin bi dosyası burda yazılan sorular sitede tr karakter sorunu veriyor ı ğ gibi karakterler kullanılmıyor kullanıncakarakter hatasın alıyorum replace ile yardım edermısıniz burda bi sorun var yapmadım