Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP+HTML]Jak wpisać zmienną w cudzysłów ?
grattz
post
Post #1





Grupa: Zarejestrowani
Postów: 138
Pomógł: 0
Dołączył: 29.10.2006
Skąd: BB

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


Jak tutaj:
  1. <input class="login" type="text" name="user" value="......................">

wpisać:
$_POST['user']
Go to the top of the page
+Quote Post
webdice
post
Post #2


Developer


Grupa: Moderatorzy
Postów: 3 045
Pomógł: 290
Dołączył: 20.01.2007




  1. <?php
  2. print '<input class="login" type="text" name="user" value="' . $_POST['user'] . '">'
  3. ?>


O to chodzi?
Go to the top of the page
+Quote Post
mrok
post
Post #3





Grupa: Zarejestrowani
Postów: 258
Pomógł: 17
Dołączył: 22.05.2007

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


albo

  1. <input class="login" type="text" name="user" value="<?=$_POST['cos'] ?>">



(IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg)

edit// upps maly blad sie wkradl

Ten post edytował mrok 13.05.2008, 20:49:37
Go to the top of the page
+Quote Post
grattz
post
Post #4





Grupa: Zarejestrowani
Postów: 138
Pomógł: 0
Dołączył: 29.10.2006
Skąd: BB

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


Tak. Super (IMG:http://forum.php.pl/style_emoticons/default/guitar.gif)
A czemu dałeś "print" ?

Bo ja jak mieszam kod HTML i PHP to mam tak np. :
  1. <?php
  2. if (!isset($_POST['haslo']) && !isset($_POST['user'])) 
  3. {
  4. echo ('
  5. ...
  6. Login:<input class="login" type="text" name="user" value="' . $_POST['user'] . '">
  7.  
  8. ...
  9.  ');
  10.  
  11. ?>


Zle ?

Ten post edytował grattz 13.05.2008, 20:51:04
Go to the top of the page
+Quote Post
bemol
post
Post #5





Grupa: Zarejestrowani
Postów: 286
Pomógł: 29
Dołączył: 5.04.2007
Skąd: Rymanów Zdrój/Rzeszów

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


print(),echo
poczytaj, różnica nie wielka, nie ma to tutaj znaczenia (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

to co napisałeś przedstawia się tak:

jeśli nie istnieje hasło i nie istnieje login

to wyswietl input z przesłanym loginem...

troszke bez sensu, bo najpierw napisałeś 'jeśli nie istnieje' (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

Ten post edytował bemol 13.05.2008, 20:56:21
Go to the top of the page
+Quote Post
webdice
post
Post #6


Developer


Grupa: Moderatorzy
Postów: 3 045
Pomógł: 290
Dołączył: 20.01.2007




Poczytaj sobie o print" title="Zobacz w manualu PHP" target="_manual oraz echo" title="Zobacz w manualu PHP" target="_manual. W tym wypadku nie ma to żadnego znaczenia.
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: 7.10.2025 - 14:32