1. sayfa
$res=mysql_query($qur,$xrozi); satırının altına aşağıdaki ifadeyi eklersen, MYSQL'den dönen hatayı da görebiliriz. if (!$res) { exit(mysql_error()); } |
Hocam O sorunun nedeni benzer isimli mysql veri tabanı sorunuydu ve kendiliğinden çözüldü.Yinede Teşekkürler Ama Başka sorunum ortaya çıktı şöyle anlayatım; "rozikids.com/panel/" Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/rozik92657j/public_html/panel/index.php:1) in /home/rozik92657j/public_html/panel/index.php on line 37 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/rozik92657j/public_html/panel/index.php:1) in /home/rozik92657j/public_html/panel/index.php on line 37 "index.php" <?php require_once('../Connections/xrozi.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } ?> <?php // *** Validate request to login to this site. if (!isset($_SESSION)) { session_start(); } $loginFormAction = $_SERVER['PHP_SELF']; if (isset($_GET['accesscheck'])) { $_SESSION['PrevUrl'] = $_GET['accesscheck']; } if (isset($_POST['textfield'])) { $loginUsername=$_POST['textfield']; $password=$_POST['textfield2']; $MM_fldUserAuthorization = ""; $MM_redirectLoginSuccess = "login-home.php"; $MM_redirectLoginFailed = "index.php"; $MM_redirecttoReferrer = false; mysql_select_db($database_xrozi, $xrozi); $LoginRS__query=sprintf("SELECT username, pass FROM users WHERE username=%s AND pass=%s", GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); $LoginRS = mysql_query($LoginRS__query, $xrozi) or die(mysql_error()); $loginFoundUser = mysql_num_rows($LoginRS); if ($loginFoundUser) { $loginStrGroup = ""; if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();} //declare two session variables and assign them $_SESSION['MM_Username'] = $loginUsername; $_SESSION['MM_UserGroup'] = $loginStrGroup; if (isset($_SESSION['PrevUrl']) && false) { $MM_redirectLoginSuccess = $_SESSION['PrevUrl']; } header("Location: " . $MM_redirectLoginSuccess ); } else { header("Location: ". $MM_redirectLoginFailed ); } } ?> <style type="text/css"> #ana tr td form #ic-back { background-image: url(css/images/login-back.png); background-repeat: no-repeat; } #ana tr td form #ic-back tr td #login { font-family: "Arial Black", Gadget, sans-serif; text-decoration: none; color: #000; } body { margin-top: 50px; } </style> <table width="1024" align="center" id="ana"> <tr> <td height="500"> <form name="form1" method="POST" action="<?php echo $loginFormAction; ?>"> <table width="364" align="center" id="ic-back"> <tr> <td width="356" height="438"><table width="291" align="center" id="login"> <tr> <td width="111">Kullanıcı Adı:</td> <td width="140"><label for="textfield"></label> <input type="text" name="textfield" id="textfield"></td> </tr> <tr> <td>Parola:</td> <td><input type="text" name="textfield2" id="textfield2"></td> </tr> <tr> <td> </td> <td align="center" valign="middle"><input type="submit" name="button" id="button" value="Gönder"></td> </tr> </table> </td> </tr> </table> </form></td> </tr> </table> acaba sorun nedir hocam??? |
Yardım Edecek Yok mu Acill İhtiyacım Var Forum Donanım Haber Lütfenn |
PHP bir şekilde output verdiyse ve/veya header gönderdiyse ondan sonra session başlatamazsın. session_start();'ı kodun en üstüne alırsan sorun çözülür. |
denedim hocam ama işe yaramadı... site adresiwww.rozikids.com/panel@funky-nd@fehmix |
session_start() en üstteyse, onun altına ob_start(); sayfanın en altına da <?php ob_end_flush(); ?> koyarak dener misin? |
Denedim Hocam Hala Değişen Bir şey Yok... |
kodun son halini paylaşabilir misin? |
<?php session_start(); ob_start(); require_once('../Connections/xrozi.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } ?> <?php // *** Validate request to login to this site. if (!isset($_SESSION)) { } $loginFormAction = $_SERVER['PHP_SELF']; if (isset($_GET['accesscheck'])) { $_SESSION['PrevUrl'] = $_GET['accesscheck']; } if (isset($_POST['textfield'])) { $loginUsername=$_POST['textfield']; $password=$_POST['textfield2']; $MM_fldUserAuthorization = ""; $MM_redirectLoginSuccess = "login-home.php"; $MM_redirectLoginFailed = "index.php"; $MM_redirecttoReferrer = false; mysql_select_db($database_xrozi, $xrozi); $LoginRS__query=sprintf("SELECT username, pass FROM users WHERE username=%s AND pass=%s", GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); $LoginRS = mysql_query($LoginRS__query, $xrozi) or die(mysql_error()); $loginFoundUser = mysql_num_rows($LoginRS); if ($loginFoundUser) { $loginStrGroup = ""; if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();} //declare two session variables and assign them $_SESSION['MM_Username'] = $loginUsername; $_SESSION['MM_UserGroup'] = $loginStrGroup; if (isset($_SESSION['PrevUrl']) && false) { $MM_redirectLoginSuccess = $_SESSION['PrevUrl']; } header("Location: " . $MM_redirectLoginSuccess ); } else { header("Location: ". $MM_redirectLoginFailed ); } } ?> <style type="text/css"> #ana tr td form #ic-back { background-image: url(css/images/login-back.png); background-repeat: no-repeat; } #ana tr td form #ic-back tr td #login { font-family: "Arial Black", Gadget, sans-serif; text-decoration: none; color: #000; } body { margin-top: 50px; } </style> <table width="1024" align="center" id="ana"> <tr> <td height="500"> <form name="form1" method="POST" action="<?php echo $loginFormAction; ?>"> <table width="364" align="center" id="ic-back"> <tr> <td width="356" height="438"><table width="291" align="center" id="login"> <tr> <td width="111">Kullanıcı Adı:</td> <td width="140"><label for="textfield"></label> <input type="text" name="textfield" id="textfield"></td> </tr> <tr> <td>Parola:</td> <td><input type="text" name="textfield2" id="textfield2"></td> </tr> <tr> <td> </td> <td align="center" valign="middle"><input type="submit" name="button" id="button" value="Gönder"></td> </tr> </table> </td> </tr> </table> </form></td> </tr> </table> <?php ob_end_flush(); ?> |
Bu kodu kendi lokal'imde sorunsuz çalıştırıyorum. Hiç hata vermiyor. Ne tür bir hata alıyorsun? |
Hocam Bende Local de Sorunsuz Ayarladım Ama Siteye Attığımda Problem Oldu... Acaba Bana Buna benzer basit bir panel kodu verebilir misiniz??? |
Eğer local'de sorunsuz çalışıyorsa, siteye attığında problem oluyorsa include ettiğin require_once('../Connections/xrozi.php'); xrozi.php dosyasında hata olabilir. Sitede veritabanına sorunsuz bağlanabiliyor musun? |
Evet Çünkü anasayfayıda aynı veriden alıyorum... |
1. sayfa
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/rozik92657j/public_html/index.php on line 34
Buda İndex.php Sayfam...
<?php require_once('connections/xrozi.php');
mysql_select_db($database_xrozi,$xrozi);
mysql_query("SET NAMES UTF8");
$qur="select * from dil";
$res=mysql_query($qur,$xrozi);
?>
<style type="text/css">
body {
background-image: url(css/img/products/spot-light-1.png);
margin-left: -100px;
}
#ana tr #flag {
}
</style>
<style type="text/css">body, a:hover {cursor: url(css/curcors.cur), progress !important;}</style>
<table width="500" align="center" id="ana">
<tr>
<td width="1049" height="250" align="center" valign="top"><p> </p>
<p> </p>
<p> </p>
<p><img src="css/img/logo.png" width="350" height="100" /></p></td>
</tr>
<tr>
<td align="center" valign="middle" id="flag"> <?php while($row=mysql_fetch_array($res)) { ?>
<a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=117563940&url=home.php?dilid=<?php echo $row['id']?>" data-href="home.php?dilid=<?php echo $row['id']?>"><img src="css/img/lang/langg/<?php echo $row['bayrak'] ?>.png" width="100" height="100" /></a>
<?php } ?> </td>
</tr>
<tr>
<td height="154" align="center" valign="bottom"><img src="css/bannerlogo.png" alt="" width="191" height="126" /></td>
</tr>
<tr>
<td height="114" align="center" valign="bottom"><img src="css/created-by-spektra7.png" width="150" height="35" /></td>
</tr>
</table>