iBlog random » Web http://blog.zurka.us Just another WordPress weblog Tue, 28 May 2013 20:28:47 +0000 en-US hourly 1 http://wordpress.org/?v=3.6 A new type of phishing attack http://blog.zurka.us/a-new-type-of-phishing-attack/ http://blog.zurka.us/a-new-type-of-phishing-attack/#comments Tue, 14 Sep 2010 08:22:24 +0000 nasal http://blog.zurka.us/?p=1108

An interesting read, beware of evil hax0rz, they are getting smarter and smarter!

Read about Tabnabbing: A New Type of Phishing Attack at azarask.in.

]]>
http://blog.zurka.us/a-new-type-of-phishing-attack/feed/ 4
Generate QR Codes with php (EASY) http://blog.zurka.us/generate-qr-codes-with-php-easy/ http://blog.zurka.us/generate-qr-codes-with-php-easy/#comments Thu, 24 Jun 2010 22:30:19 +0000 nasal http://blog.zurka.us/?p=1079

There you go, a function that will generate a QR Code with the help of a function hosted on the Google API servor.

function generate_qr($url, $size ='150', $imgsize = false, $EC_level='L', $margin='0') {
    $url = urlencode($url);
    return '<img src="http://chart.apis.google.com/chart?chs='.$size.'x'.$size.&cht=qr&chld='.$EC_level.'|'.$margin.'&chl='.$url.'" alt="QR code" width="'.($imgsize ? $imgsize : $size).'" height="'.($imgsize ? $imgsize : $size).'" />';
}

You call it like this:

<?php echo generate_qr('http://blog.zurka.us'); ?>

And get something like this:

blog.zurka.us qr code

Try pointing your favorite code reader at it!

PS: I just noticed that it doesn’t work well because of the dark background, try it here.

]]>
http://blog.zurka.us/generate-qr-codes-with-php-easy/feed/ 4
JW Player – 60% Discount Offer http://blog.zurka.us/jw-player-60-discount-offer/ http://blog.zurka.us/jw-player-60-discount-offer/#comments Tue, 22 Jun 2010 13:10:40 +0000 nasal http://blog.zurka.us/?p=1077

June Offer
JW Player License Discount
Get 60% Off all player, skin and plugin licenses

If you use the JW Playerâ„¢ on a site that: Runs ads; promotes products or services; or is owned by a corporation, then you should purchase a license. Plus, a license will allow you to remove the JW Playerâ„¢ watermark.

So please, support player development and order a license today, using discount code jun10dis60. 60% off until June 30th.

]]>
http://blog.zurka.us/jw-player-60-discount-offer/feed/ 0
Change the location of your external links with MooTools http://blog.zurka.us/change-location-your-external-links-mootools/ http://blog.zurka.us/change-location-your-external-links-mootools/#comments Fri, 11 Dec 2009 18:02:52 +0000 nasal http://blog.zurka.us/?p=1050

So a thing I was trying to do for quite some time now but using php and rexep, which I hate and don’t understand at all, was trying to change the location (href) of all the external links on my page to something else so I could easily track the clicks. Or maybe display some kind of toolbar on top of the page, something like I guess digg does.

Today I remembered that MooTools is my friend and I could use it to accomplish this.. and after 2 minutes and 5 lines of code I did it!

I’m guessing you already have MooTools up and running. Let’s take a look at the code.

$$('a').each(function(link) {
    if(link.hostname != window.location.host) {
        var loc = link.get('href');
        link.set('href', './out.php?' + loc);
    }
});

So we create an array of all the links on our site and check if their hostname is the same as the hostname of our site. If it is different we read the value of href (the link) and change it to our php script that is going to track the click (or whatever) and add the previous link, so it knows where it should be redirected.

This is it! Easy peasy!

Oh and have a happy December!

]]>
http://blog.zurka.us/change-location-your-external-links-mootools/feed/ 0
More Google Wave invites http://blog.zurka.us/more-google-wave-invites/ http://blog.zurka.us/more-google-wave-invites/#comments Thu, 19 Nov 2009 23:26:39 +0000 nasal http://blog.zurka.us/?p=1048

Hey guys!

If you still don’t have your invite for Google Wave, I’ve got a good news for you: I’ve got like 25 invites and will give them away.

