そのため、新しいホスト (無料のホストから) Crazy Domains に移動しました。すべて問題ないように見えましたが、コードの一部が再生されているようです。
いくつかの調査を行ったところ、フェッチ配列のようです。今、私は解決策を失っています。
Crazydomain ホスティングに移行する前は、ウェブサイト全体が機能していました。
エラーメッセージは次のとおりです。
「警告: mysql_fetch_array() は、パラメーター 1 がリソースであると想定しており、11 行目の /home/lgbtrada/public_html/login.php で指定されたブール値です」
そのためのコード:
<?
session_start();
include("config.php");
include("clean.php");
$login = clean($_GET[login]);
if(isset($_SESSION[usr_name]) && isset($_SESSION[usr_level]) && $login!=logout)
echo('<meta http-equiv="refresh" content="0;url=main.php" />');
else {
$ip = $_SERVER['REMOTE_ADDR'];
$sqlcontent = mysql_query("select * from usr_config");
$content = mysql_fetch_array($sqlcontent);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="css.css" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Usersystem • <? echo("$content[site]");?></title>
</head>
<body>
<div align="center">
<p> </p>
<table width="50%" border="1">
<tr>
<td><div align="center"><? echo("$content[site]");?> UserSystem </div></td>
</tr>
<tr>
<td>
<? if($login!=login){ ?>
<div align="center"><form method="post" action="admin.php?login=login">
Your Username:<br />
<input type="text" name="username" />
<br />
<br />
Password:<br />
<input type="password" name="password" />
<br />
<br />
<input type="hidden" name="ip" value="<? echo("$ip");?>" />
<input type="submit" value="Login" />
<? if($content[pwd]==1){ ?><br /><a href="lostpw.php">Forgot Password?</a> <? } ?><br />
<a href="register.php">Register</a></form></div>
<? }
elseif($login==login)
{
$username = clean($_POST[username]);
$password = md5($_POST[password]);
$date = date("Y-m-d");
$time = date("H:i:s");
$sql = mysql_query("select * from usr_users where username = '$username' AND password = '$password'");
$check = mysql_num_rows($sql);
if($check!=1)
{
echo("Invalid Username or Password!");
echo('<meta http-equiv="refresh" content="1;url=admin.php" />');
$success = "Failed";
if($content[loginlog]==1)
$sqllog = mysql_query("insert into usr_logs(user, ip, time, date, success) values('$username', '$ip', '$time', '$date', '$success')");
}
else
{
$user = mysql_fetch_array($sql);
$_SESSION[usr_name] = $user[username];
$_SESSION[usr_level] = $user[level];
$_SESSION[usr_ip] = $ip;
$success = "Success";
echo("Logged in as $username, Now redirecting..");
echo('<meta http-equiv="refresh" content="1;url=main.php" />');
if($content[loginlog]==1)
$sqllog = mysql_query("insert into usr_logs(user, ip, time, date, success) values('$username', '$ip', '$time', '$date', '$success')");
}
}
if($login==logout)
{
session_unset();
session_destroy();
echo("You are now logged out!");
}
?></td>
</tr>
<tr>
<td><? if($content[loginlog]==1){ ?>Logged: Your IP: <? echo("<b>$ip</b>");?><? } else echo("Your IP was NOT logged");?></td>
</tr>
</table>
<? } ?>
</div>
</body>
</html>
私たちのニュース システムでは、これが返されます。"'; echo stripslashes( $myrow['title'] ); echo ''; echo ' '; echo stripslashes( $myrow['text1'] ); echo '
'; エコー " "; エコー ''; echo ' '.$myrow["レポーター"].' | | '.$myrow["dtime"].' | | コメント | '.$myrow["ビュー"].' ビュー '; }//ループの終わり ?>"
ニュース表示コード:
<?php
// load the configuration file.
include("config.php");
//load all news from the database and then OREDER them by newsid
//you will notice that newlly added news will appeare first.
//also you can OREDER by (dtime) instaed of (news id)
$result = mysql_query("SELECT * FROM news ORDER BY newsid DESC LIMIT 7",$connect);
//lets make a loop and get all news from the database
while($myrow = mysql_fetch_assoc($result))
{//begin of loop
//now print the results:
echo '<h2>';
echo stripslashes( $myrow['title'] );
echo '</h2>';
echo '<p>';
echo stripslashes( $myrow['text1'] );
echo '</p>';
echo "<br />";
echo '<a href="https://twitter.com/share" class="twitter-share-button" ata-url="http://www.mylasuni.com/read_more.php?id='.$myrow["newsid"].'" data-text="'.$myrow["title"].'" data-via="mylasuni" data-related="mylasuni">Tweet</a>';
echo '<hr>
<span style="float:right;"><strong><a href="profile.php?user='.$myrow["reporter"].'">'.$myrow["reporter"].'</a></strong> | '.$myrow["dtime"].' | <a href="read_more.php?id='.$myrow["newsid"].'">Comment</a> | '.$myrow["views"].' view(s)</span><br><hr>';
}//end of loop
?>
ブール値の引数といくつかの tuts を見ましたが、他に役立つ記事はありますか? これを解決するのを手伝ってください!このサイトは正当な目的のためのものです。