Category Archives: Web Development

How do I stop my embedded YouTube video from showing related videos?

There is nothing more annoying, when trying to promote your product or service, than inadvertently advertising a competitor or having the shine taken off your presentation by having a bunch of completely unrelated “suggestions” being flung at your viewer to …
Read More »

Posted on

URL Escape Codes

Below we list the most common escape codes to be used in URLs. This is useful to know if you are passing special characters in JavaScript or if you wish to generate a URL that passes special characters. Character Code …
Read More »

Posted on

How to add days, weeks, months to any date in PHP

How to add days, weeks, months to any date in PHP $date = date(“Y-m-d”);// current date $date = strtotime(date(“Y-m-d”, strtotime($date)) . ” +1 day”); $date = strtotime(date(“Y-m-d”, strtotime($date)) . ” +1 week”); $date = strtotime(date(“Y-m-d”, strtotime($date)) . ” +2 week”); …
Read More »

Posted on

Z-Index Maximum and Minimum Values

Quick answer to a query we got asked the other day. Does the css property z-index have a maximum value? The answer is yes. The maximum value for z-index is 2147483647. The minimum value for z-index is 0. Occasionally you …
Read More »

Posted on

ASP Server Variables

We have decided to remove our Resources section in order to keep all useful code snippets and tips in our blog so we will post some of the content of those pages here. The first one is the ASP Server …
Read More »

Posted on

PHP Connection to MySQL

To access a MySQL database in PHP you can use the following script: <?php $dbhost = ‘mysql.myserver.net’; $dbuser = ‘myname’; $dbpass = ‘mypassword’; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die (‘Error connecting to mysql’); $dbname = ‘mydatabase’; mysql_select_db($dbname); ?> Remember …
Read More »

Posted on

DSN-Less Connection to MySQL in ASP

To access a MySQL database in ASP you can use the following script: Function getDBConn() Set conDB=Server.CreateObject(“ADODB.Connection”) conDB.Open “Driver={MySQL ODBC 3.51 Driver};” & _ “Server=mysql.myserver.net;” & _ “Port=3306;” & _ “Option=131072;” & _ “Stmt=;” & _ “Database=mydatabase;” & _ “Uid=myname;” …
Read More »

Posted on

A better way to handle POST and GET in PHP

To handle POSTed and GET variables in PHP is a bit of a pain. You’ve got to check that they are actually set, that they are not null and then, read the value. We use three functions to handle this. …
Read More »

Posted on

Getting path and location details in Javascript

A couple of quick tips for you to get path information for your page in JavaScript, assuming that the URL we are manipulating is http://example.com/test/test.php?i=1&b=2#3 To get the complete URL use: location.href returns http://example.com/test/test.php?i=1&b=2#3 To get the hostname use: location.hostname …
Read More »

Posted on

Get Current Directory Function in PHP

Something that many people ask for is an extremely simple piece of code and that is “How do I get the current directory in PHP?” Well, we use a function to do this and the code is as follows: function …
Read More »

Posted on