Jump to content

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

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.