Posts Tagged ‘ php ’

Framework Envy

A friend and I were considering embarking on  a small quest to begin a start-up.  We had an idea that we both liked and saw a market for product.  I jokingly mentioned we should use one of my favorite PHP frameworks, CodeIgniter and he quickly said No.  I was taken aback by the response and asked why the flat No.  I learned it amounted to he was comfortable with the faults of his framework, that being Zend and didnt want to branch out.

Im sure he had other issues with my framework of choice, but it made me wonder.  He generally comes off as a person who will try something new out and give it a spin, but he was geninuely against using Codeigniter.  Maybe its not the “enterprise solution” he uses. Im further curious because he has grips with having to append every function with Zend, and the lack of documentation.  Codeigniter on the other hand has very well documented functions and the naming convention is much improved when compared to Zend.

Im curious what PHP frameworks have you used? Would you try another one of the big frameworks, there are tons of smaller ones with less support and community.

»crosslinked«

Category: Uncategorized | 1 Comment »

Quick Post: Django vs Grails

Coming from the Django world, I can already see big similarities.  They both provide database abstraction for example, they allow the developer to essentially create a database and minimize the amount of SQL code needed.  From what I can tell, the two are very similar, and this does excite me.  Also makes me feel at home with Grails.

My temptation however is to compare these frameworks back to PHP, which is a largely unfair comparison.  Therefore, I will leave that discussion for another day.

After downloading Grails, my first impression was installation should be the easiest part of imparting on new framework, with Django, it requires issuing setup and Django takes it away configuring and installing the necessary items.  However, Grails requires a bit more manipulation to get it going.  I found a good resource and should be on my way.  More details as I get further into Grails.

Category: Coding | 2 Comments »

Why use an array?

Recently, I asked myself the same question.  You might be wondering, what is an array.  According to Wiki:

In computer science an array [1] is a data structure consisting of a group of elements that are accessed by indexing.

What does that  really mean?  Well, I’ll explain by using an example I got off one of the programming forums I frequent, SamponVideos.com. I will actually quote some of Johnathan Sampson’s message because it captures the idea.  In his example, if you were creating a an image uploader, and you did not want to allow executable files, you would do something like this:

$fileTypes = array("jpeg","gif","jpg","bmp");

Without the use of an array, it would turn into this:

if ($fileExtension == “jpeg”) {
# Approved
} else
if (
$fileExtension == “gif”) {
# Approved
} else
if (
fileExtension == “jpg”) {
# Approved
}

Or this:

if ($fileExtension == “jpeg” || $fileExtension == “gif” || $fileExtension == “jpg”) {
# Approved
}

The array makes the code, much easier to handle, and looks cleaner.  Have you used arrays in your projects?

Category: PHP Script | Comments Off on Why use an array?

Easy Site-Wide Link Updating

As I have created more websites, I have come to love includes.  They are useful when you need to use one file repeatadly.  For instance, you may want the same navigation scheme across a site.  It would be troublesome, or bothersome to insert you navigation code on each page.

What happens when you add or subtract a page? You would have to change every single page.  9 times out of 10, you always miss at least one page.  There are other situations where using an include would come in handy, but those are more programming oriented.

You will need:

  1. PHP (in this case), or ASP based server
  2. Main Page
  3. Navigation Page

This code requires the use of PHP, on the main page you need  to write, and so this page must end in .php, for example, index.php.  The ending php tells your server it needs to do more work with that page before displaying it.

Whenever you are using a PHP tag, you must enclose it in

<?php **Place Code Here** ?>

On the every page you want this content to appear insert the code:

<?php include(“file directory here/link.html”);  ?>

This tells the server to include “file.html” in that place on the page. Now, you create “link.html”.

<ul>
<li><a href=”index.php” title=”Home”>Home</a></li>
<li><a href=”contact.php” title=”Contact Us”>Contact Us</a></li>
<li><a href=”location.php” title=”Location”>Location</a></li>
</ul>

Now upload these pages to your webserver and only update “link.html” as needed.

Category: PHP Script | Comments Off on Easy Site-Wide Link Updating

Automatic Copyright Updating


Many people who design websites put copyright dates on every page of their website.  By inserting this snippet of code your site will bringing in the new year with an up to date copyright date.

Today this snippet will output Copyright 2008 Resnodesigns and next year, it will greet the New Year with Copyright 2009 Resnodesigns.


Copyright <? echo date("Y"); ?> Resnodesigns
Category: PHP Script | Comments Off on Automatic Copyright Updating

What are PHP and ASP.net?

Recently, I have been having alot of questions about what PHP and ASP.net are and how do they help on a site.

What are PHP and ASP.net? Why do I care?

1. What are PHP and ASP.net?

1. Well, when you want to use a shopping cart, forum, or anything outside of a static website it requires the server to do something. For example, this blog is written in PHP, because I can add blogs and I do not have to edit the html code.

2. What’s the difference between PHP and ASP.net?

1. PHP generally is used by people like us, who design and build websites.

2. ASP.net is generally used by big corporations. They like ASP.net because it is backed and supported by Windows.

3. Now, why do you care?

1. Does your business want to sell products online?

2. Do you want a forum or other social networking system? (Facebook, Myspace, YouTube, etc.)

3. These types of sites require the server to handle parts of your site because html can not do it alone.

 

Category: Hosting | Comments Off on What are PHP and ASP.net?

|

Flickr Photos

Quick Contact

Your Name (required)

Your Email

Your Message

captcha