masrawy Posted February 24, 2009 Author Share Posted February 24, 2009 That will have to be Javascript then, that's a text rotator. Check Google for some examples.http://www.google.com/search?hl=en&cli...amp;btnG=SearchThere's a generator here:http://www.htmlbasix.com/textrotator.shtmli can't do that with code frome tha databasecan you do Link to comment Share on other sites More sharing options...
masrawy Posted February 24, 2009 Author Share Posted February 24, 2009 Enter the url for each link, the text for each link - and click generate!how ? Link to comment Share on other sites More sharing options...
masrawy Posted February 24, 2009 Author Share Posted February 24, 2009 i try many jave scripts but it gives me all the last 10 adv i need one after one sir Link to comment Share on other sites More sharing options...
masrawy Posted February 28, 2009 Author Share Posted February 28, 2009 siri have copy() function of dadt base for upload pic the server stop it for secritary it ther ny function likt copy() and do tha same sunction? Link to comment Share on other sites More sharing options...
justsomeguy Posted March 2, 2009 Share Posted March 2, 2009 If you're processing an uploaded file, you should be using move_uploaded_file.http://www.php.net/manual/en/function.move-uploaded-file.phphttp://www.php.net/manual/en/features.file-upload.php Link to comment Share on other sites More sharing options...
masrawy Posted March 2, 2009 Author Share Posted March 2, 2009 is ther any function =fopen becouse it is also closed Link to comment Share on other sites More sharing options...
masrawy Posted March 2, 2009 Author Share Posted March 2, 2009 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 More sharing options...
justsomeguy Posted March 2, 2009 Share Posted March 2, 2009 That looks fine to me. Link to comment Share on other sites More sharing options...
masrawy Posted March 2, 2009 Author Share Posted March 2, 2009 i did that and the script tell me that the picture was upload but i find (x) and no pici search for function fopen i didn't find it in the index.phpwhat is the problem sir ? Link to comment Share on other sites More sharing options...
justsomeguy Posted March 2, 2009 Share Posted March 2, 2009 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 More sharing options...
masrawy Posted March 2, 2009 Author Share Posted March 2, 2009 $path = "uploads/";$Name = "$RegDate$myname$t$ext";the permissions of uploads folder is 777 Link to comment Share on other sites More sharing options...
justsomeguy Posted March 2, 2009 Share Posted March 2, 2009 Print out the actual value that it's using for the path and name, not just the code for it. Link to comment Share on other sites More sharing options...
masrawy Posted March 2, 2009 Author Share Posted March 2, 2009 you need the index.php or what sir ? Link to comment Share on other sites More sharing options...
masrawy Posted March 2, 2009 Author Share Posted March 2, 2009 $RegDate = date("j_n_Y_");$myname = "HGI_TEL_0020103508210_";$t = rand(0, 9000000000);$ext = ".img"; Link to comment Share on other sites More sharing options...
justsomeguy Posted March 2, 2009 Share Posted March 2, 2009 I mean add this code to the part that saves the file:echo $path . $Name;So you can actually see what name it's trying to save the file with. Link to comment Share on other sites More sharing options...
masrawy Posted March 2, 2009 Author Share Posted March 2, 2009 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 More sharing options...
justsomeguy Posted March 3, 2009 Share Posted March 3, 2009 I don't see where you added the code. Link to comment Share on other sites More sharing options...
masrawy Posted March 3, 2009 Author Share Posted March 3, 2009 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 More sharing options...
justsomeguy Posted March 3, 2009 Share Posted March 3, 2009 Right. It should be printing the filename that it's trying to copy the file to. Link to comment Share on other sites More sharing options...
masrawy Posted March 3, 2009 Author Share Posted March 3, 2009 uploads/3_3_2009_HGI_TEL_0020103508210_376696169.imgthis is the out code sirbut i didn't find the image Link to comment Share on other sites More sharing options...
justsomeguy Posted March 3, 2009 Share Posted March 3, 2009 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 More sharing options...
masrawy Posted March 3, 2009 Author Share Posted March 3, 2009 waitting sir Link to comment Share on other sites More sharing options...
masrawy Posted March 3, 2009 Author Share Posted March 3, 2009 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 More sharing options...
justsomeguy Posted March 3, 2009 Share Posted March 3, 2009 Why do you keep asking about fopen? Are you using fopen somewhere? Link to comment Share on other sites More sharing options...
masrawy Posted March 3, 2009 Author Share Posted March 3, 2009 no but i ask the hosting what function closed he told me fopen Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.