Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php][html] Problem z formularzem...
PanDrut
post 14.03.2010, 20:18:44
Post #1





Grupa: Zarejestrowani
Postów: 5
Pomógł: 0
Dołączył: 14.03.2010

Ostrzeżenie: (0%)
-----


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

Ten post edytował PanDrut 14.03.2010, 20:20:43
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 3)
mike
post 14.03.2010, 20:21:20
Post #2





Grupa: Przyjaciele php.pl
Postów: 7 494
Pomógł: 302
Dołączył: 31.03.2004

Ostrzeżenie: (0%)
-----


A może nas oświecisz jaki błąd wyświetla?
Go to the top of the page
+Quote Post
PanDrut
post 14.03.2010, 20:24:59
Post #3





Grupa: Zarejestrowani
Postów: 5
Pomógł: 0
Dołączył: 14.03.2010

Ostrzeżenie: (0%)
-----


Proszę:
"Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in C:\Program Files\WebServ1\httpd-users\php\test.php on line 12"

Ten post edytował PanDrut 14.03.2010, 20:25:51
Go to the top of the page
+Quote Post
mike
post 14.03.2010, 21:02:17
Post #4





Grupa: Przyjaciele php.pl
Postów: 7 494
Pomógł: 302
Dołączył: 31.03.2004

Ostrzeżenie: (0%)
-----


Źle łączysz stringi. Obejrzyj dokładnie linię 12.
Zerknij tu: strings oraz String Operators.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 13.07.2025 - 15:19