Just post a comment with your email address!

]]>
http://blog.zurka.us/more-google-wave-invites/feed/ 21
MySQL variant for PHP’s in_array http://blog.zurka.us/mysql-variant-for-phps-in_array/ http://blog.zurka.us/mysql-variant-for-phps-in_array/#comments Wed, 29 Jul 2009 13:54:56 +0000 nasal http://blog.zurka.us/?p=1021

So you have an array, let’s call it $array.

$array = array('one', 'two', 'three');

And you want to do a MySQL query that will check if one of the values in the array are present or similar or whatever. In PHP it would look like this:

if (in_array('one', $array))

and it would return true. Now to do this in MySQL we can use (along other things but I use this one) the IN statement.

mysql_query('select something from table where one IN ("' . implode('","', $array) . '")');

Why is this useful? Let’s say you’ve got an array of file extensions (pictures) and you have a database with some files in it, pictures, music, videos. You want to display only the pictures, because you want to display the last 15 uploaded pictures. Let’s say you have the filename and extension (filename = hack.jpg) stored in your database. Let’s see an example of what you could do…

mysql_query('select id, name, filename from uploads where substr(filename, -3) IN ("' . implode('","', $pics) . '") order by id desc limit 12');

And that’s it. Easy peasy!

Have swing!

]]>
http://blog.zurka.us/mysql-variant-for-phps-in_array/feed/ 1
How to Create a Belcher Button http://blog.zurka.us/how-to-create-a-belcher-button/ http://blog.zurka.us/how-to-create-a-belcher-button/#comments Thu, 04 Jun 2009 10:39:15 +0000 nasal http://blog.zurka.us/?p=990

If you are wondering what a Belcher Button is, it’s that ugly button that you see on sale pages usually. The one on the thumbnail. Yes, that BUY IT NOW / ADD TO CART button, that people tend to click in order to purchase what you are selling.

If you still don’t know what it is about, you can take a look at Belcher’s video on facebook about it and see why it works.

And today I’m going to show you how to make one by yourself with simple HTML and CSS.

Live Preview

Let’s see the code now and I will then explain it to you:

HTML

<div class="buttonContainer">
    <h1 class="buttonHeader">"Name of Your Product"</h1>
    <div class="buttonBorder">
        Regular Price <del>$300</del> Today <ins>$99</ins>
        <a href="#" class="addToCart">Add To Cart</a>
        <a href="#">Add to Cart</a>
        <div class="buttonIcons">
            <img src="http://www.railroadforum.com/forum/icon_smile_visa.gif" width="30" />
            <img src="http://www.cruisedeals.co.uk/img/icon_mastercard.gif" width="30" />
        </div>
    </div>
</div>

CSS

.buttonContainer { width: 400px; margin: 0 auto; font-family: tahoma; }
.buttonHeader { text-align: center; color: #C70311; margin-bottom: 10px; }
.buttonBorder { border: dashed 3px #C70311; padding: 10px; text-align: center; font-size: 15px; }
.addToCart { display: block; width: 200px; padding: 5px 10px 2px; margin: 5px auto; font-size: 25px; background: #FCD629; border: solid 2px red; color: navy; text-decoration: none; }
.buttonIcons { margin-top: 5px; }

Now, as you can see I decided to use classes instead of ids for the elements. This is because usually sale pages MUST have more than one of these buttons and ids must not repeat. Marketers say, that it must include AT LEAST three (3) of them, because a lot of people decide to buy only after they see the call to action for the third time.

I must admit the button does not look exactly as his, because I decided to make it entirely in css without using a background image. You could easily reproduce his effect by making a background in photoshop and setting it in the css code.

And for this example I’m just hotlinking the credit card logos, you should download their original logos and use those.

Once again another easy tutorial for ya.

Have swing!

]]>
http://blog.zurka.us/how-to-create-a-belcher-button/feed/ 3
Help me Test my Mailing List System http://blog.zurka.us/help-me-test-my-mailing-list-system/ http://blog.zurka.us/help-me-test-my-mailing-list-system/#comments Thu, 28 May 2009 10:55:15 +0000 nasal http://blog.zurka.us/?p=942

I’m developing my very own mailing list system and need you to help me test it :) All you have to do is subscribe to it on the right, it is free, quick and doesn’t hurt (you will also get a verification email, which you should check and click the link included).

Since it’s new I need a lot of people to test the mail queuing and other stuff.

