0

シンプルな CMS スクリプト用のライセンス システムを作成しようとしています。そのために fopen 関数を使用していますが、エラーが発生しました。私のhtmlフォームのコードは次のとおりです。

<form action="check.php" method="post">
<div><label id="Label1" for="domain">Domain : </label><input name="domain" type="text" /></div>
<div><label id="Label2" for="lis">Liscence : </label><input name="liscode" type="text" /></div>
<div><input name="Submit1" type="submit" value="submit" /></div>
</form>

フォーム アクションの場合:

<?php
$dom = $_POST['domain'];
$lis = $_POST['liscode'];
$URL = "http://localhost/check/checklic.php?dom=".$dom."&lis=".$lis."";
$handle = fopen($URL, "r");
if ($accept = 0){
$letter = "Invalid License Key";
}
else
{
$letter = " Congratulation You Have Been License";
}
echo $letter;
?>

そして私のファイル 私のデータベースでライセンスを確認する方法は次のとおりです。

<?php
$domain = $_GET['dom'];
$liskey = $_GET['lis'];
$host = "localhost";
$user = "root";
$pass = "admin";
$db = "test";
$dblink = new PDO("mysql:host=$host;dbname=$db",$user,$pass);
$mysql_liscode = "SELECT liscode FROM lis WHERE domain = '".$domain."'";
$query_liscode = $dblink->query($mysql_liscode) or die("failed!");
$liscode = $query_liscode->fetch(PDO::FETCH_ASSOC);
$count = $query_liscode->rowCount();
if ($count = 0){
$accept = 0;
}
elseif ($liscode['liscode'] != $liskey){
$accept = 0;
}
else{
$accept = 1;
}
?>

ライセンス チェッカーが

http://localhost/check

そして、そのアクションを含むフォームは

http://localhost/site

メッセージは常に

Warning: fopen(http://localhost/check/checklic.php?dom=ammar.com&lis=1234) [function.fopen]:
failed to open stream: No error in C:\AppServ\www\site\check.php on line 5
Congratulation You Have Been Liscienced

フォームに間違ったライセンス情報を入力した場合でも

助けてください。

4

2 に答える 2

0

に変更if ($accept = 0){if ($accept == 0){て同じ$count

于 2013-02-09T13:45:26.057 に答える
0

私はここで巨大な手足に出かけて、問題がURLであることを提案します.

それを試してみてください

$URL = "http://localhost/check/checklic.php?dom=".$dom."&lis=".$lis;
$handle = @fopen($URL, "r");
于 2013-02-09T14:03:04.153 に答える