WarpConduit Computing

  • Quick Tips
  • Web Design & Development
  • WordPress Plugins
  • Home
  • Passphrase Generator
  • Password Generator
  • About
  • Contact

mailto: Email Link Obfuscation (Hiding)

April 1, 2010 by Josh Hartman

After searching for a good email link obfuscation script that allows the address to be seen as normal text i came upon a webpage that had a good solution, so i did a little reverse engineering and created this PHP script to output the same code, enjoy!

$v){
            $domain_array[$k] = strToHex($v,'%');
        }
        $domain = "'".implode("','",$domain_array);
        $domain .= "'";
        $output = $var1."=['".$user."',[".$domain."].reverse().join('.')].join('@');".$var2."=unescape(".$var1.");document.write(".$var2.".link('mai'+'lto:'+".$var1."));";
        $output = "";
        echo $output;
    }else{
        return false; //email address is not valid
    }
}

mailto_link('username@domain.com'); //use this function wherever you want an email link
?>

Filed Under: Web Design & Development Tagged With: email, link, mailto, obfuscation, php

Simple Standalone PHP Web Counter

December 3, 2009 by Josh Hartman

In my search for a simple PHP web counter it was difficult to find one that wasn’t somehow connected to an external host and didn’t write IP addresses to a file and then use resources to search the file later.  With all the NAT firewalls out there counting visitors based on IP address just doesn’t seem like a modern thing to do. I took a script by Eric Sizemore and modified it to create my own version.  What it does is add to the visitor count (stored in a txt file on the server) if they don’t have a cookie showing that they have visited before, then i set that cookie to expire after 60 days, after that if the visitor comes again they will be counted again.  It’s not the most accurate, but gives a good idea of how many people are visiting and i wanted to reduce server file operations.

The Code

  Simple Standalone PHP Web Counter (9.6 KiB, 901 hits)

Installation & Usage

  1. Unzip the code into your website’s root folder
  2. Change permissions on the counter log txt file so that it is writable (chmod 666).
  3. Add the following PHP code at the top of each root page you would like to display the counter on:
  4. Add the following PHP code where you want to have the counter display:
  5. Test the page you’ve included counter.php on and have show_counter() displayed.

Filed Under: Web Design & Development Tagged With: counter, php

Create a Floating Menu with jQuery

October 7, 2009 by Josh Hartman

Here is the code you can use to create a floating jQuery menu that stays where you absolutely position it on the screen. Make sure you have jQuery loaded on whatever page you use this. Try it out yourself, check it out on JSFiddle.

HTML

Floating Menu

  • Menu Item 1
  • Menu Item 2
  • Menu Item 3
  • Menu Item 4
  • Menu Item 5
  • Menu Item 6
  • Menu Item 7
  • Menu Item 8

Javascript


CSS

#floatMenu {
	position:absolute;
	top:30%;
	left:10px;
	width:135px;
	background-color:#FFF;
	margin:0;
	padding:0;
	font-size:11px;
	border-left:1px solid #ddd;
	border-right:1px solid #ddd;
}

#floatMenu h3 {
	color:white;
	font-weight:bold;
	padding:3px;
	margin:0;
	background-color:#006;
	border-bottom:1px solid #ddd;
	border-top:1px solid #ddd;
	font-size:13px;
	text-align:center;
}

#floatMenu ul {
	margin:0;
	padding:0;
	list-style:none;
}

#floatMenu ul li {
	padding-left:10px;
	background-color:#f5f5f5;
	border-bottom:1px solid #ddd;
	border-top:1px solid #ddd;
}

#floatMenu ul li a {
	text-decoration:none;
}

Filed Under: Web Design & Development Tagged With: jquery, menu

Redirecting to www with htaccess

September 25, 2009 by Josh Hartman

This is useful for SEO so all your ranking gets added to one url and not divided between two.

Use the following example to create a redirect from any incoming domain to your www sub-domain:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
</IfModule>

To use this method you need have mod_rewrite installed and enabled on Apache web server and you need to be able to create a custom .htaccess file.

A few things to note, the NC means that the regex is not case sensitive, R=301 means that this redirect will return an HTTP status code of 301 Permanent Redirect (search engine friendly), and the L after that means that no further rule processing should be done.

Filed Under: Web Design & Development Tagged With: htaccess, redirect

  • « Previous Page
  • 1
  • …
  • 6
  • 7
  • 8
  • 9
  • Next Page »

Connect

  • Facebook
  • GitHub
  • RSS
  • Twitter
  • YouTube

Recent Posts

  • Extremely Useful Applications for Web Development and IT Tasks
  • Installing BookStack Wiki on cPanel Shared Hosting
  • Media (MIME) Type Reference List

Tags

automatic benchmark cbc cipher class comparisons cpanel credit memo css decrypt encrypt font gzip htaccess html image increment javascript jquery list magento mcrypt mysql number old opencart order php profiling random redirect repository rijndael shipment software strict ubuntu url wincachegrind windows windows 7 wordpress xampp xdebug xss

Blogroll

  • CodeIgniter
  • Fusion Forward
  • jQuery
  • Nettuts+
  • Smashing Magazine

© 2023 WarpConduit Computing. All Rights Reserved.