Page 1 of 1

Page formatting PHP Templates

Posted: Wed Oct 21, 2009 1:19 pm
by sgately
Hi Guys,

I, probably like most of us, have the occasional need to insert a PHP script / template into my website. I have no problems on the install, or setup, and there are tons of scripts available, but the formatting has become an issue. I am hoping someone can supply advice with.

Most of these 'scripts' include a template of the form, widget or object that will be used as the front end of the PHP call. Being a newbie, I try and copy the code and paste it into my existing webpage with dreadful effects. Each time I do this the page format gets all messed up, widens, images move etc.

Does anyone know the best way to take an existing widget, form, etc from a PHP script and make it fit nicely into a webpage.

An example would be adding a site search option like sphider, into an existing page design.

Re: Page formatting PHP Templates

Posted: Wed Oct 21, 2009 3:40 pm
by kaszu
Does anyone know the best way ...
Chuck Norris does, but I wouldn't risk asking him. :D

1) Look at the CSS of those 'templates', maybe classes / ids conflict or overwrite your CSS.
2) Set default style for forms, inputs, label, etc.
3) There isn't universal way of doing this, you will need to edit CSS/HTML/JS of each widget to make sure it looks as you want it to look.
and there are tons of scripts available
Yes there are. For example on dynamicdrive.com a lot of scripts are coded really badly and I will better reinvent the wheel than use them.