Monday, November 3, 2014

IE stylesheet CSS absolute position problem solved

There are certain times that you need to have a html element to have an absolute position.  IE does not display the element as intended as seen in all major browsers.

The div element displays the content in the middle of the container.  In IE you need to define the top and left as 0px.

Sample (I wanted the image to be displayed inside the div element):

.bannercontainer {
position:relative;
display:table;
width:340px;
height:340px;

}
.banner {
display:table-cell;
position:relative;
width:340px;
height:340px;

}
.banner a{
display:block;
position:absolute;
left:0px;
top:0px;

}

<div class="bannercontainer">
          <div class="banner">
            <a href="#"><img src="images/grillers.jpg" alt="Meat Grillers" width="340" height="340" border="0"></a>
            <a href="#"><img src="images/GRANDE_MEAL.jpg" alt="Amigo Grande Meal" width="340" height="340" border="0"></a>
            </div>
</div>

This sample displays the element correctly since the container has been specified at the correct width and height.  Otherwise, the content would be placed outside.

Wednesday, August 27, 2014

XAMPP MSSQL connection problem, php_sqlsrv.dll

I recently tried to install or add the PHP mssql driver to connect with the ms sql server.  Official compiled dll for the php_sqlsrv is until version 5.4, and does not support PHP version 5.5 and beyond.

I tried adding the extension, but XAMPP keeps on telling me there is something wrong.  It gives a message like "startup: sqlsrv: unable to initialize module..".  I searched the internet for some time, until I came across a solution on my particular problem.

It seems there is a need to compile a newer version of the php_sqlsrv driver.  Thankfully someone did that for me since I certainly have no idea how to compile this source file.  This is only for test purposes only, so hopefully the compiled dll does not have anything else besides the intended purpose of connecting to the ms sql server.

Here is the link to that file: http://social.msdn.microsoft.com/Forums/sqlserver/en-US/e1d37219-88a3-46b2-a421-73bfa33fe433/unofficial-php-55-drivers-x86

Friday, August 22, 2014

Which is better? Notepad++ or Sublime text?

I have been searching lately for a better code editing application.  Some use sublime, some use notepad++ for website development.  I came across different websites saying Notepad++ is better, some say sublime text is better.

Here is one that is clear and objective comparison of both: http://text-editors.findthebest.com/compare/9-45/Notepad-vs-Sublime-Text

What it comes down to, is for what specific task will you be using the editor towards?  Some argue Notepad++ can compile on the editor itself.  Others argue, Sublime text can be used on different OS, such as Mac, Linux, Windows.

Both are almost identical, and can be customize to your specific layout.  But as far as latest language updates for the web, I noticed that sublime text supports the new syntax in CSS3.  I have been using Notepad++ occasionally, and when using intelli-sense, Sublime text offer much updated language file.

There is nothing wrong with Notepad++, if it can serve your specific project needs, then stick with it.  It is a stable build and free.  Sublime text on the other hand is not free and expensive for an editor.  It cost $70, and free update on current version only.  If there is a new version, the license you purchased is only good up to the point of latest update of version bought.

Note: out of the box, Sublime text already has intelli-sense working.  While Notepad++ you will need to allow autocomplete thru this steps: Settings>Preference>Auto-Completion tick on the checkbox to enable auto-complete on each input.




Monday, April 14, 2014

Windows host file helps in speeding up MySQL localhost access

We had a problem before, where the PHP page does not load as fast as it should on mySQL database access.  We seem to have solved it by allowing the 127.0.0.1 to point to localhost.

What we did was removed the comment sign # to resolve the ip as localhost.

Host file is found at the following directory: c:\windows\system32\drivers\etc\
File name is hosts.

There are a lot of source material on the internet to edit the host file.

This is one of them:
http://helpdeskgeek.com/windows-7/windows-7-hosts-file/

Thursday, March 6, 2014

PHP include_once from parent folder not working in version 5 above

I don't know why but the include_once does not work if the file is one folder above the file calling it.  There is a fatal error logged in the error log file, but it does seem to be still working.

The solution, that I found here: http://stackoverflow.com/questions/5588639/php-include-once-not-working
seems to work, and does not register as error after I place the code sample:

include_once (dirname(__FILE__) . '/../file.php');

Thank you, to the person who shared the answer.

Wednesday, December 11, 2013

DateTime functions not working in new set-up PHP 5.3.27 or any other version

You may seem to find yourself in a predicament when you have a new server with a default set-up of PHP configuration. When you transfer your working website when it does not work as intended.

I was searching on the web how can this be? Does the new version, not accommodate the functions used previously.  You might assume that, but the simple solution to the problem is the Date Timezone settings in the config or PHP.ini file.  You just need to set it to your desired timezone.  Once you have specified this, the functions should work as it used to before.

At least that what solved my problem.

Wednesday, December 4, 2013

PHP PDO why the error message given has the computer name, and domain

I have been trying to connect to mySQL server locally and there is an error give with Password:NO.

After searching for a while there is a simple explaination the username and password I have given does not have rights to the database I have specified, hence the error message.

The solution and explination can be found here: http://stackoverflow.com/questions/13002409/why-php-pdo-uses-a-different-from-hostname-to-the-one-used-by-mysql-connect-wh

Hope this helps. Happy coding.