Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 752079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:44:23+00:00 2026-05-14T14:44:23+00:00

OK, I’m working with converting some very basic PHP to port to a dev

  • 0

OK, I’m working with converting some very basic PHP to port to a dev server where the client only has CF. Ive never worked with it, and I just need to know how to port a couple things:

<?php
      $pageTitle = 'The City That Works';
      $mainCSSURL = 'header_url=../images/banner-home.jpg&amp;second_color=484848&amp;primary_color=333&amp;link_color=09c&amp;sidebar_color=f2f2f2';
      require('includes/header-inc.php');
?>

I know:

<cfinclude template="includes/header-inc.cfm">

but how to i get the var to be passed to the include and then how do I use it on the subsequent included file?

Also in my CSS (main.php) I have (at the top):

<?php
    header('Content-type: text/css');
    foreach($_GET as $css_property => $css_value) {define(strtoupper($css_property),$css_value);}
?>

and im using those constants like this:

#main-content a {color:#<?= LINK_COLOR ?>;}

How can I get that to work also with CF?

Never thought I’d be working with CF 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T14:44:24+00:00Added an answer on May 14, 2026 at 2:44 pm

    Coldfusion has a number of variable scopes that have different levels of visibility.

    I’m not too familiar with PHP, but I’m guessing those variable declarations are available to any code in the request?

    The equivalent of this is the ‘request’ scope.

    Any variables set in the request scope are available to any code in the processing of the request.

    To set a variable in the request scope, you simply do:

    <cfset request.myVariable = myValue>
    

    Or, in cfscript:

    request.myVariable = myValue;
    

    The other most commonly used scope is the ‘variables’ scope. This is the default scope if you don’t specify a scope, so:

    <cfset myVariable = myValue>
    

    is equivalent to

    <cfset variables.myVariable = myValue>
    

    The variables scope is visible to code included with CFInclude, so in your specific case, you could use the variables scope or the request scope.

    Here’s a reference to the Scopes in CF:

    http://livedocs.adobe.com/coldfusion/8/htmldocs/Variables_30.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.