I’m using the jQuery plugin from http://bassistance.de/jquery-plugins/jquery-plugin-validation. The plugin is greate. I did run into a problem with arrays. Say your form has a group of checkboxes or radio buttons and their names are checkbox or radio. To have them be in the same group, their names have to be the same and to process it using PHP as post variables you have to throw them in arrays. So in the form their names will be checkbox or radio.
In your validation you probably have something like
I’ve been trying out the demo for Artisteer 2 and it’s great. Creating templates for popular CMS softwares such as WordPress, Joomla, and Drupal have never been easier. I’ve done some playing around with manually creating a WordPress template and it’s not too bad. The WordPress documentation is fairly easy to follow. But doing it in Artisteer is a lot quicker. There’s 2 versions of the software, a home/academic edition that will create WordPress templates for $50 and a standard edition that will allow you to create templates for the other CMS (Joomla, Drupal, etc) for $130. So far I only need the home edition since I use WordPress but at work we also use Joomla. I don’t normally create the layouts at work so I’m hesitating to buy the home edition. I have sent them an email to see if there’s an upgrade path from home to standard and the cost. My work will not pay for the software and if they do, it will take such a long time to get since they only purchase things through purchase orders (sigh).
Now I’ve been curious about Dreamweaver CS5. I’m currently using CS3 with Espresso. I rarely use Dreamweaver’s auto coding – it’s too bulky. I like coding by hand. Espresso is great for that and it’s lightweight and fast. It just doesn’t have the design view tab like Dreamweaver does. Adobe also has a student/teacher version of the software for only $150. I’m downloading a trial version now and will check it out. I’m curious about the CMS code “sniffer” that they have.
I’ve been searching for a way to create a wrapper page within WordPress without having to install a plugin. I browsed the WordPress files and found wp-blog-header.php in the root install directory. It’s really simple.
I’m not sure when this was implemented. All of the articles I found online mentions plugins that had to be installed or creating a new page within the WordPress admin GUI then include a file, etc. I just need to create a custom PHP file that will display the header, sidebar, and footer.
Depending on the theme you are using will determine additional code between each section (header, sidebar, footer). So check out the page.php or index.php of the theme you are using to see how it is structured.
Two queries will be used for this task. The first query, you will count the rows of the recordset. The second query is the same as the first but it will have the LIMIT – this is what will be used to display the data on each page.
Let’s say we have the following table.
Now we’ll query the database and get the row count using PDO.
If you don’t use the bindValue, you will get an error in your query. Your second query would look something like this….
…and the error would occur right after LIMIT. You cannot have quotes surrounding the numbers. It took a few hours of Googling but found the solution.
Jeff called me up asking for help with his dedicated server on Godaddy. He needed to update his PHP 5.1.6 to the latest stable version. His server is running Centos 5.2 (Final). He tried to call Godaddy for assistance and of course they were no help. I’m no expert myself but have played around with different systems. I found out that you can use the yum command to manage the installed packages. The problem is that the current repositories yum looks at does not contain new versions of PHP. This is why you get an error that says something like – cannot find PHP. What you need to do is add a repository that does have a newer version of PHP. We’re going to add Jason Litka‘s repository.
Log in to the Simple Control Panel
Log in using SSH
Type “su – ” to log in with root privileges
Type “nano -w /etc/yum.repos.d/utterramblings.repo”. If you’re not comfortable with nano, use whatever editor you’re more comfortable with.
In the utterramblings.repo file type the following [utterramblings] name=Jason’s Utter Ramblings Repo baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/ enabled=1 gpgcheck=1 gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
Save the file and close it
Now you can use “yum update php” and it should update it to the latest that the repositories have
jQuery has many examples and demos on their website and has a large community of developers creating plugins. One of the things I needed to figure out was how to pass form variables using jQuery. I found a sample code on their website but I just couldn’t get it to work – http://docs.jquery.com/Ajax/jQuery.post. I couldn’t pass the form variable over. Their sample code was
So I started to play around with it more and was able to get it to work. Here’s the new code now based on the example.
After reading a few comments about this function, a couple suggested to use serialize() but I have yet to figure that out. At least my variables are passing as they should. The same syntax for the variables can be applied to $.get.
If you are going to copy to code above, make sure you are using apostrophes. For some reason, it’s displaying the “tick” symbol which is the one sharing the key with the tilde ~ on your keyboard. It looks like an apostrophe but more slanted. So be aware of that.
A client at work wanted us to create a way to duplicate existing records on their website with a click of a button. These records involve multiple tables in the database. Some of the tables contained a lot of columns. We tried to do most of work using ASP but sometimes the browser would time out and Dreamweaver would crash.
Then I thought, why don’t we have our SQL server do most of the heavy lifting. I created a stored procedure that query the database for the record(s) that need to be duplicated and have them duplicated. Below is a short example to get you started.
First you need to create a stored procedure in SQL Server.
Next you need to create the ASP page that process the request. You can use form variable or URL query string. For the example, I will use a form variable. Let’s imagine on page1.asp there is a form with a hidden variable that contains the record_id you want to duplicate. You submit this to page2.asp and here’s a sample of what page2.asp should look like.
What page2.asp does is it takes the form variable “record_id” from page1.asp and tells the stored procedure to get the values for this record and insert it as a new record. That’s pretty much it. Just a short, simple example on how you can create a stored procedure in MSSQL Server and use it with classic ASP.