Jump to content

Problem Of Sending Email To User


masrawy
 Share

Recommended Posts

  • Replies 304
  • Created
  • Last Reply

Top Posters In This Topic

this is code to upload pic if (!isset($HTTP_POST_FILES['s_photo'])) exit(exit1);if (is_uploaded_file($HTTP_POST_FILES['s_photo']['tmp_name'])) {if ($HTTP_POST_FILES['s_photo']['size']>$max_size) { echo "حجم الملف كبير جدا\n";}if (file_exists($path . $Name)) {echo "اسم الصورة موجود مسبقا يرجي تغيير اسم الصورة وارسالها\n"; exit;}$res = copy($HTTP_POST_FILES['s_photo']['tmp_name'], $path . $Name);if (!$res) { echo "فشل تحميل الصورة<br>\n";}$s_photo=$Name;}if ($s_photo != ""){ $update=mysql_query("UPDATE ssubject SET s_name='$ss_name', s_disc='$s_disc', s_photo='$s_photo', replay='$rep' WHERE id='$hidden'"); if($update){echo "تم التعديل بنجاح";} else {echo "هناك خطأ في عملية التعديل";}}if ($s_photo == ""){ $update=mysql_query("UPDATE ssubject SET s_name='$ss_name', s_disc='$s_disc', replay='$rep' WHERE id='$hidden'"); if($update){echo "تم التعديل بنجاح";} else {echo "هناك خطأ في عملية التعديل";}}echo "<meta http-equiv=\"refresh\" content=\"2; URL=index.php?action=advs&advid=$hidden\">";}is it will be like that if (!isset($HTTP_POST_FILES['s_photo'])) exit(exit1);if (is_uploaded_file($HTTP_POST_FILES['s_photo']['tmp_name'])) {if ($HTTP_POST_FILES['s_photo']['size']>$max_size) { echo "حجم الملف كبير جدا\n";}if (file_exists($path . $Name)) {echo "اسم الصورة موجود مسبقا يرجي تغيير اسم الصورة وارسالها\n"; exit;}$res = move_uploaded_file($HTTP_POST_FILES['s_photo']['tmp_name'], $path . $Name);if (!$res) { echo "فشل تحميل الصورة<br>\n";}$s_photo=$Name;}if ($s_photo != ""){ $update=mysql_query("UPDATE ssubject SET s_name='$ss_name', s_disc='$s_disc', s_photo='$s_photo', replay='$rep' WHERE id='$hidden'"); if($update){echo "تم التعديل بنجاح";} else {echo "هناك خطأ في عملية التعديل";}}if ($s_photo == ""){ $update=mysql_query("UPDATE ssubject SET s_name='$ss_name', s_disc='$s_disc', replay='$rep' WHERE id='$hidden'"); if($update){echo "تم التعديل بنجاح";} else {echo "هناك خطأ في عملية التعديل";}}echo "<meta http-equiv=\"refresh\" content=\"2; URL=index.php?action=advs&advid=$hidden\">";}this code is wright ?yes or no?

Link to comment
Share on other sites

You're trying to move the picture to "$path . $Name", so print that out to see where you're trying to move the picture to. You should probably check the permissions on that folder to make sure you're allowed to copy files to it.

Link to comment
Share on other sites

i did if (!isset($HTTP_POST_FILES['s_photo'])) exit(exit1);if (is_uploaded_file($HTTP_POST_FILES['s_photo']['tmp_name'])) {if ($HTTP_POST_FILES['s_photo']['size']>$max_size) { echo "حجم الملف كبير جدا\n";}if (file_exists($path . $Name)) {echo "اسم الصورة موجود مسبقا يرجي تغيير اسم الصورة وارسالها\n"; exit;}$res = move_uploaded_file($HTTP_POST_FILES['s_photo']['tmp_name'], $path . $Name);if (!$res) { echo "فشل تحميل الصورة<br>\n";}$s_photo=$Name;}if ($s_photo != ""){$update=mysql_query("UPDATE ssubject SET s_name='$ss_name', s_disc='$s_disc', s_photo='$s_photo', replay='$rep' WHERE id='$hidden'");if($update){echo "تم التعديل بنجاح";} else {echo "هناك خطأ في عملية التعديل";}}if ($s_photo == ""){$update=mysql_query("UPDATE ssubject SET s_name='$ss_name', s_disc='$s_disc', replay='$rep' WHERE id='$hidden'");if($update){echo "تم التعديل بنجاح";} else {echo "هناك خطأ في عملية التعديل";}}echo "<meta http-equiv=\"refresh\" content=\"2; URL=index.php?action=advs&advid=$hidden\">";}but no pic uploaded sir is ther any reasone for that

Link to comment
Share on other sites

if (!isset($HTTP_POST_FILES['s_photo'])) exit(exit1);if (is_uploaded_file($HTTP_POST_FILES['s_photo']['tmp_name'])) {if ($HTTP_POST_FILES['s_photo']['size']>$max_size) { echo "حجم الملف كبير جدا\n";}if (file_exists($path . $Name)) {echo "اسم الصورة موجود مسبقا يرجي تغيير اسم الصورة وارسالها\n"; exit;}$res = move_uploaded_file($HTTP_POST_FILES['s_photo']['tmp_name'], $path . $Name);echo $path . $Name;if (!$res) { echo "فشل تحميل الصورة<br>\n";}$s_photo=$Name;}if ($s_photo != ""){$update=mysql_query("UPDATE ssubject SET s_name='$ss_name', s_disc='$s_disc', s_photo='$s_photo', replay='$rep' WHERE id='$hidden'");if($update){echo "تم التعديل بنجاح";} else {echo "هناك خطأ في عملية التعديل";}}if ($s_photo == ""){$update=mysql_query("UPDATE ssubject SET s_name='$ss_name', s_disc='$s_disc', replay='$rep' WHERE id='$hidden'");if($update){echo "تم التعديل بنجاح";} else {echo "هناك خطأ في عملية التعديل";}}echo "<meta http-equiv=\"refresh\" content=\"2; URL=index.php?action=advs&advid=$hidden\">";}like that ?

Link to comment
Share on other sites

First, everywhere you see $HTTP_POST_FILES, change it to $_FILES. The $HTTP_POST vars are old and have been deprecated. This code is not doing any error checking on the uploaded file. There could be an error happening and you wouldn't know what it is (which might be the problem here). Add this near the top of the page:print_r($_FILES);

Link to comment
Share on other sites

i did that <?print_r($_FILES); include("system/config.php");now i see in the top of the page this Array ()i try to upload pictre ths what i see Array ( [s_photo] => Array ( [name] => 140x80-20090221-213043.gif [type] => image/gif [tmp_name] => /tmp/phpQ4Zk6F [error] => 0 => 23939 ) ) do the function fopen can make this error ?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share


×
×
  • Create New...