Solved

Why to generate web buttons with PHP

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to build a intranet site 8 36
Advice and best practice  SQLite3 Database using PHP 2 46
tutorial for ebay api 3 32
Checkout Page Input Field not aligned 1 20
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
This video teaches users how to migrate an existing Wordpress website to a new domain.

813 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

10 Experts available now in Live!

Get 1:1 Help Now