ياجماعه ياناس ياخلق انا عند خطا بظهر لى هو ده
Warning: fopen("", "r") - Result too large in c:\apache\htdocs\host\cms-add.php on line 9
Warning: Supplied argument is not a valid File-Handle resource in c:\apache\htdocs\host\cms-add.php on line 10
Article 'ahmed' added Your files is successfully store in database
الخطا بظهر فى الكود ده
<?php
if ($_POST['save'])
{
if(isset($_POST['save']))
{
if ($_POST['MAX_FILE_SIZE'] >= $_FILES['file']['size']) {
$title = $_POST['title'];
$content = $_POST['content'];
$photo = addslashes(fread(fopen($_FILES['file']['tmp_name'], "r"),
$_FILES['file']['size']));
if(!get_magic_quotes_gpc())
{
$title = addslashes($title);
$content = addslashes($content);
}
include 'library/config.php';
include 'library/opendb.php';
$query1= sprintf("INSERT INTO news(Image, FileType, title, content) VALUES
('%s', '%s','$title', '$content')",$photo ,$_FILES['file']['type']);
if (mysql_query($query1)) {
$messages[] = "Your files is successfully store in database";
} else {
$messages[]= mysql_error();
}
}else {
$messages[]="The file is bigger than the allowed size please resize";
}
include 'library/closedb.php';
echo "Article '$title' added";
}
}
?>
<html>
<head>
<title>Add An Article</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.box {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
border: 1px solid #000000;
}
-->
</style>
</head>
<body>
<form method="post">
<table width="700" border="0" cellpadding="2" cellspacing="1" class="box" align="center">
<tr>
<td width="100">Title</td>
<td><input name="title" type="text" class="box" id="title"></td>
</tr>
<?
if (isset($messages)) {
foreach ($messages as $message) {
print $message ."<br>";
}
}
?>
<tr>
<td width="100">Image</td>
<td><input type="file" name="file">
<input type="hidden" name="MAX_FILE_SIZE" value="96000000">
</td>
</tr>
<tr>
<td width="100">Content</td>
<td><textarea name="content" cols="50" rows="10" class="box" id="content"></textarea></td>
</tr>
<tr>
<td width="100"> </td>
<td> </td>
</tr>
<tr>
<td colspan="2" align="center"><input name="save" type="submit" class="box" id="save" value="Save Article"></td>
</tr>
</table>
</form>
</body>
</html>عاوز اعرف ليه الخطا ده بيظهر وايه الحل علما بانى لسه مبدا فى البى اتش بى
راسلونى هنا themuslim0@yahoo.com