05-11-2004, 16:55
|
|
|
חבר מתאריך: 26.10.04
הודעות: 19
|
|
עזרה עם תמונות ומספרים
יש לי את הקוד הבא:
קוד PHP:
<? header("Content-type: image/png"); function randimg() { $rand = rand(611111, 699999); $im = @imagecreate(53, 15) or die("Cannot Initialize new GD image stream"); $background_color = imagecolorallocate($im, 255, 255, 255); $text_color = imagecolorallocate($im, 233, 14, 14); $text = imagestring($im, 5, 0, 0, "$rand", $text_color); $ip = imagepng($im); imagedestroy($im); } $randimg = randimg(); echo "<html dir=rtl> <form method=post action=send.php> <input type=hidden name=randh value=<? echo $rand; ?> /> <font face=arial size=2px>שם: <input type=text name=name maxlength=15> <br><br><b>מספר אייסיקיו:</b> <input type=text name=icq maxlength=9> <br><br>גיל: <input type=text name=age maxlength=2> <br><br>אימייל: <input type=text name=mail> <br><br>ספר קצת על עצמך: <textarea name=short rows=2 cols=30></textarea> <br> $randimg <br> כתוב את המספר המופיע למעלה:<br> <input type=text name=rand> <br><br><input type=submit name=submit value=שלח> <INPUT type=reset name=reset value=אפס טופס> </font> </form> </html>"; ?>
הבעיה היא שזה לא יוצר תמונה ושבמקום מספר זה מוציא לי ג'יבריש.
כהעפתי את כל הקוד html זה פעל מצוין אבל ברגע שהכנסתי את הקוד של הטופס עצמו התחילו הבעיות,ניסיתי כבר להפריד בין הhtml לphp,ניסיתי לעשות את הקוד של התמונה הרנדומלית בלי פונקציות,ניסיתי הרבה דברים אבל לא עבד,עבד רק כשהעפתי את הhtml.
אני מניח שהבנתם את הבעיה שלי.
תודה והמשך יום נעים.
|