Jump to content

Recommended Posts

Hi!  Please help!

 

I am sure there must be a simple way of doing what I want to do, but I can't find it!

 

I would like to hold a url in a variable.  The url contains another variable - e.g.:

 

$url = '/a_page_name/' . $ref . '/';

 

My problem is that $ref is declared (via a MySQL query) after $url is declared.  Is there a way of 'refreshing' $url once $ref has been declared, so that I only need to declare $url once in my header include file which is included at the beginning of all my pages?  I know that I could place it in a separate file which could be included after the MySQL query, but I would rather avoid that if possible.

 

I hope the above makes sense!  TIA.

Link to comment
https://forums.phpfreaks.com/topic/59823-refreshing-a-variable-in-a-variable/
Share on other sites

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.