 |

zaba
User
Nov 19, 2008, 4:45 AM
Post #1 of 3
(262 views)
Shortcut
|
|
extracting the record number from _link
|
Can't Post
|
|
Hi, I am wanting to extract the record number that is at the end of the url and us it as a variable. For example when parsed the _link will be something like /folder/file.php?1. I need the number at the end as a variable. I can do this by manually putting in the address and adding the record num like this /folder/file.php?num=<?php echo $theRecord['num'] ?> and using this on the page:
if (isset($_GET['num'])) { $numfromurl = $_GET['num']; } else { $numfromurl = 1; } is their any way of achieving the same effect but still using the <?php echo $theRecord['_link'] ?>. Thanks
|
|
|  |
 |

Dave
Staff
/ Moderator

Nov 19, 2008, 2:40 PM
Post #2 of 3
(247 views)
Shortcut
|
|
Re: [zaba] extracting the record number from _link
[In reply to]
|
Can't Post
|
|
Hi zaba, What are you trying to do? How it works by default is detail viewer pages just load the number on the end of the url. So ?anything-here-123 is the same as ?num=123 is the same as ?123 You can get the number from the end of the url like this: <?php $num = getNumberFromEndOfUrl() ?> Hope that helps! Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

zaba
User
Nov 19, 2008, 2:58 PM
Post #3 of 3
(245 views)
Shortcut
|
|
Re: [Dave] extracting the record number from _link
[In reply to]
|
Can't Post
|
|
Hi, I'll give it a go. What it is I have a text based menu derived from a field in a record. Their are five records. The detail of the page is loaded in the same page dependent upon the text link from the menu. This is all okay, no problem. All I wanted to do was to keep the text link in hover state once the page associated with it is loaded. I was using the number as a variable to cross reference against the record number associated with the menu and if it matched then I would load a different a class so that menu item appeared in the hover state. Thats the only reason and I can't think of an easier way of doing it really. (If that makes sense) I got my way to work, I was just curious. As an aside though, I am only a few days in, working on 2 projects both incorporating cms builder and so far I love it, what an excellent piece of software. I am sure the more I use it I will be better at it (and pester you guys less). Thanks
|
|
|  |
 | |  |
|