Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [HTML] Problem z rozwijanym polem wyboru w forularzu
coolthx
post
Post #1





Grupa: Zarejestrowani
Postów: 18
Pomógł: 0
Dołączył: 15.08.2007

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


Witam poniżej przedstawiam kawałek kodu z którym obecnie pracuje do swojej strony
  1. <?php
  2. print '<FORM ACTION="dane.php" METHOD=POST>';
  3.         print '<select NAME="opcja">';
  4.         print '<OPTION SELECTED VALUE="">-&gt; wybierz opi:';
  5.         print '<OPTION VALUE="aaaaa">AAAAAAA';
  6.         print '<OPTION VALUE="bbbbb">BBBBBBBB';
  7.         print '</SELECT>';
  8.         print '<INPUT TYPE="submit" VALUE="Generuj">';
  9.         print '</FORM>';
  10.     print '<BR><A HREF="index.php">Powrót do Menu</A>';
  11. ?>


a więc mój problem polega na tym iż chce zrobić tak że jak wybiore w formularzu opcje "aaaaa" i kliknę na przycisk "Generuj" to otworzy mi się jakaś strona np"index2.php" (IMG:http://forum.php.pl/style_emoticons/default/sad.gif) nie potrafie sobie z tym poradzic (IMG:http://forum.php.pl/style_emoticons/default/sad.gif) jak przypisac do danego pola wyboru link dla kolejnej strony (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) Dziękuje i pozdrawiam (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

Ten post edytował batman 11.09.2008, 09:11:46
Powód edycji: poprawiłem bbcode ~batman
Go to the top of the page
+Quote Post
kefir1989
post
Post #2





Grupa: Zarejestrowani
Postów: 15
Pomógł: 1
Dołączył: 1.11.2007

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


W skrypcie dane.php


CODE

<?php
if($_POST['opcja'] == 'aaaaa'){
header('Location:index2.php');
}else if($_POST['opcja'] == 'bbbbb'){
header('Location:index3.php');
}
?>


Ewentualnie zamiast value typu 'aaaaa' można dać np.index2.php i wtedy

CODE

<?php
$site = $POST['opcja'];
header("Location:$site");
?>


Powinno działać, choć nie sprawdzałem.

Ten post edytował kefir1989 11.09.2008, 09:30:57
Go to the top of the page
+Quote Post
coolthx
post
Post #3





Grupa: Zarejestrowani
Postów: 18
Pomógł: 0
Dołączył: 15.08.2007

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


(IMG:http://forum.php.pl/style_emoticons/default/sad.gif) Sorrki ale nie śmiga u mnie (IMG:http://forum.php.pl/style_emoticons/default/sad.gif) może jakiś inny pomysł (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) bardzo proszę o dalszą pomoc (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) dziękuje (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) pozdrawiam (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
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 - 19:56