ad box 728 x 90
ad box 468 x 60
Hardware, Software, Code, PHP, ASP, Games, Reviews and Other Funky Stuff
Subscribe

Enter your email address:

Pic of the Month
Popular Posts

Archive for the ‘HTML’ Category

KruxorWP 1.0 wordpress theme released

KruxorWP Screenshot

I know its a bit on the simple side, and i have included the logo at this stage. But just wanted to get something out there, its still just a work in progress type of theme to see what i can produce when i give it a shot ;) .

There is a list of changes already that i will add when ever i get some spare time:
- option to disable or change the kruxor logo, (this can be done with a small amount of html editing).
- Inclusion of ad code in the header instead of the logo. The divs are already in place for both size header ad’s. Called header_ad_box_728 and header_ad_box_468, both are set to display:none for the moment, so if you want to put some ad’s in there just paste in the ad code in header, and change the style.css, remove the display:none line.
- Heaps more general formatting of stuff…

All tested out to be HTML5 and W3C compliant.

Check it out Here, KruxorWP Theme v1.0

Extracting a zip file using PHP and Unzip

Ok here is a problem that has been annoying me for a while. Just in a personal project that im working on, and i finally sat down and figured out how to do it via PHP.

Now this is probably easy and known for most people but if you don’t know how to do it keep reading…

The challenge was, extract multiple files from a passworded zip that’s attached to an email. I know sounds easy, but what if you want the server to do it for you? Now this is running on a hostgator account with default settings and probably execute allowance as well.

After a few trial and errors the following code worked for me, this is the long winded version of it, you can shorten it if you like…:

1
2
3
4
5
6
7
8
9
10
11
12
13
<?php
$zip_name = "file.zip";
$pathtozipfle = "upload-path";
$destinationdir = "upload-path";
$passw = "password";
 
$extract_command = "unzip -P $passw $pathtozipfle/$zip_name -d $pathtozipfle/";
 
echo "Running: $extract_command"; // note probably better and safer to not echo this line as it will reveal the password. But as this is very insecure anyway it probably does not matter too much.
echo "<br><br>";
echo system($extract_command);
echo "<br><br>";
?>

Anyway this extracts file files with no major issues. If you want it to run without returning any data to the screen just run:

1
2
3
<?php
system($extract_command);
?>

If you would like to see what other options are available, and your version of unzip you can run:

?Download unzip.php
1
2
3
<?php
echo system("unzip -Z");
?>

Using the drop shadow CSS technique

So apparently this has been around for years and years, since 1996 or something. Well i just discovered it (again). I remember something about this property some time ago, and then i forgot about it. Well no more! Apparently this is not enabled in “all” browsers yet, but hey. if you cant see it, it just doesn’t look as cool. So it degrades pretty well.

And the code is:

1
2
/* CSS to style all H1 tags with a white shadow */
h1 { text-shadow: 1px 1px 1px #FFF; }

^ this will insert a 1px white shadow with 1px of blur.

the breakdown for this is:
text-shadow: 1 2 3 4;
1 = The X-co-ordinate
2 = The Y-co-ordinate
3 = The amount of blur radius
4 = The shadow color

In some browsers you can even stack the shadows for some cool lookin fire effects and ice, play around with it to get some cool stuff going on!

For the title of this blog i used:

1
text-shadow:0 0 4px #ccc, 0 -2px 4px #e49649, 0 -4px 4px #b1552f, 0 -6px 6px #933d23;

makes it look nice and flamey ;)

Looks better with a black background:

makes it look nice and flamey ;)

Or you can add some ICE.

code:

?Download p_style.html
1
<p style="background: #000; color: #fff; padding: 10px; text-shadow: 0 0 4px #ccc, 0 -2px 4px #c3ccf4, 0 -4px 4px #8495e0, 0 -6px 6px #286fb8; font-size: 14px;">Mmmm Icey Flame Action</p>

demo:

Mmmm Icey Flame Action

I think the stacking of shadows does not work correctly in browsers like safari, but they may have fixed this issue by now (hopefully)

Just the standard shadow makes headlines look really neat.

1
<p style="text-shadow: 1px 1px 1px #EEE;">Cool Text Shadow</p>

Cool Text Shadow

Anyway thats my take on text shadows, pretty easy when used with CSS!