'Return to top' trouble?

This is a discussion on "'Return to top' trouble?" within the PHP Forum section. This forum, and the thread "'Return to top' trouble? are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Aug 2nd, 2006, 04:47
New Member
Join Date: May 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
'Return to top' trouble?

I am using this to allow a page to 'return to top' by clicking a link.
It was working and now it isn't. I wonder if someone can help me?
This is the first lot of php
<?php
$VegetableReturn = <<<VEG
<tr class="PlainLink">
<td></td>
<td>
<a href="#Vegetables">
<img src="Images/veg/47270289.jpg" alt=""
style="float: left; margin: 10px;">
<br><small>Top of<br>Vegetables</small>
</a>
</td>
<td></td>
</tr>\n
VEG;

$FruitReturn = <<<FRUIT
<tr class="PlainLink">
<td></td>
<td>
<a href="#Fruit">
<img src="Images/veg/47270289.jpg" alt=""
style="float: left; margin: 10px;">
<br><small>Top of<br>Fruit</small>
</a>
</td>
<td></td>
</tr>\n
FRUIT;
?>


This is the php that is spread intermittently through out the page.
<?php print($VegetableReturn); ?>




Last edited by Kymberly; Aug 2nd, 2006 at 10:25.
Reply With Quote

  #2 (permalink)  
Old Aug 2nd, 2006, 20:34
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to ukgeoff
Re: 'Return to top' trouble?

If I understand you correctly, $VegetableReturn is what you are print around the page a a link back to the top.

If so, this will never happen at the moment because this variable does not contain any html that a browser can interpit as a link.

You need to have your variable contain something like:
Code: Select all
<a href=#top>Top of page</a>
and then you need an anchor at the top of the page.

Remember that any id can be used as an anchor.

Reply With Quote
  #3 (permalink)  
Old Aug 3rd, 2006, 00:25
New Member
Join Date: May 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: 'Return to top' trouble?

Thanks for that.
Reply With Quote
  #4 (permalink)  
Old Aug 3rd, 2006, 15:49
craig's Avatar
Reputable Member
Join Date: Sep 2005
Location: Preston, UK
Age: 21
Posts: 381
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to craig
Re: 'Return to top' trouble?

also if you have an anchor that isnt actually specified, when you click on it, it will go to the top of the page.
Sometimes people have a problem with the top function not going all the way to the top, so you should simply define a tag which doesn't exist
Reply With Quote
Reply

Tags
return, top, trouble

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Return column names in SQL using PHP nate2099 Databases 7 Dec 21st, 2007 14:57
The Return of Basic HTML??? ScottR Webforumz Cafe 0 Aug 8th, 2007 13:38
ASP ADO Connection to return XML from SQL Proc NickyJ Classic ASP 2 Aug 11th, 2005 11:39
return from db benbramz Classic ASP 5 Jun 19th, 2005 18:29
Return to previously viewed screen Imara96 Flash & Multimedia Forum 5 Apr 23rd, 2005 22:18


All times are GMT. The time now is 05:53.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43