Solved

Why to generate web buttons with PHP

Posted on 2011-03-02
4
240 Views
Last Modified: 2012-05-11
Dear Experts,

I have a bit of a silly question and would like to hear your opinion.
Having been reading numerous books on PHP to increase my awareness of the vast variety of techniques used by PHP, I have bumped into a subject of button generation using PHP image library functions. NOW my question is when and where would I preferably choose to create my website buttons by PHP (as I reckon it does demands extra processing for the server) instead of using standard HTML/CSS/graphic buttons that do not stress the server in any way?

Thank you for all your suggestions and answers
0
Comment
Question by:czechmate1976
  • 2
4 Comments
 
LVL 34

Accepted Solution

by:
Beverley Portlock earned 100 total points
ID: 35016408
The reason for generating buttons is that PHP is a dynamic way to create websites. Let us suppose I have a website that has a button on it whose text reads "Latest Offers" but SEO research shows that the phrase "Hottest deals" works better. By simply changing a setting in the database I can change the page title, the page heading and the button text if I generate my buttons dynamically. I do not have to get a graphic artist to redo the button.

Another example - if I am always creating new content and new pages then it would be crazy to employ someone to keep designing buttons to match the new pages. It makes far more sense to get the server to do it.
0
 
LVL 6

Assisted Solution

by:hexer4u
hexer4u earned 100 total points
ID: 35016617
It should be used when the button has to be changed much. That means shape,color, text, size, and you can't predict all possible combinations and generate an image for each situation.
Let's say you have a multi language website, and at the bottom of each page you have a button that sais "click to add to facebook". Depending on the language, that text would be wider or narrower. Now, either you use a button that can be easily resized or the PHP method.

Personally I would go for CSS, but you never know.
0
 

Author Comment

by:czechmate1976
ID: 35016978
I understand this guys, I have developed a number of dynamic websites with CMS myself. Just really was wondering if it is not a bit redundant.

However, I believe that if we stick to a certain design patern, the button can be designed with css (even the colours etc could be changed dynamically by altering the styles) or using a graphic as a bgnd in css and changing the value of the button.. I have not yet encountered (perhaps because my projects were small to medium) a situations where I was desperately considering creating buttons dynamically by php. But I guess that probably depends on the nature and extent of the project itself. Have you used it before?
0
 

Author Closing Comment

by:czechmate1976
ID: 35021457
Thanks guys
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Adding a countdown to HTA 12 91
php subtract from date 2 26
locate sql commands in C# visual studio Project 6 34
curl parse data from site 20 36
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question