Devils666 Posted March 16, 2010 Report Share Posted March 16, 2010 (edited) Atceros kādreiz man bija tāds kods, ar kuru varēju bildi pārādīt ar headeri Ideja tāda: ielikt bildi php failā: bilde.php un pēctam to pārādit, apmēram šādi: <img src="bilde.php"> googlei prasiju, bet nu iekš manuāļiem nesanaca, vai ari vienkārši nesapratu tatad, kāds varētu, lūdzu pateikt, kā to izdarīt? :) Edited March 16, 2010 by Devils666 Quote Link to comment Share on other sites More sharing options...
waplet Posted March 16, 2010 Report Share Posted March 16, 2010 header('Content-Type: image/jpeg'); Quote Link to comment Share on other sites More sharing options...
Devils666 Posted March 16, 2010 Author Report Share Posted March 16, 2010 (edited) tik talu jau skaidrs, bet pats kods, kā to izdarīt Edited March 16, 2010 by Devils666 Quote Link to comment Share on other sites More sharing options...
briedis Posted March 16, 2010 Report Share Posted March 16, 2010 Atceros kādreiz man bija tāds kods, ar kuru varēju bildi pārādīt ar headeri Ideja tāda: ielikt bildi php failā: bilde.php un pēctam to pārādit, apmēram šādi: <img src="bilde.php"> googlei prasiju, bet nu iekš manuāļiem nesanaca, vai ari vienkārši nesapratu tatad, kāds varētu, lūdzu pateikt, kā to izdarīt? :) Ko nu stāsti, ka manuālī nav :) http://us3.php.net/manual/en/function.imagejpeg.php Pats pirmais paraugs! Quote Link to comment Share on other sites More sharing options...
Devils666 Posted March 16, 2010 Author Report Share Posted March 16, 2010 (edited) <?php // Create a blank image and add some text $im = imagecreatetruecolor(120, 20); $text_color = imagecolorallocate($im, 233, 14, 91); imagestring($im, 1, 5, 5, 'A Simple Text String', $text_color); // Set the content type header - in this case image/jpeg header('Content-type: image/jpeg'); // Output the image imagejpeg($im); // Free up memory imagedestroy($im); ?> viņš jau vairak textam domāts un kā es varu iekļaut kādu bildi, piemēram, bilde.jpg Edited March 16, 2010 by Devils666 Quote Link to comment Share on other sites More sharing options...
briedis Posted March 16, 2010 Report Share Posted March 16, 2010 <?php // Create a blank image and add some text $im = imagecreatetruecolor(120, 20); $text_color = imagecolorallocate($im, 233, 14, 91); imagestring($im, 1, 5, 5, 'A Simple Text String', $text_color); // Set the content type header - in this case image/jpeg header('Content-type: image/jpeg'); // Output the image imagejpeg($im); // Free up memory imagedestroy($im); ?> viņš jau vairak textam domāts un kā es varu iekļaut kādu bildi, piemēram, bilde.jpg Skaties tur funkciju sarakstu... karoč, cītīgi brauc visam manuālim cauri un lasi komentārus !!! Quote Link to comment Share on other sites More sharing options...
Devils666 Posted March 16, 2010 Author Report Share Posted March 16, 2010 (edited) nu, es jau to daru, tikai nu es jau nesaprotu to vienkāršako, bet tas funkcijas aiziet aiz vien sarežģītakas :D bet nu sapratu, iekš yahoo meklejot atradu Edited March 16, 2010 by Devils666 Quote Link to comment Share on other sites More sharing options...
2easy Posted March 17, 2010 Report Share Posted March 17, 2010 šādi? header('Content-Type: image/jpeg'); readfile('bilde.jpg'); Quote Link to comment Share on other sites More sharing options...
anonīms Posted March 17, 2010 Report Share Posted March 17, 2010 nezinu vai "vieglā" variants iet, bet, kur problēma ielikt background bildi un nelikt vnk stringus? http://php.lv/f/topic/15706-nezin-ar-ko-sakt/ Quote Link to comment Share on other sites More sharing options...
mounkuls Posted March 17, 2010 Report Share Posted March 17, 2010 (edited) Derētu zināt iemeslu kāpēc to vajag, ja tā būs parasta bilde. Parasti to vajag visādiem captcha vai statistiku ja grib izmantot. Savādāk jēgu neredzu tam īsti. Jēga varētu būt ja ir <img src="bilde.php?image=img_id"/> EDIT: Vispār jēga varētu būt gan, ja čeko kādus cepumus un atkarībā no tā atdod to vai citu bildi. Tad 2easy variants ir tieši laikā. Edited March 17, 2010 by mounkuls Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.