Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP] Zapisywanie zmiennych w polach
Komarek
post
Post #1





Grupa: Zarejestrowani
Postów: 114
Pomógł: 0
Dołączył: 18.12.2009

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


Witam

chcialbym sie dowiedziec jak w php zrobic by po przeslaniu formularza, pola ktore uzupelnilismy byly uzupelnione a nie czyszczone (IMG:style_emoticons/default/smile.gif)

Pozdrawiam (IMG:style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post
nospor
post
Post #2





Grupa: Moderatorzy
Postów: 36 561
Pomógł: 6315
Dołączył: 27.12.2004




  1. echo '<input type="text" name="test" value="'.$_POST['test'].'" />';

oczywiscie nalezy sprawdzic czy 4 post jest index test itp. podalem ci tu uproszczenie tylko
Go to the top of the page
+Quote Post
Komarek
post
Post #3





Grupa: Zarejestrowani
Postów: 114
Pomógł: 0
Dołączył: 18.12.2009

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


hmmm a takie skromne pytanko nr2.

czemu to nie dziala?

  1. <html>....
  2. <input type="text" name="imie" value="<?php $_POST['imie'] ?>" />
  3. ...
  4. </html>


?

Ten post edytował Komarek 13.01.2010, 13:18:08
Go to the top of the page
+Quote Post
nospor
post
Post #4





Grupa: Moderatorzy
Postów: 36 561
Pomógł: 6315
Dołączył: 27.12.2004




<?php echo $_POST['imie'] ?>
Go to the top of the page
+Quote Post
sadistic_son
post
Post #5





Grupa: Zarejestrowani
Postów: 1 495
Pomógł: 245
Dołączył: 1.07.2009
Skąd: Bydgoszcz

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


A dokładniej to: <?php echo $_POST['imie']; ?>

Ten post edytował sadistic_son 13.01.2010, 13:46:42
Go to the top of the page
+Quote Post
nospor
post
Post #6





Grupa: Moderatorzy
Postów: 36 561
Pomógł: 6315
Dołączył: 27.12.2004




a dokladniej to przeczytaj dokumentacje php i doczytaj w niej czy w ostatniej linijce potrzebny jest srednik (IMG:style_emoticons/default/tongue.gif)
Go to the top of the page
+Quote Post
celbarowicz
post
Post #7





Grupa: Zarejestrowani
Postów: 253
Pomógł: 31
Dołączył: 30.03.2009
Skąd: Szczecin

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


masz na tacy skromne_pytanko.php
[html][/html][php][/php]
<html>
<form method="post" action="skromne_pytanko.php">
<?php session_start(); if(!isset($_SESSION['imie'])){$_SESSION['imie']='ADAM und EWA';}else{ $_SESSION['imie']=$_POST['imie']; } ?>
PODAJ IMIĘ:<input type="text" name="imie" value="" >
<br>
Wpisano IMIĘ:<input type="text" name="imiewpisane" value="<?php echo $_SESSION['imie'] ; ?>" >

<br>
<input type="submit" VALUE="DALEJ">
</form>
<?php
//jak przejdziesz do innego pliku uruchom sesje wykanaj: $_SESSION['imie']=$_POST['imie'] JEŚLI UŻYŁEŚ METODY POST i po powrocie będzie OK
?>
</html>

odezwij się czy działa

Go to the top of the page
+Quote Post
Komarek
post
Post #8





Grupa: Zarejestrowani
Postów: 114
Pomógł: 0
Dołączył: 18.12.2009

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


racja, zapomnialem echo, dziekuje (IMG:style_emoticons/default/haha.gif)

btw celbarowicz nie interesuje mnie wykorzystanie sesji (IMG:style_emoticons/default/winksmiley.jpg)
Go to the top of the page
+Quote Post
celbarowicz
post
Post #9





Grupa: Zarejestrowani
Postów: 253
Pomógł: 31
Dołączył: 30.03.2009
Skąd: Szczecin

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


to sesje zmień na post lub get czyli tak ja method
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: 26.12.2025 - 12:06