Sorry, I am a Java programmer and very new to php and was wondering with
these questions. How do you typically integrate CSS into a PHP script.
Do you embed it or reference a external CSS file? Have an include script
to dynamically generate it. How do you have it work with a HTML FORM?
Sorry, I have no clue as of yet. I have just started to research it.
I have written the php code for my quotation test site. I want to start
to format it via css. I have just built and playing with it at http://ichbinquotations.awardspace.com
Also, any tips and Preferred Resources?
--
Thanks in Advance... http://ichbin.9999mb.com
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
__________________________________________________ ____________________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-) 8 1225
IchBin wrote:
Sorry, I am a Java programmer and very new to php and was wondering
with these questions. How do you typically integrate CSS into a PHP
script. Do you embed it or reference a external CSS file? Have an
include script to dynamically generate it. How do you have it work
with a HTML FORM? Sorry, I have no clue as of yet. I have just
started to research it.
PHP is not linked to CSS in any way.
PHP generates/handles code, and spews back what's asked of it. If you want
the output html documents, just make sure there's a correct link in the
header like with static HTML documents.
Both HTML & CSS are rendered in the client's browser, so all you have to do
is provide the correct output.
--
Rik Wasmus
It is generally a good idea to link to an external CSS file. Having
all your pages point to one file makes changes much easier than having
to change it in every file.
But this is a basic html/css issue, not very closely related to php.
Michael Vilain wrote:
In article <te********************@ptd.net>, IchBin <we******@ptd.net>
wrote:
>Sorry, I am a Java programmer and very new to php and was wondering with these questions. How do you typically integrate CSS into a PHP script. Do you embed it or reference a external CSS file? Have an include script to dynamically generate it. How do you have it work with a HTML FORM? Sorry, I have no clue as of yet. I have just started to research it.
I have written the php code for my quotation test site. I want to start to format it via css. I have just built and playing with it at http://ichbinquotations.awardspace.com
Also, any tips and Preferred Resources?
CSS and HTML are the "output" of whatever sever-side programming
language you're using to generate that output. If you're using some
sort of templating system, use it's constructs. Otherwise, this is up
to how you've designed the program.
You can buy lots of books on HTML and CSS from lots of places. I like
the O'Reilley and Sitepoint offerings.
YMMV.
Thanks for all of your replies...
For this particular group of scripts I am not using any templating.
I should have been clearer. Guess my question was not about the natures
of CSS\HTML\PHP. I understand those.
Looking for tips on usual way to tightly couple them to my advantage.
PHP is not linked to CSS but they can be tightly coupled. PHP works on
the server side but can also present the client side presentation. In
this presentation I wanted to interlace HTML, CSS and PHP code.
Is this a viable approach? I realize their are no standards in PHP but
their must be more efficient ways, that have floated to the top, to
approach what I am trying to do..? Or is this the right approach?
This maybe a basic html/css issue but when I tightly couple it with PHP
I see questions?
Maybe with this perspective this would be a better way to ask my
questions. :shock:
My sources for documentation has been the W3C Recommendations for HTML
and CSS.
--
Thanks in Advance... http://ichbin.9999mb.com
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
__________________________________________________ ____________________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
IchBin wrote:
For this particular group of scripts I am not using any templating.
I should have been clearer. Guess my question was not about the
natures
of CSS\HTML\PHP. I understand those.
Looking for tips on usual way to tightly couple them to my advantage.
PHP is not linked to CSS but they can be tightly coupled. PHP works on
the server side but can also present the client side presentation. In
this presentation I wanted to interlace HTML, CSS and PHP code.
So? Make your CSS (either dynamic with PHP, or a static CSS file), spit out
the HTML with PHP, et voilá.
Is this a viable approach? I realize their are no standards in PHP but
their must be more efficient ways, that have floated to the top, to
approach what I am trying to do..? Or is this the right approach?
We're not sure what you're trying to do. You have a couple of pages, with
HTML output from PHP, and want to use CSS for them. There is no difference
in static/dynamic output as soon as it's at the client....
This maybe a basic html/css issue but when I tightly couple it with
PHP I see questions?
WHAT do xou couple with PHP? HOW? It's pretty much a one way street PHP ->
HTML (possibly CSS), that's not a coupling IMO.
--
Rik Wasmus
Rik wrote:
IchBin wrote:
>For this particular group of scripts I am not using any templating. I should have been clearer. Guess my question was not about the natures of CSS\HTML\PHP. I understand those.
Looking for tips on usual way to tightly couple them to my advantage. PHP is not linked to CSS but they can be tightly coupled. PHP works on the server side but can also present the client side presentation. In this presentation I wanted to interlace HTML, CSS and PHP code.
So? Make your CSS (either dynamic with PHP, or a static CSS file), spit out
the HTML with PHP, et voilá.
>Is this a viable approach? I realize their are no standards in PHP but their must be more efficient ways, that have floated to the top, to approach what I am trying to do..? Or is this the right approach?
We're not sure what you're trying to do. You have a couple of pages, with
HTML output from PHP, and want to use CSS for them. There is no difference
in static/dynamic output as soon as it's at the client....
Actually it is only one page that is presented. Sorry I have not
explained what I am going to try to do. I have a lot of other objects I
want to add to this page. Guess it is my lack of knowledge of CSS and
the serial output from the server and how to place the data on my one
html output. I am looking at XMLHttpRequest but I hear a lot from others
that you should not use javascript because users can set it of in their
browser. Then again their seems to be a lot of Javascript running on the
net. Little confusing on my part.
>
>This maybe a basic html/css issue but when I tightly couple it with PHP I see questions?
WHAT do xou couple with PHP? HOW? It's pretty much a one way street PHP ->
HTML (possibly CSS), that's not a coupling IMO.
I guess I see it as coupling because the PHP print\echo statements are
passing the front end along with the php server side data output.
--
Thanks in Advance... http://ichbin.9999mb.com
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
__________________________________________________ ____________________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
IchBin wrote:
Sorry, I am a Java programmer and very new to php and was wondering with
these questions. How do you typically integrate CSS into a PHP script.
Do you embed it or reference a external CSS file? Have an include script
to dynamically generate it. How do you have it work with a HTML FORM?
Sorry, I have no clue as of yet. I have just started to research it.
I have written the php code for my quotation test site. I want to start
to format it via css. I have just built and playing with it at http://ichbinquotations.awardspace.com
Also, any tips and Preferred Resources?
As others have noted, there really isn't a close tie between PHP and CSS.
PHP just creates HTML and sends it to the client. Nothing more, nothing
less.
Build a sample static page first, and get it to look like you wish. You
can get help from alt.html and/or alt.html.css.
Then go back and replace the appropriate static elements with PHP
generated code. They should look exactly the same.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. js*******@attglobal.net
==================
IchBin wrote:
>
How do you typically integrate CSS into a PHP script.
Do you embed it or reference a external CSS file?
Either or both; just like in HTML. Additionally, PHP allows you
to generate CSS dynamically.
Let's say your HTML/PHP/whatever files have this tag:
<LINK rel="stylesheet" href="style.php" type="text/css">
Then, inside stytle.php, you may write, for example:
header('Content-Type: text/css');
switch ($_GET['palette']) {
case 'blueandyellow':
$b = '#0000ff';
$c = '#ffff00';
break;
case 'greenandsilver':
$b = 'green';
$c = 'silver';
break;
default:
$b = '#ffffff';
$c = '#000000';
}
echo <<<EOCSS
body {
color: $c;
backrgound-color: $b;
}
<!-- Many other styles go here -->
EOCSS;
Then, you can switch the color palette (or any other attributes
derfined
by the stylesheet) is as easy as going from
<LINK rel="stylesheet" href="style.php?palette=blueandyellow"
type="text/css">
to
<LINK rel="stylesheet" href="style.php?palette=greenandsilver"
type="text/css">
The standard recommendation is to put as much style information
into an external stylesheet as possible and suggest that the clients
cache the stylesheet. This way, the stylesheet gets requested only
once.
Also, any tips and Preferred Resources?
The CSS Specificatoin is your friend: http://www.w3.org/TR/CSS2/
Cheers,
NC
IchBin wrote:
How do you typically integrate CSS into a PHP script.
Do you embed it or reference a external CSS file?
Always, single and external (and, other styles for other media(say,
print) and alternate styles).
<snip>
Also, any tips and Preferred Resources?
The current trend in web dev is the templating via CSS (esp, with
XHTML)--in which the position of HTML elements are "controlled" with
CSS. For the real world example, check
<http://www.mezzoblue.com/zengarden/alldesigns/(you'll see, the HTML
remains same, but only the CSS file is changed externally).
For beginner <http://www.webdesignfromscratch.com/and then lot of
links at mozilla dev corner like
<http://developer.mozilla.org/en/docs/Writing_Efficient_CSS>
--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/ This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: William C. White |
last post by:
Does anyone know of a way to use PHP /w Authorize.net AIM without using
cURL? Our website is hosted on a shared drive and the webhost company
doesn't installed additional software (such as cURL)...
|
by: Albert Ahtenberg |
last post by:
Hello,
I don't know if it is only me but I was sure that header("Location:url")
redirects the browser instantly to URL, or at least stops the execution of
the code. But appearantely it continues...
|
by: James |
last post by:
Hi,
I have a form with 2 fields.
'A'
'B'
The user completes one of the fields and the form is submitted.
On the results page I want to run a query, but this will change
subject to which...
|
by: Ollivier Robert |
last post by:
Hello,
I'm trying to link PHP with Oracle 9.2.0/OCI8 with gcc 3.2.3 on a Solaris9
system. The link succeeds but everytime I try to run php, I get a SEGV from
inside the libcnltsh.so library.
...
|
by: Richard Galli |
last post by:
I want viewers to compare state laws on a single subject.
Imagine a three-column table with a drop-down box on the top. A viewer
selects a state from the list, and that state's text fills the...
|
by: Albert Ahtenberg |
last post by:
Hello,
I have two questions.
1. When the user presses the back button and returns to a form he filled
the form is reseted. How do I leave there the values he inserted?
2. When the...
|
by: inderjit S Gabrie |
last post by:
Hi all
Here is the scenerio ...is it possibly to do this...
i am getting valid course dates output on to a web which i have designed
....all is okay so far , look at the following web url
...
|
by: Jack |
last post by:
Hi All,
What is the PHP equivilent of Oracle bind variables in a SQL statement, e.g.
select x from y where z=:parameter
Which in asp/jsp would be followed by some statements to bind a value...
|
by: Sandwick |
last post by:
I am trying to change the size of a drawing so they are all 3x3.
the script below is what i was trying to use to cut it in half ... I
get errors.
I can display the normal picture but not the...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: Aliciasmith |
last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
|
by: giovanniandrean |
last post by:
The energy model is structured as follows and uses excel sheets to give input data:
1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
|
by: NeoPa |
last post by:
Hello everyone.
I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report).
I know it can be done by selecting :...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM)
Please note that the UK and Europe revert to winter time on...
|
by: nia12 |
last post by:
Hi there,
I am very new to Access so apologies if any of this is obvious/not clear.
I am creating a data collection tool for health care employees to complete. It consists of a number of...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
|
by: GKJR |
last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
|
by: SueHopson |
last post by:
Hi All,
I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...
| |