Archive for the 'php' Category
Upload in Firefox 3
Recently i tried to use a swfupload pluggin, using php. I couldnt meke it work in Firefox 3. But in all other browsers worked like a charm. I couldnt stand the idea that this was the only time that firefox was the sticky browser. So I decided to test it in another computer with firefox [...]
Filed under: jQuery, javascript, php, tips, weird | Leave a Comment
MySQL Command List
This is a list of the most common used mySQL Commands
General Commands
USE database_name
Change to this database. You need to change to some database when you first connect to MySQL.
SHOW DATABASES
Lists all MySQL databases on the system.
SHOW TABLES [FROM database_name]
Lists all tables from the current database or from the database given in the command.
DESCRIBE table_name
SHOW [...]
Filed under: apache, php, programming | Leave a Comment
Header(“Location”) on PHP
So check out this code…..
if(1== 1)
{
header(“Location: index.php”);
}
header(“Location: http://www.google.com”);
This simple code will be expected to redirect to index.php since 1==1 is always true. And for a weird reason it returns to redirect to www.google.com.
Maybe for a reason i didn’t quite understand this, but it should be written like this
if(1== 1)
{
header(“Location: index.php”);
}
else
{
header(“Location: http://www.google.com”);
}
As mentioned before the only [...]
Filed under: php, tips | 6 Comments
Retain scroll position after browser refresh
As Joel Spolsky points out, updating web pages by getting just the bits of information that have changed instead of refreshing the whole page is the wave of the future. Whether we’re calling web services within a client-side page or using a gmail-like JavaScript technique (darn cool), it’s going [...]
Filed under: .net, css, design, dhtml, javascript, php, tips, tutorials | 10 Comments
PHP and Microsoft MSSQL SERVER
This is a solution that took me about 1 year to make it work. I proudly present the way to make php connect to an Microsoft SQL Server 2005 or SQL Server Express in all major Win OS (XP, VISTA , Widows Server).
Quick tip: use # to make MsSQL dates work!!
So here it Goes !!!!!
Filed under: php, tips, tutorials | 7 Comments
Vars from PHP to JS and Back
The easy part is to add a js variable from php.
<html>
<?php
$MyVar3 = “Something in PHP”;
?>
<script language=”JavaScript”>
alert(<?php print “‘”.$MyVar3.”‘”; ?>);
</script>
</html>
The hard part is to take values from Javascript to PHP
<html>
<script language=”JavaScript”>
var JSVar = ’something from JS code’;
</script>
<?php
$MyVar1 = “?><script language=javascript>document.write(‘Something you want’);</script><?php”;
$MyVar1 = str_replace(“?>”, “”, $MyVar1);
print $MyVar1.”<br><br>”;
$MyVar2 = “?><script language=javascript>document.write(JSVar);</script><?php”;
$MyVar2 = str_replace(“?>”, “”, $MyVar2);
print $MyVar2;
?>
</html>
Filed under: javascript, php | Leave a Comment
In some cases you need to make a custom script for uploading files or even update / synchronize two databases. The php execution time has some restrictions, for security reasons. If a scripts takes more than apache server expects to take the whole procedure stops and your update script does not complete what its meant [...]
Filed under: apache, php | Leave a Comment
Doing web development on my local machine – a Vista box – I was wondering why page rendering was so slow. First I thought my web application was not well done. But then I figured out that the pages rendered lightning fast on IE 7. And again later, I experienced, that the web application rendered [...]
Filed under: php, tips, windows | Leave a Comment
InnoDB or myISAM?
That a hard choice. I Also run into some new engines but in their speeds test i realised that none was as fast as the mentioned, wide spread, innoDb or myIsam. In general MyISAM offers speed whereas Innodb offers reliability.
Lets look at both engines in depth.
Filed under: php, tweaks | 3 Comments
One of the most used framework for making your web application more live, interactive. There is been a while since I run into it, but recently I decided to use it. Main reason is when i saw the sits that actually use the jQuery framework. Take a look here and you ll be suprised by [...]
Filed under: .net, ajax, css, design, dhtml, php | 1 Comment