hello,
until this morning my website was working locally on my computer and there was no errors but when i uploaded it it went crazy
i managed to solve the html\css problems but i couldn't solve the php problems
well the site has a large form so i will put the part a part here and will give you a link to the page
i removed useless commented lines in the script and un used portionsCode:<td colspan="2" class="labelcell"><label>الصور (إن وجدت) </label></td> <td colspan="2" class="fieldcell"><input name="ufile" type="file" id="ufile" size="50" /></td>
and the errors appeared after using the formPHP Code:<?php
// ADDING RANDOM 4 DIGIT NUMBER TO FILE NAME
// Your file name you are uploading
$file_name = $HTTP_POST_FILES['ufile']['name'];
// random 4 digit to add to our file name
// some people use date and time in stead of random digit
$random_digit=rand(0000,9999);
//combine random digit to you file name to create new file name
//use dot (.) to combile these two variables
$new_file_name=$random_digit.$file_name;
$newfilename = str_replace( ' ', '', $new_file_name);
//rename($new_file_name, str_replace( ' ', '', $new_file_name));
//set where you want to store files
//in this example we keep file in folder upload
//$new_file_name = new upload file name
//for example upload file name cartoon.gif . $path will be upload/cartoon.gif
$path= "upload/".$new_file_name;
//if($ufile !=none)
if(!$ufile)
{
if(copy($HTTP_POST_FILES['ufile']['tmp_name'], $path))
{
// ADDING RANDOM 4 DIGIT NUMBER TO FILE NAME END
//echo "Successful<BR/>"; //FILE UPLOAD SUCCESSFULLY
//********************************************************
//RENAMING UPLOADED FILE
rename("upload/".$new_file_name, "upload/".$newfilename );
$path= "upload/".$newfilename;
//RENAMING UPLOADED FILE END
}
else
{
//echo "<p>";
//echo "file upload error";
//echo "<br/ >";
//echo "</p>";
}
}
//***********************************//
//INSERTING DATA IN DATABASE
$con=mysql_connect("IP ADDRESS","USERNAME","PASSWORD");
if (!$con)
{
die ('Could not connect' . mysql_error());
}
mysql_select_db("amaar",$con);
mysql_real_escape_string($sql);
$sql="insert into ads (name, telephone, mobile, email, type, city, district, address, area, floors, advs, finishing, image)
values
('$_POST[name]','$_POST[telephone]','$_POST[mobile]','$_POST[email]','$_POST[type]','$_POST[city]','$_POST[district]','$_POST[address]',
'$_POST[area]','$_POST[floors]','$_POST[advs]','$_POST[finishing]','$path')";
if(!mysql_query($sql,$con))
{
die('error'. mysql_error());
}
//echo "<p>";
echo "شكرا "."<br>"."لقد تم إرسال البيانات لإدارة الموقع"."<br>";
//echo "</p>";
//INSERTING DATA TO DATABASE END
//closing database connection
if (!$con)
{
}
else
{
mysql_close($con);
}
//closing database connection END
?>
i do not know what happened but i wish i can find a solution
Notice: Undefined variable: ufile in d:\domains\elamaar.com\wwwroot\test\forum_add_done.php on line 61
Warning: mysql_connect() [function.mysql-connect]: Host '67.15.68.40' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' in d:\domains\elamaar.com\wwwroot\test\forum_add_done.php on line 97
Could not connectHost '67.15.68.40' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts
any help is really appreciated






Bookmarks