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, Quote Link to comment 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">). Quote Link to comment 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... Quote Link to comment 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. Quote Link to comment 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> Quote Link to comment 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. Quote Link to comment 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> Quote Link to comment 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? Quote Link to comment 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> Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
mikeleblanc Posted December 3, 2008 Author Share Posted December 3, 2008 What's the PHP tag alternative? Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.