Beginner Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherBeginner Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old December 29th, 2001, 02:04 PM
SJWinter SJWinter is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Posts: 3 SJWinter User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Anchor Links using PHP

Hello . . .

I am looking for some specific syntax for using anchors in PHP pages.

The goal: I have a menu list on my website - - Links on that menu bring you to a page that has different sections on it - - Where and how do I place the anchor tags (href and the closing tag) to make it scroll automagically to the topic selected.

Any help would be great.
Thanks

Reply With Quote
  #2  
Old December 29th, 2001, 02:16 PM
pabloj's Avatar
pabloj pabloj is online now
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,711 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 6 Days 5 h 20 m 54 sec
Reputation Power: 259
Just as in html, show code!

Reply With Quote
  #3  
Old December 29th, 2001, 02:57 PM
realnowhereman realnowhereman is offline
Not there when you need me
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Oct 2001
Location: Berlin, Germany
Posts: 1,438 realnowhereman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 46 sec
Reputation Power: 8
This should do the job:

Long text with sections:
Code:
...

<a name="ntro">Introduction</a>
...

<a name="aims">Our Aims</a>
...

<a name="end">Finally ...</a>

...


Menu (PHP output):
Code:

...

<a target="right" href="longfile.html#aims">Aims</a>

...

Reply With Quote
  #4  
Old January 4th, 2002, 01:51 PM
SJWinter SJWinter is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Posts: 3 SJWinter User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Continuation . . .

Hello . . .

Thanks for the quick response. I have one more question based on the example from 'realnowhereman'

From your example:

<a target="right" href="longfile.html#aims">Aims</a>

will using the file "longfile.php#aims" work the same as it does in html?

I have a menu name and then the actually url is not viewable. The url calls a php page not an html page.

Any suggestions or coding suggestions for this type of situation?

Thanks
SJW

Reply With Quote
  #5  
Old January 4th, 2002, 01:57 PM
realnowhereman realnowhereman is offline
Not there when you need me
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Oct 2001
Location: Berlin, Germany
Posts: 1,438 realnowhereman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 46 sec
Reputation Power: 8
The # character in the URL is interpreted by the browser. It requests the file as usual (without the #mark appendix), the looks for an anchor with the given name. This should work fine with PHP, if the PHP-generated code contains the anchors.

(The above is mainly guessed, but today's been my lucky day )

Reply With Quote
  #6  
Old January 6th, 2002, 02:34 PM
SJWinter SJWinter is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Posts: 3 SJWinter User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for the help. It worked just as needed.

Once the anchor was set in the php page. On my menu all I had to do was place the #nameofanchor after the php page. It looked like this: test.php#link1

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherBeginner Programming > Anchor Links using PHP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway