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

Changing Ports WAMP

If you installed WAMP without changing anything then your default port would be 80. So if you want to change your listening port simply follow this instructions.

1. Left click on the WAMP icon on your system tray.
2. Go to Apache then click on the httpd.conf option.
3. Press Ctrl+H to open the replace function of notepad.
4. Enter 80 on the Find What field.
5. Enter your desired port on the Replace with field.
6. Click on the replace all to replace everything.
7. Save your httpd.conf.
8. Right click on your WAMP icon on the system tray then exit.
9. Run WAMP again and now your port is 8080. You can access your localhost by using this address on your browser http://localhost:8080

MySQL GUI Tools + WAMP

To integrate MySQL GUI tools on WAMP follow the instructions below.

1. Download the GUI Tools to be used on this page.
2. Download the one with the “Without installer (unzip in C:\)”.
3. Extract the one you have downloaded.
4. Copy it to your C:/wamp
5. Click on Start and then run.
6. Key in regedit then press enter.
7. Go to HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > Services > wampmysqld
8. Right click on the ImagePath.
9. Take note of the value because the version of MySQL might change. For example mine is.

c:\wamp\bin\mysql\mysql5.0.51a\bin\mysqld-nt.exe

change it to

c:\wamp\bin\mysql\mysql5.0.51a\bin\mysqld-nt.exe –defaults-file=c:\wamp\bin\mysql\mysql5.0.51a\my.ini wampmysqld

Your MySQL GUI tools should work now. This solution also solves the Either the server service or the configuration file could not be found. Startup variables and service section are therefore disabled problem.

Get Google pagerank with PHP

This code will fetch the google page rank of a certain website. Just save this class below as pagerank.h then you can just include later on when you want to use it.
Read more »

Get Alexa Rank with PHP

This code will get your Alexa rank, reach and links in.
Read more »

RSS on Address Bar

Did you notice the RSS logo on my address bar? Well that logo symbolized that I`m using an RSS Feed in my site. Whether its valid or not the logo appears on the address bar. But I`m using a valid RSS Feed you can check it out here. See? Well you might be wondering on how to put the RSS logo on your address bar. You simply put this code between your head tags.

<LINK REL="alternate" TITLE="VIEW MY RSS" HREF="http://karlpox.com/rss.xml" TYPE="application/rss+xml" />

Just analyze the code above and change it to something that would satisfy your needs. Have fun coding!

PHP Discovery

I just discover a shortcut with PHP and MySQL. First I`ll discuss my problem with you. My problem was I wanted to create a array in my database that would support all the categories my post would need.

For example this post is under the category PHP+MySQL and Tips & Tricks, and I don`t want to create a new table for that so what I did was put everything under 1 field kinda like an array on your database.

For example PHP+MySQL has an ID of 1 and Tips & Trick has and ID of 2. So when I save it it looks like this ,1,2,. Now the data type of this is varchar. So it would be saved in my database like that. So when I want to use that data to view all my categories I simply use the explode function. And since its a varchar after the using the explode function it would automatically be transformed to an integer which I can use as a foreign key to access the ID number on the category table

<?php

//Im using the example above under the variable example.
//Im using the explode function that would break the string every occurrence of a comma (,)
$example = `,1,2,`;
$temp=explode(`,`,$example);

//Use the sizeof function to get the array size of the array $temp
$size=sizeof($temp);
//Increase the $size due to excess of , in the string
$size--;

//I use connect.php to connect directly to my database. Its much easier that way.
include(`connect.php`);

//start with 1 because the string started with a comma.
for ($a=1; $a<$size; $a++)
{
//Your query.
$q="select * from category where cat_id like `$temp[$a]`;
$r=mysql_query($q);
$row=mysql_fetch_array($r,MYSQL_ASSOC);
//Output
echo $row[`cat_name`].`<br>`;
}

?>

By this code I simple broke the string $example to be used as a foreign key for my category table. Take note that the $example variable also came from my database which is my way of saving an array. Hope you get the idea!

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!

Search a string in a string PHP

This is how you search a string from a string. For example you have this sentence.

“I went to the mall yesterday.”

So lets store that in an variable.

$source = "I went to the mall yesterday.";

Now lets look for the word mall. To do that analyze the code below.

if ( strtr($source,"mall") )
{
echo 'String Found!';
}
else
{
echo 'String not Found!';
}

Hope this code can be useful!

Using the explode function PHP

We can use the explode function to separate a sentence into two or more. The string is being separated via a string too.

The explode function will look for a string in a string and separates the string when he encounter the string it is looking for.

To use this function lets take this string for example.
Read more »

Replace a character in a String PHP

This functions replaces all the character in a string to a new character set by the user. So if the string contains 10 character `a` in a string and the users wants to replace it with `b` so all the letter `a` in the string will now then be letter `b’.

So to use that function.
Read more »