If you would like to be a beta tester (:D), test it and create your own campaigns I can give you access for free.

It is something like aweber but since I don’t have access to it I’m developing it on my own, differently.

Features in v0.3

- add and edit campaigns
- subscribe, verify and unsubscribe
- an automatic email is sent on subscription and verification
- possibility to send an email to every subscriber in the campaign
- you can add links so you can track clicks on them
- email scheduling
- email importing (deletes duplicates and incorrect addresses)
- possibility of embedding the subscription form anywhere
- possibility of redirecting the user to your own thank you page on subscription
- possibility of sending attachments
- html support
- you can attach a file to send when the user verifies his email
- teoretically the mail queue should work if you try to send an email to more then 50 users, but it is untested

Wanna test? Drop a comment!

]]>
http://blog.zurka.us/help-me-test-my-mailing-list-system/feed/ 1
How to Have an Opaque Text on a Transparent Background http://blog.zurka.us/how-to-have-an-opaque-text-on-a-transparent-background/ http://blog.zurka.us/how-to-have-an-opaque-text-on-a-transparent-background/#comments Fri, 15 May 2009 14:56:17 +0000 nasal http://blog.zurka.us/?p=632

This is what I’m going to show you how to do:

This is Kakashi from the Naruto anime.

It’s a nice effect that can be used for many things, for a nice gallery or something. You could combine this with some JS, add a hover effect to the picture and have it display the caption.

edit: theodin posted a comment with a link to this kind of effect, check it out at buildinternet.com

This is a pretty simple trick that works in different browsers except for older IE versions I think (because IE seems to hate transparent png’s). Btw, RIP, IE6.

Let me show you the code and then explain how it works:

<div style="width: 300px; height: 224px; position: relative;">
    <div style="position: absolute; bottom: 0px; _bottom: 4px; width: 100%; background: transparent url('http://zurka.us/bg_overlay_black.png') repeat scroll 0 0; font-family: verdana; font-size: 11px;">
        <div style="color: #fff; margin: 10px; text-align: center; position: relative; z-index: 1;">This is Kakashi from the Naruto anime.</div>
    </div>
    <img src="http://www.quizilla.com/user_images/K/KA/KAK/kakashihatake1226/1158375681_resKAKASHI.jpg" width="300" />
</div>

So basically what we are doing is enclose our image in a relatively positioned DIV element. Inside this element we create another DIV element, absolutely positioned. We stick it on the bottom of it’s parents div, so it goes displayed on the bottom (we could position it on the top if wanted). The background of this div is a semi-transparent black PNG image, 1x1px (http://zurka.us/bg_overlay_black.png). This is our black box, the content holder.

Now what we need to do is add our text to the box. Inside the box we create another DIV, give it a 10px margin (this way it has some space around it), style the text and put it over the other layers with z-index.

And that’s it, we have it done. It’s a simple HTML + CSS effect that I tried to get using different methods (like css opacity and stuff) but didn’t manage to replicate.

Original image: Kakashi at Quizilla

So once again, easy peasy!
Have swing, thanks for reading!

]]>
http://blog.zurka.us/how-to-have-an-opaque-text-on-a-transparent-background/feed/ 4
Check if A Number is Even or Odd with PHP http://blog.zurka.us/check-number-even-odd-php/ http://blog.zurka.us/check-number-even-odd-php/#comments Thu, 14 May 2009 15:04:29 +0000 nasal http://blog.zurka.us/?p=921

I’m going to show you a very simple method for finding out if a number is even or odd in php. You could use this for many things but usually this is mostly used when you have a, let’s say, table and you want to color the background of every second row differently.

The php code looks like this:

if ($number % 2) {
    echo 'The number is even';
} else {
    echo 'The number is odd';
}

In real life we would use something like this:

$i = 0;
while ($something = mysql_fetch_assoc($query)) {
    echo '<div style="padding: 5px; background: #' . ($i % 2 ? 'eee' : 'ddd') . ';">Content</div>';
    $i++;
}

And of course, likewise you could check if a number is divisible by another number using this:

if ($number % 3 == 0) {
    echo 'The number is divisible by 3';
} else {
    echo 'The number is not divisible by 3';
}

Easy peasy, as always!
Have swing!

]]>
http://blog.zurka.us/check-number-even-odd-php/feed/ 0