Hailwood Posted June 14, 2010 Share Posted June 14, 2010 if i have this in a config file $config->base['url_path'] = 'http://localhost/buzzil/'; and i have this <a href="<?php $config->base['url_path']; ?>messaging">Messaging</a> any idea when i am on a page iwth a url like http://localhost/buzzil/templates/list/email why instead of the expected output of <a href="http://localhost/buzzil/messaging">Messaging</a> am i getting <a href="http://localhost/buzzil/templates/list/messaging">Messaging</a> dont know if it will help but here is my htaccess file Options +FollowSymlinks RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?page=$1 Quote Link to comment https://forums.phpfreaks.com/topic/204730-wierd-output-in-links/ Share on other sites More sharing options...
trq Posted June 14, 2010 Share Posted June 14, 2010 You might want to post the code that actually makes these weird links. Quote Link to comment https://forums.phpfreaks.com/topic/204730-wierd-output-in-links/#findComment-1071844 Share on other sites More sharing options...
Hailwood Posted June 14, 2010 Author Share Posted June 14, 2010 That is the code there <a href="<?php $config->base['url_path']; ?>messaging">Messaging</a> the config class is just an empty class with magic methods for get and set so i define config things like so $config = new Config(); //BASE SETTINGS //------------------ $config->base = array(); $config->base['abs_path'] = $abs_path; $config->base['url_path'] = 'http://localhost/buzzil/'; $config->base['temp_dir'] = 'tmp/'; $config->base['env'] = 'dev'; so the expected output from accessing any url with this code in the file <a href="<?php $config->base['url_path']; ?>messaging">Messaging</a> is <a href="http://localhost/buzzil/messaging">Messaging</a> but instead from a url such as http://localhost/buzzil/templates/list/email i get <a href="http://localhost/buzzil/templates/list/messaging">Messaging</a> and yes thorpe, at midnight when i have had less than 3 hours sleep in the past 48 hours i do fail at spelling Quote Link to comment https://forums.phpfreaks.com/topic/204730-wierd-output-in-links/#findComment-1071848 Share on other sites More sharing options...
trq Posted June 14, 2010 Share Posted June 14, 2010 You never echo the value within the $config array so it shouldn't be working at all. <a href="<?php echo $config->base['url_path']; ?>messaging">Messaging</a> Quote Link to comment https://forums.phpfreaks.com/topic/204730-wierd-output-in-links/#findComment-1071853 Share on other sites More sharing options...
Hailwood Posted June 14, 2010 Author Share Posted June 14, 2010 8D yeah just saw that, so it means that the actual link that was being created was <a href="messaging"> which explains it. I think i kinda deserve anything you give me now lol. Quote Link to comment https://forums.phpfreaks.com/topic/204730-wierd-output-in-links/#findComment-1071854 Share on other sites More sharing options...
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.