Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.