homeHome contactContact portfolioPortfolio musicMusic videoVideo historyHistory calendarCalendar rssRSS
karlpox | with GOD all things are possible

Friendster Project

Friendster System

Well our Advance Web Programming is now finally over since we already have submitted our final project.

Me(Karlo), Jopal & Brylle decided to make a UIC friendster system. Well its not packed with all the feature the real friendster has but its working properly. I could still add some features on it if my group mate decides to make it a real website with its own domain name (www.uician.net). So don`t expect much from our system. Here are some of the working features that our friendster system has.

- Register & Login
- Edit profile
- View Your profile & so with others
- Search for users via (email, last name, first name)
- Add users upon search or exploring (user must approve)
- Add testimonial (user must approve)
- Private Message
- Upload Photos
- Comment on Photo (will be accepted automatically)

This system still needs a lot of improvement. Maybe we will update this depending on Jopal & Brylle maybe Ronald too. Have fun!^_^

Click here!

My Blog Reading Level

blog readability test

Movie Reviews

Well I just started my new blog on March 12, 2008 and now its March 24 so my blog is 12 days old. So i decided to know whats the reading level for my blog and yes i got a very low score which is for Elementary School. I guess Elementary students can understand programming language as well. ^_^

How addicted are you to blogging?

78%How Addicted to Blogging Are You?

I got really bored last night so I went blog hopping. And i cam across this image on Alma`s Blog. So i took the 14 question to know how i`m addicted to blogging well im 78% addicted to it while she`s 95% addicted to blogging. Well you check the page out by clicking the image have fun! ^___^

RSS Feeds Online!

Just a little update before i go to sleep. I`ve managed to create my own RSS feed for my post and my comments thanks to google. You can visit my rss post feeds here and my rss comments feeds here. I`ve worked for quite some hours just to finish the rss feed. You can validate my feeds using this two validator i found on the web, http://feedvalidator.org and http://validator.w3.org/feed. And I have edited the home link to be redirected to http://karlpox.com and i started on the review me page but as you can see its still under construction if you click on the register button! Well thats about all the things i`ve done today.

For some of you who didn`t know i coded this site/blog from scrap. Yes this is NOT a wordpress blog or any kind. Its a customized blog coded & designed by me. I know its not that good or anything but I was able to apply everything i know into it. Well thats all. Thanks for visiting my blog once again!

AJAX updates on my blog

Well I did some minor updates today. Ive created the comments & testimonial page on the admin side with AJAX, the comments and testimonial page can both be use to monitor, edit & delete comments/testimonials. The AJAX feature is Kinda similar to a wordpress blog except for the effects ofcourse. Next i have enabled AJAX also in my search bar which can be found on header of my page. But you still can search yet the page is not yet finish. But will fix that page in a while so viewers can use the search function already. Well thats most of the stuff i have coded for today. Thats all! Thanks for visiting my blog! ^___^

AJAX on Comments

Well not a big update but i worked very hard for this update. Took me 3 Days to make this right. Didn`t expect AJAX to be this hard. I can even understand a single line of it. But as you can see i have implemented AJAX on my comments which can be viewed in every page if you click on the title of the post. Before, once you have click on the Post! button the page will just load and post your comments on the page. Now since AJAX is enabled there after clicking the Post! button your comment will be posted automatically and will also be saved in the database. Haven`t tested it for bugs yet but its working fine for now, do inform me if you find any bugs in my blog.

Using Sessions

How to use sessions

What is session anyways? According to php.net session is a “way to preserve certain data across subsequent accesses. This enables you to build more customized applications and increase the appeal of your web site.” As for me session is like a super global array which can be passed to different pages using the session_start() function. Sessions are very useful especially an on page that requires users to be logged. Because sessions can track weather a user is still logged or not. So let’s get started using sessions in log in cases.

First of all you have to insert the session_start() function at the most top of your coded. So it must be found on line 0 of your codes. For example.

<?php session_start(); ?>

But some servers like mine displays error even if the session_start() is already at the most top of your code so you add this to your code to solve this problem.

<?php
session_cache_limiter(`nocache`);
session_start();
?>

And you need to do a session_start() on every page if you want the user to be logged in order to access the page. So now how do we determine if the session of the user is still active or not? So after you check if the username & password of the user is correct you create a session for the user to know if the user is still active or not. So after checking if the user is valid you do this.

<?php
$_SESSION[`active`] = true;
?>

The word `active` is not constant, you can change it to anything you want. You can even change it to something like $_SESSION[`weeee`] = active; it really doesn’t matter as long as you remember it. So to check if the user is still active, on every page that requires a user to be logged at the most top you do this. Read more »

Minor Updates

Added some buttons on the index of my page & for every post viewed. Buttons added are as follows: Digg it, Del.icio.us, Furl and Technoroti. By these viewers can now easily bookmark my posts. Still fixing my RSS Feeds pages having problems with writing files into my server via php. But i will solve this soon so stay tuned. And im gonna edit the page View by Category & the View by Date to make it more simple. Thats all thanks for visitng my page!

Avoiding Repost on Refresh

Thanks to Ronald Borla and Google for the idea.

To avoid reposting datas from your form if your going to refresh the page. This problem is very common on forms being submitted to the same page where the form is. The simple solution to this problem is to make a unique session for ever form being submitted. Analyze the code below carefully and you can apply it easily in your website.

<form action="" method="POST">
<input type="hidden" name="uid" value="<?php $_SESSION['uid']=uniqid(); echo $_SESSION['uid']; ?>" />
<p>
<label>Message: </label>
<input type="text" name="msg" />
</p>
<input type="submit" value="Submit" />
</form>

As you can see we have created a unique session via the uniqid() function. Since you are refreshing on the same page make sure to have this on the same page as well most commonly above the form.
<?php
if ( $_POST['uid'] == $_SESSION['uid'] )
{
//your code to be process will be here
//and after processing your code you create another unique session id>
$_SESSION['uid'] = uniqid();
}
?>
 
By those code above you are guaranteed you will avoid reposting of datas upon refresh of page.

A Simple Login Code using PHP+MySQL

First of all you must create a table. For a example we name this table as member.

id username password
1 karlo 123
2 toni 143

So first you must create your own form. That looks like any ordinary login box with a username, password and a login button.

<form method=”POST” action=”">
<p>
<label>Username: </label>
<input type=”text” name=”username” />
</p>
<p>
<label>Password: </label>
<input type=”password” name=”password />
</p>
<p>
<input type=”submit” value=”Login” />
</p>
</form>

As you can see i have set the action=”" to empty so you have to change it to something like process_login.php or any .php page that would verify if the user input is valid or not.
Read more »