greg Posted October 8, 2006 Share Posted October 8, 2006 Hello,In this form, how can I go to the same page number when the results are more than one page?ThanksGreg[CODE]<form name="eachrow" action="visitors.php?listing=id-desc&page=" method="POST"> <input type="hidden" value="<?=$visitors['browser_id']?>" name="DeleteOneRow"> <td class="VisitorTableContent" align="center" valign="top"> <input type="submit" value="delete"> </form>[/CODE] Link to comment https://forums.phpfreaks.com/topic/23356-redirect-to-same-page/ Share on other sites More sharing options...
redarrow Posted October 8, 2006 Share Posted October 8, 2006 dont get it mate sorry. Link to comment https://forums.phpfreaks.com/topic/23356-redirect-to-same-page/#findComment-105858 Share on other sites More sharing options...
shiny_spoon Posted October 8, 2006 Share Posted October 8, 2006 Couldn't you simply spit out the page number in the form's action?Like so:[code]<?php $page = $_GET['page']; /* Or $_SESSION['page']? Whatever you are using... */ ?><form name="eachrow" action="visitors.php?listing=id-desc&page=<?php echo $page; ?>" method="POST"> <input type="hidden" value="<?php echo $visitors['browser_id']; ?>" name="DeleteOneRow"> <td class="VisitorTableContent" align="center" valign="top"> <input type="submit" value="delete"></form>[/code] Link to comment https://forums.phpfreaks.com/topic/23356-redirect-to-same-page/#findComment-105912 Share on other sites More sharing options...
daiwa Posted October 8, 2006 Share Posted October 8, 2006 Not to be the security police but i think its important that when giving out advice we take the habbit to include the nessesary security precautions one must take while doing this: in this case we need to use htmlspecialchars() to make sure we protect ourselves against XSS attacks. (of course if your browser id comes from a user input you'd need to do the same)[code]<?php $page = $_GET['page']; /* Or $_SESSION['page']? Whatever you are using... */ ?>[color=red]$page = htmlspecialchars($page);[/color]<form name="eachrow" action="visitors.php?listing=id-desc&page=<?php echo $page; ?>" method="POST"> <input type="hidden" value="<?php echo $visitors['browser_id']; ?>" name="DeleteOneRow"> <td class="VisitorTableContent" align="center" valign="top"> <input type="submit" value="delete"></form>[/code] Link to comment https://forums.phpfreaks.com/topic/23356-redirect-to-same-page/#findComment-105953 Share on other sites More sharing options...
shiny_spoon Posted October 8, 2006 Share Posted October 8, 2006 [quote author=daiwa link=topic=110882.msg448960#msg448960 date=1160333441]Not to be the security police but i think its important that when giving out advice we take the habbit to include the nessesary security precautions one must take while doing this: in this case we need to use htmlspecialchars() to make sure we protect ourselves against XSS attacks. (of course if your browser id comes from a user input you'd need to do the same)[code]<?php $page = $_GET['page']; /* Or $_SESSION['page']? Whatever you are using... */ ?>[color=red]$page = htmlspecialchars($page);[/color]<form name="eachrow" action="visitors.php?listing=id-desc&page=<?php echo $page; ?>" method="POST"> <input type="hidden" value="<?php echo $visitors['browser_id']; ?>" name="DeleteOneRow"> <td class="VisitorTableContent" align="center" valign="top"> <input type="submit" value="delete"></form>[/code][/quote]You're absolutely right. :) My bad on that! Link to comment https://forums.phpfreaks.com/topic/23356-redirect-to-same-page/#findComment-105981 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.