Solved

Why to generate web buttons with PHP

Posted on 2011-03-02
4
234 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

746 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now