Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL][PHP]Problem z przekazywaniem danych miedzy stronami
imashjan82
post
Post #1





Grupa: Zarejestrowani
Postów: 71
Pomógł: 2
Dołączył: 2.12.2009

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


  1. if (empty($_GET['go'])) {
  2. print"<p>teks</p><br />";}
  3. if ($link = $_GET['go']){
  4. $q = mysql_query("select * from contect where link='".$link."'");
  5. while ($r = mysql_fetch_assoc($q)) {
  6. $tytul = $r['tytul'];
  7. $text = $r['text'];
  8. $short_text = $r['short_text'];
  9. print"<h3>".$tytul."</h3><br />";
  10. print"<i>".$short_text."</i>";
  11. print"".$text."";
  12.  
  13. $name = $_GET['name']; // tak nie wysyła
  14. $_SESSION['a'] = $name; //

I teraz co mam zrobić żeby dane z formularza były odbierane w kolejnym pliku, i dodawane do bazy danych. Formularz wysyła dane już do pliku register.php a o to i on

  1.  
  2. if ($dodaj){
  3. $name = htmlspecialchars($_SESSION['name']);
  4. $cos = htmlspecialchars($_SESSION['cos']);
  5.  
  6. $dodaj = mysql_query("INSERT INTO users SET name=".$_SESSION['name'].",".$_SESSION['cos']."");
  7.  
  8.  


na początku każdej strony mam


Co robie żle?? Wersia php to 5

za dużo wymagam? czy pytanie jest bez sesnu??
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
imashjan82
post
Post #2





Grupa: Zarejestrowani
Postów: 71
Pomógł: 2
Dołączył: 2.12.2009

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


  1. <form action="register.php" method="post">
  2. <b>Account Information</b><br />
  3. name : <input type="text" name="name" value=""/> username : <input type="text" name="surname" value=""/><br />
  4. e-mail : <input type="text" name="email" /> e-mail 2 : <input type="text" name="email2" /><br />
  5. password : <input type="password" name="password" value="" />
  6. date of birth : <input type="text" name="dob" size="6" maxlength="10" /> 01.01.1970
  7.  
  8. <b>Contact Information</b><br />
  9. Country : <input type="text" name="country"/><br />
  10. City : <input type="text" name="city" /><br />
  11. Street : <input type="text" name="street" /> No.<input type="text" name="number_bud" size="5"/><br />
  12. Province : <input type="text" name="province" /><br />
  13. <input type="checkbox" value="yes" /> <a href="?go=terms-of-agreement">Terms of Agreement</a><br />
  14. <input type="submit" value="REGISTER" />
  15. </form>


adres mam taki
  1. index.php?go=$name
Go to the top of the page
+Quote Post

Posty w temacie


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: 8.10.2025 - 16:46