Stylize PHP?

How do you style PHP ? I’ve used firefox to find what I should stylize and when I change anything that I know is not permanent in firebug it doesn’t reflect on the page !?!?

What do you mean by stylise PHP? Since it is a server-side language and needs to be parsed first by the PHP parser on the server.

All CSS rules you’ve made/changed in Firebug need to be saved in a file and linked in the head of the html/php file.

My crystal sheep’s eyeball tells me you’re using Easy PHP Contact Form

The structure of the form is contained in contact.php on line 154. You’ll see that it’s table based and uses inline styles that are partly hard coded and partly set by variables that can be edited in contact-config.php under “COSMETICS” at line 90.

Is there a way to edit the PHP styles visually instead of having to open the PHP file and edit then preview ?

What exact procedure is involved in editing “the PHP styles visually”? A WYSIWYG web design application?

I have a WYSIWYG program to visually see, I just have to install a PHP server. When I edit the config file manually with a hit or miss approach, I see no difference for example the height was 500px, I change that to an extreme height of 150px, I saw no difference !?!?

In that example, which I assume to be the table with id=“contactForm”, the content will be forcing the height of the element. Increase the height or try editing another element and maybe you’d see a difference.

<table style="width:100%; height:{$form_height}; background:{$form_background}; background:{$form_background}; border:{$form_border_width} {$form_border_style} {$form_border_color}; padding:10px;" id="contactForm">

Only to be able to change the width, this stinks I have to install a local PHP server to visually edit just because it’s within a PHP file, arrrgh!

If you get really desperate, inline styles can be trumped by !important.

Adding !important to each and every style, theres gotta be another way to style PHP code by adding embedded style sheets to the page that style the PHP form. Do such options exist whereas I can add a rule to the page that reflect only onto the PHP code so I can style eg.#contactarea !!!

The difficulties of applying CSS in this case do not relate to PHP itself, just the construction methods chosen by the developer. The CSS could have been left entirely in an external stylesheet.

As the Easy PHP Contact Form license says: “This script may be used and modified free of charge by anyone”. You could edit the form code in contact.php, strip all the inline styles out, put new classes and ids in, add an external stylesheet or whatever you like (taking care not to mess up any verification related items that may present).

Or you could seek out a different form script that has the kind of styling flexibility that suits you.

Here’s one contact form script that uses an external stylesheet rather than inline styles.

Lacks built-in CAPTCHA but has a Q&A spam trap.

I suppose I’m going to have to find another PHP form script that uses external style sheets with CAPTCHA, thanx for pointing this out :slight_smile: