Jason Posted April 27, 2011 Report Posted April 27, 2011 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! Quote
Administrators simpilot Posted April 27, 2011 Administrators Report Posted April 27, 2011 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> Quote
Moderators mark1million Posted April 27, 2011 Moderators Report Posted April 27, 2011 edit removed Quote
Administrators simpilot Posted April 27, 2011 Administrators Report Posted April 27, 2011 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; ?> Quote
Jason Posted April 27, 2011 Author Report Posted April 27, 2011 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 Quote
Jason Posted April 27, 2011 Author Report Posted April 27, 2011 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. Quote
Administrators simpilot Posted April 27, 2011 Administrators Report Posted April 27, 2011 I just double checked it and it works fine on my test install. My guess is you have dropped or added a character somewhere in the file. Are you getting a headers already sent error as well? Quote
Jason Posted April 27, 2011 Author Report Posted April 27, 2011 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. Quote
Jason Posted April 28, 2011 Author Report Posted April 28, 2011 Simpilot, where are you adding your code in local.config. And are you use the exact code that you posted above? Quote
Administrators simpilot Posted April 28, 2011 Administrators Report Posted April 28, 2011 I put it in the same place you are indicating, right after the SITE_URL definition. Do you get the same problem if you add it but do not add the echo statement in the template? Quote
Jason Posted April 28, 2011 Author Report Posted April 28, 2011 It's not the template part that's giving me the error, it when I add the code to the local config. And again everything works fine before I add this code....... Quote
Administrators simpilot Posted April 28, 2011 Administrators Report Posted April 28, 2011 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'); Quote
Jason Posted April 28, 2011 Author Report Posted April 28, 2011 Ok I'll give that a try, and I don't know why it's working... Thanks a lot tho for your help! I really appreciate it Quote
Jason Posted April 28, 2011 Author Report Posted April 28, 2011 I got it working!! All i had to do was define it in the index.php of the admin panel, and it works perfect! Quote
Administrators Nabeel Posted April 28, 2011 Administrators Report Posted April 28, 2011 I got it working!! All i had to do was define it in the index.php of the admin panel, and it works perfect! That will get overridden in updates, try adding it to the very end of you local.config.php file Quote
Jason Posted April 28, 2011 Author Report Posted April 28, 2011 doesn't seem to make a difference, it is still giving me a blank site when i add that Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.