![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 2 Pomógł: 0 Dołączył: 18.09.2010 Ostrzeżenie: (0%) ![]() ![]() |
Witam próbuje w php zrobić iż jeśli nacisnę na buttona to do linka href doda +1 Podam przykład by to lepiej za obrazować...
<?php $n = $_GET['nr'] +1; if ($_GET['nr'] == 1 || $_GET['nr'] == 12 ) echo '<form action="" method="POST"> <input type="image" name="next" class="but1" class="submit" /></div> </form>'; else { echo '<form action="" method="POST"> <input type="image" name="next" alt="n" class="but1" class="submit" /></div> </form> <form action="" method="POST"> <input type="image" name="back" alt="n" class="but2" class="submit" /></div> </form> '; } if ($_POST['next']) { I teraz problem jak wrzucić ten $n do hrefa powiedzmy że mam index.php?nr=1, a po naciśnięciu na button uzyskał w linku index.php?nr=2 i tak dalej... Zastanawiam się jak to wykonać... jakieś pomysły (IMG:style_emoticons/default/questionmark.gif) ? |
|
|
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 471 Pomógł: 89 Dołączył: 29.07.2008 Skąd: Warszawa Ostrzeżenie: (0%) ![]() ![]() |
|
|
|
![]()
Post
#3
|
|
Grupa: Zarejestrowani Postów: 2 Pomógł: 0 Dołączył: 18.09.2010 Ostrzeżenie: (0%) ![]() ![]() |
Sorki za temat bo to było banalnie proste .... wystarczy w form action podać co ma robić...
<?php $n = $_GET['nr'] +1; $b = $_GET['nr'] -1; if ($_GET['nr'] == 1 || $_GET['nr'] == 12 ) echo '<form action="index.php?nr=' .$n. '" method="POST"> <input type="image" name="next" alt="n" class="but1" class="submit" /></div> </form>'; else { echo '<form action="index.php?nr=' .$n. '" method="POST"> <input type="image" name="next" alt="n" class="but1" class="submit" /></div> </form> <form action="index.php?nr=' .$b. '" method="POST"> <input type="image" name="back" alt="n" class="but2" class="submit" /></div> </form> '; } ?> Proszę o zablokowanie tematu. Ten post edytował goransol 18.09.2010, 17:04:14 |
|
|
![]() ![]() |
![]() |
Aktualny czas: 27.08.2025 - 01:57 |