473,398 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

variable howto

rut
I have this in a .inc (include file):

<title> <?php $page_title; ?></title>

in the php page I have this:

<?php
$page_title = 'Reidsville Christian Church';
include('./include/template.inc');
?>

This works well.

I'd like to do the same for the .css file to include in the php page.
Something like this:

In template.inc
<link href= $page_css rel="stylesheet" type="text/css">

In index.php

<?php
$page_title = 'Reidsville Christian Church';
include('./include/template.inc');
$page_css = 'index.css';
?>
This doesn't work. I suspect I'm refering to the $page_css incorrectly
in the template.inc file.
Can someone help on this?

Thanks
Rut

Nov 27 '05 #1
3 1135
Message-ID: <11**********************@g47g2000cwa.googlegroups .com> from
rut contained the following:
<?php
$page_title = 'Reidsville Christian Church';
include('./include/template.inc');
$page_css = 'index.css';
?>
This doesn't work. I suspect I'm refering to the $page_css incorrectly
in the template.inc file.
Can someone help on this?


Well, you'll have to put the $page_css = 'index.css'; before the
include for it to work.

That said, it's hard to see how this include is doing anything useful.
You need to reconsider the logic of what you are doing.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Nov 27 '05 #2

Geoff Berrow wrote:
That said, it's hard to see how this include is doing anything useful.
You need to reconsider the logic of what you are doing.


What it is doing is separating the data from the layout

Nov 28 '05 #3

rut wrote:
I have this in a .inc (include file):

<title> <?php $page_title; ?></title>

in the php page I have this:

<?php
$page_title = 'Reidsville Christian Church';
include('./include/template.inc');
?>

This works well.

I'd like to do the same for the .css file to include in the php page.
Something like this:

In template.inc
<link href= $page_css rel="stylesheet" type="text/css">

In index.php

<?php
$page_title = 'Reidsville Christian Church';
include('./include/template.inc');
$page_css = 'index.css';
?>
This doesn't work. I suspect I'm refering to the $page_css incorrectly
in the template.inc file.
Can someone help on this?

Thanks
Rut


You need <link href="<?php echo $page_css; ?>" rel="stylesheet"
type="text/css">

Nov 28 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Josef Sachs | last post by:
Is Andrew Kuchling's regex-to-re HOWTO available anywhere? I've found the following (dead) links on various Web pages: http://py-howto.sourceforge.net/regex-to-re/regex-to-re.html...
4
by: Digital Fart | last post by:
howto make a connection to database available in my classes. What is the best practice when i want to write classes that need a connection to the database? Do i make a conn variable in my...
3
by: TheNedMan | last post by:
Sorry for the repost, but I want to get to the bottom of this... From the Microsoft sample "How-To Create an Offline Application": Public Delegate Sub CustomersRowChangeEventHandler(ByVal...
3
by: db2_d_b_a | last post by:
Hello All, Has any one used either one of the below mentioned registry variables in any of the environments. Were there any performance issues related with this. Any inputs regarding these...
2
by: shil | last post by:
Hi all, I am using javascript confirm() function to get user's confirmation from codebehind after a condition is met. I don't want to attach the function to the button on page load. When I...
1
by: Ranjan | last post by:
Hi, I want to assign javaScript variable to JSP variable. <Script> var conf=Confirm("Mess"); if(conf) { <% String str=conf; /// line 1 %> }
7
by: dmitrey | last post by:
howto make Python list from numpy.array? Thx, D.
15
by: Frank | last post by:
Before I start, please let's not discuss whether goto is evil or not. For generated code, this can make perfect sense. It would be interesting to know a trick how to get C to do a goto to an...
11
by: EricGoogle | last post by:
Hello All, I am trying to figure out a how to get a variable's name from code. Ex: var MYVAR = 3; alert( ????? ); OUTPUT: "MYVAR"
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.