Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Prosty Formularz PHP, POMOC
monter23
post
Post #1





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 18.02.2009

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


  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
Powód edycji: [erix] nad treścią posta masz pewne przyciski. Przeczytaj przyklejony wątek w tym dziale.
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 3)
skw
post
Post #2





Grupa: Zarejestrowani
Postów: 36
Pomógł: 0
Dołączył: 14.11.2008

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


Nie wiem czy o to chodzi, ale wszystkie cudzyslowia (") w echo musza byc poprzedzone tym znakiem: \
Go to the top of the page
+Quote Post
decha-design
post
Post #3





Grupa: Zarejestrowani
Postów: 415
Pomógł: 46
Dołączył: 26.05.2007
Skąd: Sandomierz

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


@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ż?

Ten post edytował decha-design 18.02.2009, 19:13:54
Go to the top of the page
+Quote Post
monter23
post
Post #4





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 18.02.2009

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


decha-design dziękuje bardzo

przepraszam za takie wstawienie mało estetyczne ale jestem nowy i nie wiedziałem zbytnio
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 22.08.2025 - 21:55