Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Prosty Formularz PHP
Forum PHP.pl > Forum > Przedszkole
monter23
  1. <html>
  2. <head>
  3. <title>formularz <title>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2"><head>
  5. <body bgcolor="#0000FF">
  6. <center>
  7. <font face="Time New Roman, Helvetica, sans-serif" size="4" color="white">
  8. <?
  9. $tekst=$_GET["tekst"];
  10. $tekst2=$_GET["tekst2"];
  11. $tekst3=$_GET["tekst3"];
  12. if ($tekst!=NULL)
  13. {
  14. echo 'Witaj '.$tekst.',miło Cię poznać<br>Fajnie, że mieszkasz w mieście '.$tekst2.'<br> ,Miło że masz '.$tekst3.' humor;
  15. }
  16. else
  17. {
  18. echo '<form action="'.$_SERVER['PHP_SELF'].'" method="get">
  19. Podaj imi&#281;<br><input type="text" name="tekst"><br>
  20. Podaj miasto<br><input type="text" name="tekst2"><br>
  21. Podaj humor<br><input type="text" name="tekst3"><br>
  22. <input type="submit" value="kliknij">
  23. <form>;
  24. }
  25. ?>
  26. <center>
  27. <font>
  28. <html>


pojawia się w krasnalu błąd Parse error: parse error, expecting `','' or `';'' in on line [b]18

nie mam pojęcia co źle zrobiłem. Formularz ma pytać o imię miasto i humor
skw
Nie wiem czy o to chodzi, ale wszystkie cudzyslowia (") w echo musza byc poprzedzone tym znakiem: \
decha-design
@skw ... nie o to chodzi ... poczytaj o rożnicy pomiędzy echo 'tekst'; a echo "tekst";

@monter23 ... zapomniałeś apostrofu na koncu jednego wiersza. I używaj BBCODE!

  1. <html>
  2. <head>
  3. <title>formularz <title>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2"><head>
  5. <body bgcolor="#0000FF">
  6. <center>
  7. <font face="Time New Roman, Helvetica, sans-serif" size="4" color="white">
  8. <?
  9. $tekst=$_GET["tekst"];
  10. $tekst2=$_GET["tekst2"];
  11. $tekst3=$_GET["tekst3"];
  12. if ($tekst!=NULL)
  13. {
  14. echo 'Witaj '.$tekst.',miło Cię poznać<br>Fajnie, że mieszkasz w mieście '.$tekst2.'<br> ,Miło że masz '.$tekst3.' humor';
  15. }
  16. else
  17. {
  18. echo '<form action="'.$_SERVER['PHP_SELF'].'" method="get">
  19. Podaj imię<br><input type="text" name="tekst"><br>
  20. Podaj miasto<br><input type="text" name="tekst2"><br>
  21. Podaj humor<br><input type="text" name="tekst3"><br>
  22. <input type="submit" value="kliknij">
  23. <form>';
  24. }
  25. ?>
  26. <center>
  27. <font>
  28. <html>
Od razu ładniej, nieprawdaż?
monter23
decha-design dziękuje bardzo

przepraszam za takie wstawienie mało estetyczne ale jestem nowy i nie wiedziałem zbytnio
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.