Page 1 of 1

script to open link by id in a new window

Posted: Fri Sep 22, 2006 3:55 pm
by mnemonik23
Hi,

I'm looking for php or script that opens a link by provided id in a new window.

Something like this: http://www.blah-blah-blahh.com/linkto.php?id=17
So on the main page I will have a few links like above and when user clicks on any of them the main page stays the same, but links will be opened in a new window.

I assume the list of urls and id can be defined inside of the script or in the DB.

Does anybody have something like that to borrow?


Thanks!

Posted: Fri Sep 22, 2006 4:31 pm
by feyd
That'd be a basic HTML link most often.

Code: Select all

<a href="blahblah" target="_blank">foo</a>

Posted: Fri Sep 22, 2006 6:48 pm
by mnemonik23
feyd wrote:That'd be a basic HTML link most often.

Code: Select all

<a href="blahblah" target="_blank">foo</a>
The script is needed on purpose, to not display the actual link on the main page.

Posted: Fri Sep 22, 2006 6:52 pm
by kaszu
Easiest could be to save links into database (id, url),
then add link to your page <a href=".../linkto.php?id=17" _target="blank">...</a>
when page linkto.php is requested, check database for url for corresponing id,
make a redirect to url.

Posted: Sat Sep 23, 2006 9:30 am
by feyd
mnemonik23 wrote:The script is needed on purpose, to not display the actual link on the main page.
What do you define as "actual link" in this case?