Now for those of you saying, “I want one that works with JQuery!”, hold your horses. No, Walter’s script isn’t a nifty little JQuery plugin, but that’s the best part, it doesn’t have to be. The WZ Tooltip script can be used with or with out JQuery, and it works the same and just as good under either circumstance. I know you’re saying stop rambling and tell me how to use it with JQuery….
You setup a contact form for people to send you email. When the form is submitted, you want to assign each of the POST, GET or REQUEST values to a variable with the same name as the key. (You could do this for a number of reasons, but that’s a different topic.)
Ugh! Doing this can be really time consuming, especially if you have a really long form. Presonally, I would just use the array element vs. setting creating a new variable, but if you must, I suggest using a foreach() loop to create the variables for you.
By trade I’m not a designer, I’m a programmer. There is a definite dichotomy between programming and design, however, the design layout still needs to be coded in a logical manner to make it scalable for easier maintenance in the future. Simply put, the more complex the design, the more time and care needs to be put into the planning of the design, but it doesn’t mean that the code has to be more complicated.
TRUE or FALSE: “It’s easier to update one file or 10 files.” This statement is True.
The concept of a configuration file is that it stores data in one location that any other file on the web site can access. The data that is stored in a configuration file can be unlimited, but usually contains data such as by not limited to the following:
- MySQL Database, Username and Password
- Document Root Folder
- Set time limit for Sessions
- Custom variables for web applications
- and etc.
I’m working with a friend – helping him with some dynamic coding – on a web site. The web site was put together by a different webmaster and it functions. The clients needs have changed over time, and changes are need to the site to comply with a few legal things (it deals with housing.) As I begin looking at the PHP code, I can tell the person who programmed it was very intelligent, but fell prey to some of the things that irritate me, and create problems when trying to update the code as I’m doing now.
First, they didn’t comment any of their PHP code, second they did make use of arrays, but did a poor job of it, and they posted all of the forms back to themselves, which brings me to the point of this post. Use more than one file if you have to, and don’t be afraid to do so. Here’s the problem with posting a form back to itself.
About two years ago I started working for a local web firm. It was small, at that time there we’re only 3 of us, and I was the only PHP developer on staff. We had one client who used our services, combined with another web vendor. Normally we just spit out regular static HTML pages for them, until one day something happened, and we were passed a job that required editing some PHP code from the other vendor.
I honestly don’t remember who the client was, or what the PHP that I was editing was used for, all I remember is that it was the worst code I had ever come into contact with. Nothing made sense, the coding method was random, nothing was optimized, and I wanted to re-write the whole thing and start over. Time did not permit a total re-write, so I was stuck editing the nasty code that was before me. So as I made my edits, I started commenting the code, it went something like this…