Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Why to generate web buttons with PHP

Posted on 2011-03-02
4
Medium Priority
?
247 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 400 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 400 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

Technology Partners: 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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

971 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