Styling PhP output

Locked

Views: 1,680

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
3 Mar 2010, 4:47 PM
#1
tidy avatar

tidy

New Zenner

Join Date:
Apr 2009
Location:
Back in Toronto
Posts:
19
Plugin Contributions:
0

Styling PhP output

I have spent many days / hours trying to implement "css style" on certain php output text, with no success.:wacko:

Today is a better day as I finally figured it out.:clap:

Anyways I decided to post the working code for all the uninformed "such as myself" a long with a few links to various php urls dealing with using echo to implement a css style.

1)This is a post on the various ways to use echo. Nice reference. http://php.net/manual/en/function.echo.php.

2)This is a post on using the <link Rel> or echo <link Rel> to import css. This must be very basic know how,because after looking at tons of sites and post it was the only one which mention the type of header. http://archives.hwg.org/hwg-techniques/[email protected].

3)BB thread over at our friends at dynamicdrive.com offers further reference and example using echo to wrap php code. oohps to wrap the output of php code. http://www.dynamicdrive.com/forums/archive/index.php/t-4879.html.

Here is a working example of using echo and the span class to style your php output. In fact if you look through your php files one will find this technique has already been used but to the informed "such as myself" it was missed.

define('TEXT_CHOOSE_SHIPPING_DESTINATION','<span class="ship">Your order will be shipped to the address at the left or you may change the shipping address by clicking the Change Address button.</span><br/>');

You have to include your new css class in the main css file. I am using / changing the Cold_Steel templet by Clyde Jones and this templet has a main css file in the Customs\Css dir so your situation may differ.

I hope this reference is useful to you.

Cheers

6 Mar 2010, 5:16 AM
#2
tidy avatar

tidy

New Zenner

Join Date:
Apr 2009
Location:
Back in Toronto
Posts:
19
Plugin Contributions:
0

Re: Styling PhP output

Sorry for not providing a example for the styling php output.

On my shipping page the address to ship to was in the same calss as the message and I wanted to change the font size and color of the message but was unable to do so with out changing the address..

The text for the message is located in shipping.php so a new class had to be added to the main style sheet "in my case" and the (echo <span class>) was used with the added class to style the message text.

cheers - O if you get a blank page then you "most likely added or left out syntax so be sure to save your working file in the custom folder before editing.