Solved

Why to generate web buttons with PHP

Posted on 2011-03-02
4
243 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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?
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.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

627 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