Dear all; i made page to write text on image but my problem is: 1.want to rename the name the new image (text on image) 2.want to insert this image into mysql database this is the code create the image error_reporting(E_STRICT); $image=$_POST['background_name']; $text=$_POST['text']; $font=$_POST['font_name']; $color=$_POST['text_color']; $align=$_POST['text_alignment']; $im = @imagecreatefromjpeg($image); $width = imagesx($im); $height = imagesy($im); if($color==red) { $color = imagecolorallocate($im, 255, 0, 0); } else if($color==black) { $color = ImageColorAllocate($im, 0, 0, 0); } imagettftext($im, 20, 0, 100, 200, $color, $font, $text); imagejpeg($im,"",100); imagedestroy($im); PHP: please help i wanna to know how to rename and save this image thank you
the second parameter of this function: imagejpeg($im,"",100) is the path and filename of the image you are creating. So if you want to save the image as "image1.jpg" in folder "pictures" you will write: imagejpeg($im,"pictures/image1.jpg",100);
Be very careful with the path of the location you are trying to save to. Also make sure that PHP has writing rights for that folder. Could you show us the code with the path and filename?
And what error does it gives you? (this link: http://www.mysite.com/image.php goes nowhere so i guess it's just an example...)
it gives me the link of the page and when i delete this $path , the image appear normaly i donot know why didnot work but of course there are another way to save the image i want also to rename the image and save it on the database