Jump to content

wierd output in links


Hailwood

Recommended Posts

 

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

Link to comment
https://forums.phpfreaks.com/topic/204730-wierd-output-in-links/
Share on other sites

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 ;)

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.