Get Next Auto Increment on Code Igniter

Code Igniter October 30th, 2008

Today, I got problems to get next auto increment with Code Igniter. In this case, I tried to provide link to view current post page, after users post his blog. For example: blog table contain fields id, title, and body. I used auto increment for id and id as primary key. Users will only fill title and body on form available, and id will automatically auto increment on MySql Table. So I can’t send id by post method.

Well in this case, I need to get next auto increment to detect id on current user post. Why? because I usually sent post id parameters on url. For example: http://localhost/blog/fullpage/45 with base http://localhost/. So, post id placed on segment(2) of uri. Then I make query from table blog where id = uri segment(2) to get fullpage post where id = 45.

Read the rest of this entry »

Sphere: Related Content

Tags: , , ,
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Which One Better? Still confusing…

PHP September 19th, 2008

I plan to migrate to PHP Framework, but I’m still looking for Framework that i need. I need to make big application for my next project with PHP. I had try cake and code igniter, but I don’t know which better? My lecturer suggest me to use code igniter, but he’s also suggest me to use Zend or Symfony for better result. Hmm.. I really confusing with it, because i don’t have MVC background in my mind. So I learn by doing.

One day, I tried to searching in Google to find the solution, and I comparison chart for PHP Framework  from http://www.phpit.net/demo/framework%20comparison/chart.php. But I don’t know it’s up to date or not.

Read the rest of this entry »

Sphere: Related Content

Tags: , ,
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Color Cube With PHP

PHP September 17th, 2008

This is not my original idea.. But it’s very useful. For this trick idea, I grab from some banner generator site. Sory I’m forgot about this site. Then, I try to modified it with my knowledge about PHP. With this trick, you can make simple color cube. Like you know, some site used JavaScript to make a color cube, but I’m not really familiar with JavaScript. So I did it using XHTML and PHP.

First you need select and option tag in XHTML to reprensentated color cube.  Make any option for RGB value and modified each option to RGB value. So user can choose some color by looking on this option. Lookout this script bellow.

Read the rest of this entry »

Sphere: Related Content

Tags: , ,
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Create User Log

PHP September 8th, 2008

Today, I tried to make user log with PHP. User log is used to save information about visitor, like IP address and web browser. User log saved in html file. So you don’t need databases like MySQL. In this user log script, we need date() function (to set time) and variable like $REMOTE_ADDR to get IP address from user and $HTTP_USER_AGENT to know web browser in user. Usually this script must be place in index of web site (index.php). Then you need to created log.html file to save user log.
Read the rest of this entry »

Sphere: Related Content

Tags: ,
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Paging With PHP [Part3]

PHP August 11th, 2008

In this post, I’ll modified paging with PHP part 1 and part 2 with adding next and previous link or first and last link. Just little modified on paging with PHP part 2. So you can get next page, previous page, first page and last page easily. Let’s try^^.

There are two scripts added on paging with PHP part 2. First script is used to make First and Previous link.

Read the rest of this entry »

Sphere: Related Content

Tags: , ,
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Blogroll Link Update