Jump to content

Quick Link Referencing of another URL


jerryjordan

Recommended Posts

First, I am new to this forum and if this question has already been answered, please let me know where to find it. Also, I am relatively new to PHP - although I have been using for my sites, forums and wikis for ages - I am finally trying to work on the code for myself.

 

I have two sites, one is a PHP and MySQL driven CMS and the other is a PHP and MySQL wiki. Lets call them:

 

www.site.com

www.wiki.com

 

What I want to do is to be able to reference wiki pages from within my main site, using a shorthand reference like

 

[[W]]WikiPageName

 

that not only replaces the [[W]] with the wiki URL, but also converts the string to a URL.

 

I have bought a PHP book and am working my way through it (slowly) and I have come up with the very basic code following:

 

$URL = [[W]]$Page;

$Wiki = "http://www.wiki.com/";

$URL_2 = "<a href='$Wiki$Page'>$Page</a>";

 

I am hoping that something like this would change [[W]]WikiPage to a link with the text WikiPage.

 

My first thought was that when I got the code right, the place to put it would be in the top of the page template, but then I thought that perhaps in the config file that is called by each page.

 

I am sure that this is probably not a huge problem for someone well versed in PHP, but I have only just made my first PHP form script, so I am trying to get my head around it.

 

Any help would be much appreciated!

 

Jerry

Link to comment
https://forums.phpfreaks.com/topic/55897-quick-link-referencing-of-another-url/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.