Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [php][html] Problem z formularzem...
Forum PHP.pl > Forum > Przedszkole
PanDrut
Witam!

Mam taki problem, chcę zrobić tak że wpisuje na stronie tekst i wybieram sobie obrazek i na tym obrazku pojawia się teskt wpisany na stronie...
Generator obrazków mi działa...

Ale jak wybieram obrazek i wpisuje tekst i klikam wyśli wywala błąd...

Zawartość HTML:
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <style type="text/css">
  5. body {
  6. background: #262626;
  7. }
  8. </head>
  9.  
  10.  
  11. <div id="top">
  12. <img src="images/top.png" alt="Logo" />
  13. </div><!--End top-->
  14.  
  15. <br />
  16. <br />
  17.  
  18. <div id="wyb">
  19. <img src="images/wybierz.png" alt="Wybierz" />
  20. </div><br><br>
  21.  
  22. <form action="test.php" method="GET" />
  23. <b>Wpisz:</b><br>
  24. <input type=text name="test" /><br>
  25. <input type=radio name=wyb value="1" /><img src="images/1.png" alt="test" /><br><br>
  26. <input type=radio name=wyb value="2" /><img src="images/1.png" alt="test" /><br><br>
  27. <input type=radio name=wyb value="3" /><img src="images/1.png" alt="test" /><br><br>
  28. <br />
  29.  
  30. <input type=submit value="Wyślii" />
  31. </form>
  32. </center>
  33. </body>
  34. </html>
  35.  


Zawartość test.php:
  1. <html>
  2. <head>
  3. <title>Wynik</title>
  4. </head>
  5.  
  6. <body>
  7.  
  8. <br>Wybrałes: <?php switch($_GET['sygnatura']) {
  9.  
  10.  
  11. case "1";
  12. echo "<img src='http://localhost/~php/sy.php?nick="$_GET['test']" />";
  13. break;
  14.  
  15. case "2";
  16. echo "COLA<br>";
  17. break;
  18.  
  19. case "3";
  20. echo "SPRINT<br>";
  21. break;
  22.  
  23. case "4";
  24. echo "SPRINT<br>";
  25. break;
  26.  
  27. case "5";
  28. echo "SPRINT<br>";
  29. break;
  30.  
  31.  
  32. }
  33.  
  34. ?>
  35. </body>
  36. </html>

I Generator:
  1. <?php
  2.  
  3. $img_number = imagecreatefrompng('tlo.png');
  4. $textcolor = imagecolorallocate($img_number,255,255,255);
  5.  
  6. Imagestring ($img_number,3,163,15, $_GET['nick'] ,$textcolor);
  7. header("Content-type: image/png");
  8. imagepng($img_number);
  9. ?>
  10.  


Myślę ze coś zrozumieliście wiem, że pokręciłem ale w php dopiero "raczkuje" tongue.gif
mike
A może nas oświecisz jaki błąd wyświetla?
PanDrut
Proszę:
"Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in C:\Program Files\WebServ1\httpd-users\php\test.php on line 12"
mike
Źle łączysz stringi. Obejrzyj dokładnie linię 12.
Zerknij tu: strings oraz String Operators.
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.