Monday, October 14, 2013

Auto webpage close without any alert message

Insert below code in head section if you want to auto close your webpage.

<script>
window.open('','_self','');
window.close();

</script>

If we want to close your web page after execution of  any php code then insert below code after the main php code

echo "<script>
window.open('','_self','');
window.close();

</script>
";


Tuesday, July 23, 2013

Combine two columns value into one column using MSSQL

if want to select two column value in one culumn using MSSQL then you have to write below query

SELECT (column1+column2) AS columnName
FROM table


To add '-' beween value of these two column

SELECT (column1+ ' - ' + column2) AS columnName
FROM table

Tuesday, July 16, 2013

Edit CakePhp .ctp file in Dreamweaver

Dreamweaver does not understand what the .ctp file extension is, and how should it syntax highlight the code.  So we help Dreamweaver out by editing a few of its configuration files. Below is step by step guide :
1.      “Edit dreamweaver configuration file located at C:\Program Files\Macromedia\Dreamweaver 8\Configuration\Extensions.txt “and alter 2 lines by adding the CTP file extension as follows:
VTML,INC,JAVA,EDML,WML,CTP:All Documents
All document file line should look as above at the end.

PHP,PHP3,PHP4,PHP5,TPL,CTP:PHP Files
The PHP Files line, which was line 16 for me, should look as above.

2.      No we do same as above in configuration file located at
IN Windows xp:
C:\Documents and Settings\{user}\Application Data\Adobe\Dreamweaver 9\Configuration\Extensions.txt
In Windows 7:
“C:\Users\\AppData\Roaming\Adobe\Dreamweaver 9\Configuration\Extensions.txt
3.      Edit another configuration file located at “C:\Program Files\Adobe\Adobe Dreamweaver CS3\configuration\DocumentTypes\MMDocumentTypes.xml”. What we are looking for is around the 75th line where it reads “servermodel=PHP MySQL”.
winfileextension="php,php3,php4,php5,ctp"
macfileextension="php,php3,php4,php5.ctp"
Add the ctp extension to the comma separated list as shown above.

Thursday, June 27, 2013

Java script to get value from table cell


<script type="text/javascript"  language="javascript">
function getTablecellValue()
{
var table = document.getElementById("myTableD");
alert(table.rows[1].cells[0].innerText);
}
</script>

Friday, April 19, 2013

Cannot send session cookie - headers already sent warning message in php

If you are getting warning in php file that "Cannot send session cookie - headers already sent".
For solution you should insure that nothing is being sent to the page before the session_start().

Make sure its a plain ANSI file, not utf-8 or anything.
if it is not ANSI file then open notepad, insert the php code, and save it as plain ANSI. It should work fine.