Jump to content
phpVMS Forums

External URL's


Recommended Posts

Is it possible to do this:

I want to create a php url for an external URL (eg. youtube)

Can you do this --> www.youtube.com translates to <?php echo YOUTUBE_URL?>

and the youtube url entered would go there

hope that makes sense

Thanks!

Link to post
Share on other sites

To do it in php you can do;

<?php echo '<a href="http://www.youtube.com">YouTube</a>'; ?>

but if you are outside of php there is no reason to use it, just use the html command

<a href="http://www.youtube.com">YouTube</a>

Link to post
Share on other sites

Ah, if you are trying to use it as a defined value Mark is right, define it in your local config;

define('YOUTUBE_URL', '<a href="http://www.youtube.com">YouTube</a>');

Then in your template;

<?php echo YOUTUBE_URL; ?>

Link to post
Share on other sites

I added that to my site, in local.config.php directly under where it defines the site url... However when i add that it just whites out my site. I dont get an error, i just dont see anything, at all. What am i doing wrong here

Link to post
Share on other sites

Here is where i am currently adding it to when i get the blank site.

Line 22 - local.config.php

define('SITE_URL', '....my url');

I added this code directly below

define('YOUTUBE_URL', '<a href="http://www.youtube.com">YouTube</a>');

If this is incorrect please let me know, and where i should put it.

Link to post
Share on other sites

Hm.. i have not changed anything in core/local.config.php. **Everything works fine until i add that code

Am i supposed to simple copy and paste the code given, and add it below SITE_URL?

I also tried it on a completely different server and va, but i get the same result.

And basically what its doing is, i am not getting any error at all. it just displays everything as white.

Link to post
Share on other sites

Not sure what to tell you, I have tried it on a WAMP server here on my local machine, on XAMPP installed on a thumb drive, and on my live site which is running on a CENT OS 5.6 base with php 5.2.10.

Try putting a simpler definition in there to see if it works.

define('TEST_TRY', 'testing');

Link to post
Share on other sites

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.

Loading...
×
×
  • Create New...