mikeleblanc Posted December 3, 2008 Share Posted December 3, 2008 hi below is the format of my html, table1............... table2.............. table3.............. table4.-............ href button My question is whe my user clicks on href the php page is updates but i would like the view position to be in table4 not on top table1. How do I do this? Thanks, Link to comment https://forums.phpfreaks.com/topic/135279-way-to-position-view-after-page-refresh/ Share on other sites More sharing options...
haku Posted December 3, 2008 Share Posted December 3, 2008 Do you mean that you want the viewing window of the browser to go directly to table 4? You can do this by giving the table a name value (name="table4"), then add #table4 onto the end of the link (<a href="page.html#table4">). Link to comment https://forums.phpfreaks.com/topic/135279-way-to-position-view-after-page-refresh/#findComment-704604 Share on other sites More sharing options...
chmpdog Posted December 3, 2008 Share Posted December 3, 2008 Not sure what your saying, please us correct grammar... Link to comment https://forums.phpfreaks.com/topic/135279-way-to-position-view-after-page-refresh/#findComment-704610 Share on other sites More sharing options...
balistic Posted December 3, 2008 Share Posted December 3, 2008 the way haku mentioned is the easiest way, however you could always use a switch. Link to comment https://forums.phpfreaks.com/topic/135279-way-to-position-view-after-page-refresh/#findComment-704611 Share on other sites More sharing options...
mikeleblanc Posted December 3, 2008 Author Share Posted December 3, 2008 so is this correct? <td><a href="<?php print("$thispage?rowNumber=".$previous);?>"#suggestion>Previous</a></td> Link to comment https://forums.phpfreaks.com/topic/135279-way-to-position-view-after-page-refresh/#findComment-704628 Share on other sites More sharing options...
dclamp Posted December 3, 2008 Share Posted December 3, 2008 That code will work. But it is best if you use echo, not print. Link to comment https://forums.phpfreaks.com/topic/135279-way-to-position-view-after-page-refresh/#findComment-704630 Share on other sites More sharing options...
mikeleblanc Posted December 3, 2008 Author Share Posted December 3, 2008 Below did not work? Any ideas please? <td><a href="<?php print("$thispage?rowNumber=".$previous);?>"#suggestion>Previous</a></td> Link to comment https://forums.phpfreaks.com/topic/135279-way-to-position-view-after-page-refresh/#findComment-704635 Share on other sites More sharing options...
dclamp Posted December 3, 2008 Share Posted December 3, 2008 Well since we dont have telepathic powers, why dont you post your code? Link to comment https://forums.phpfreaks.com/topic/135279-way-to-position-view-after-page-refresh/#findComment-704641 Share on other sites More sharing options...
mikeleblanc Posted December 3, 2008 Author Share Posted December 3, 2008 got it, this one works instead <td><a href="<?php print("$thispage?rowNumber=".$previous."#suggestion");?>">Previous</a></td> Link to comment https://forums.phpfreaks.com/topic/135279-way-to-position-view-after-page-refresh/#findComment-704652 Share on other sites More sharing options...
corbin Posted December 3, 2008 Share Posted December 3, 2008 Below did not work? Any ideas please? <td><a href="<?php print("$thispage?rowNumber=".$previous);?>"#suggestion>Previous</a></td> In case you don't know what was wrong, the #suggestion was outside of the href="" tag. Link to comment https://forums.phpfreaks.com/topic/135279-way-to-position-view-after-page-refresh/#findComment-704656 Share on other sites More sharing options...
dclamp Posted December 3, 2008 Share Posted December 3, 2008 Below did not work? Any ideas please? <td><a href="<?php print("$thispage?rowNumber=".$previous);?>"#suggestion>Previous</a></td> In case you don't know what was wrong, the #suggestion was outside of the href="" tag. ah I didnt notice that the first time. Should be using php tags as well as cleaner code. Link to comment https://forums.phpfreaks.com/topic/135279-way-to-position-view-after-page-refresh/#findComment-704658 Share on other sites More sharing options...
mikeleblanc Posted December 3, 2008 Author Share Posted December 3, 2008 What's the PHP tag alternative? Link to comment https://forums.phpfreaks.com/topic/135279-way-to-position-view-after-page-refresh/#findComment-704663 Share on other sites More sharing options...
mikeleblanc Posted December 3, 2008 Author Share Posted December 3, 2008 And do you make that code cleaner? Link to comment https://forums.phpfreaks.com/topic/135279-way-to-position-view-after-page-refresh/#findComment-704665 Share on other sites More sharing options...
corbin Posted December 3, 2008 Share Posted December 3, 2008 I think he meant php tags on the forum. [ php ] [/ php] or [ code ] [/ code] (no spaces) Although, maybe that's not what he meant. I don't usually put short code in php or code tags. Link to comment https://forums.phpfreaks.com/topic/135279-way-to-position-view-after-page-refresh/#findComment-704666 Share on other sites More sharing options...
dclamp Posted December 3, 2008 Share Posted December 3, 2008 the php tags are [ php] your code [/code] ?> <td> <a href="<?php echo $thispage; ?>?rowNumber=<?php echo $previous; ?>#suggestion">Previous</a> </td> much cleaner to me. Link to comment https://forums.phpfreaks.com/topic/135279-way-to-position-view-after-page-refresh/#findComment-704667 Share on other sites More sharing options...
mikeleblanc Posted December 3, 2008 Author Share Posted December 3, 2008 ok...thanks a lot to everyone who posted...I appreciate it...especially to haku and corbin. Link to comment https://forums.phpfreaks.com/topic/135279-way-to-position-view-after-page-refresh/#findComment-704676 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.