Posts

Showing posts from 2013

Create excel file using Cfspreadsheet

How to parse JSON in coldfusion

Parses the json object and displays the contents of its arrays using DeserializeJSON, This function is useful any time a ColdFusion page receives data as JSON strings. I Type Json: <cfoutput>     <cfset JsonData='[{"reason": "email address is unknown", "email": "abc@hotmail.comh"},     {"reason": "email address is unknown", "email": "bbc@68gmail.com"},     {"reason": "email address is unknown", "email": "ff@ff.com"},     {"reason": "Known bad domain", "email": "rr@hotmai.com"},     {"reason": "email address is unknown", "email": "ll@pp.rr.com"}]'>         <cfset JsonData=REReplace(JsonData,"^\s*[[:word:]]*\s*\(\s*","")>     <cfset JsonData=REReplace(JsonData, "\s*\)\s*$", "")>         <cfset cfData=DeserializeJ...

Insert multiple rows at a time in database

We can insert multiple rows in data using one query.It reduce the number of times execute requests. I Type : <Cfquery name="InsertReportDetails" datasource="TestDB">     INSERT INTO UserReporting(UserId,BatchId, ReportId)         SELECT #session.UserID#,2,1             UNION         SELECT #session.UserID#,2,2             UNION         SELECT #session.UserID#,2,3             UNION         SELECT #session.UserID#,2,4 </Cfquery> II Type : <Cfquery name="InsertReportDetails" datasource="TestDB">     INSERT INTO UserReporting(UserId,BatchId, ReportId)     VALUES       (#session.UserI...

Connect to database in php using class with constructor

PHP has different ways to connect to MySQL database. This is the example for Object oriented style when extending mysqli class.

Am Charts with Coldfusion Component

AmCharts with Coldfusion Component

array with struct in coldfusion

array with struct - Create Json using array with struct in coldfusion   <cfquery name="GetUsers" datasource="TestDB"> SELECT UserID, UserName,Active, CASE Active WHEN 1 THEN 'Active' WHEN 0 THEN 'InActive' END AS Status FROM shema_users </cfquery> <cfset resultStruct = Structnew() /> <cfset JsonArray = ArrayNew(1) /> <cfset Counter=1> <cfloop query="GetUsers"> <CFSET color = FormatBaseN(RandRange(0,255), 16)  & FormatBaseN(RandRange(0,255), 16)  & FormatBaseN(RandRange(0,255), 16)> <cfset JsonArray[Counter] = Structnew() /> <cfset JsonArray[Counter]["UserID"] = "#UserID#" /> <cfset JsonArray[Counter]["UserName"] = "#UserName#" /> <cfset JsonArray[Counter]["Active"] ...

Post data with getJson in coldfusion

Image
Use of getJson using coldfusion component and QueryNew. OutPut :- After Submit :-

Create CSV file in Coldfusion Using CFFile

Create CSV file in Coldfusion Using CFFile <cfquery name="GetUsers" datasource="TestDB">     SELECT UserID, UserName, Password,Active,     CASE Active         WHEN 1 THEN 'Active'         WHEN 0 THEN 'InActive'         END AS Status     FROM shema_users        </cfquery> <cfset HeaderColumn = "UserID,UserName,Password,Status"> <CFSET FileOutputPath = "C:\ColdFusion10\cfusion\wwwroot\Test\uploads">                            <CFFILE ACTION="Write" FILE="#FileOutputPath#\Users.csv" OUTPUT="#HeaderColumn#" nameconflict="overwrite" addnewline="yes">                     <cfloop query=...

Using traversal or filtering examples on list in jquery

 Using traversal or filtering examples on list in jquery <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <!---I Type HTML Code---> <div id="vacations-wrapper">   <h1>Demo Html Code 1</h1>   <ul id="vacations">     <li class="vacation america">       <h2>AA</h2>       <span class="details">$100</span>     </li>     <li class="vacation america">       <h2>BB</h2>       <span class="details">$200</span>     </li>     <li class="vacation europe">       <h2>CC</h2>       <span class="details">$400</span>     </li>     <li class="vac...

Display hours in select box with am/pm using php

Display hours in select box with am/pm using php Select Hour :- <select name="starthour" style="padding:5px;">     <?php       date_default_timezone_set('Asia/Kolkata');       $currentDateTime=date('m/d/Y H:i:s');       $curtime = date('H', strtotime($currentDateTime));       $starttime = 00;       $endtime = 23;       $endloop = ($starttime + $endtime);       for($hour = $starttime; $hour <=  $endloop ; $hour ++ )       {           $showtime = $hour.':00:00';       ?>       <option value="<?php echo $hour; ?>" <?php if($curtime == $hour) echo "selected='selected'" ?>><?php echo date('h A', strtotime($showtime)); ?></opt...

Display hours in select box with am/pm using coldfusion

Display hours in select box with am/pm using coldfusion. Select Hour :- <select name="starthour" style="padding:5px;">     <cfset curtime = TimeFormat(Now(),'HH')>     <cfset starttime = 00>     <cfset endtime = 23>         <cfset endloop = (starttime + endtime)>         <cfloop from="#starttime#" to="#endloop#" index="hour">             <cfset showtime = hour & ':00:00'>             <option value="#hour#"<cfif curtime eq hour> selected="selected"</cfif>>#TimeFormat((showtime),'hh tt')#</option>         </cfloop> </select> </cfoutput>

Auto fill textbox using jquery in php

Auto fill textbox using jquery in php. Y ou allow the user to type in a value into a Textbox and fetch values from database according that keyword.

Auto fill textbox using jquery in Coldfusion

Auto fill textbox using jquery in Coldfusion . Y ou allow the user to type in a value into a Textbox and fetch values from database according that keyword.

Create excel,Create CSV,pdf,xml file,Validate Email and Phone using Regex in coldfusion

Some tiny works in coldfusion for new programmers like create excel, pdf, and use of cfsavecontent,make first letter capital,Validate EmailID and Phone using regex etc. <cfoutput>     <!---Start : Make first letter capital of a name--->       <cfset UserName = "pintu">       #rereplace(UserName, '^(\w)(.*)', '\u\1\2')#     <!---End : Make first letter capital of a name--->         <!---Start: Create Excel File--->       <cfsetting enablecfoutputonly="Yes">       <cfcontent type="application/msexcel">       <cfheader name="Content-Disposition" value="filename=FileName.xls">       <!---Excel File Content--->       <table border="0">       <tr><td>Name</td><td>Marks</td...

Populating a second select box depending of the first select box option in coldfusion

Populating a second select box depending of the first select box option  binding with coldfusion component

How to upload file with unique name in php

This is the example to make unique file name with the help of random characters and upload the file............

Delete multiple records using checkboxes in Coldfusion

Image
This is the example to delete, active and inactive multiple rows from  mysql using javascript and Coldfusion. We can checked all checkboxes and validate if no any checkbox checked. ---------------------------------------------------------------------------------------------------------- If you like this or this is useful for you. Please comment us. Thank You

Send Twilio SMS using form in coldfusion

Send Twilio Api text messages using form.

Change reply message in twilio SMS API

Image
I am working with twilio sms api integrated with coldfusion.This is the blog for change reply message in twilio SMS API.It is very simple just make a cfm file which return xml and check return body message  like this ...

Delete multiple rows using checkboxs in PHP

Image
Last month i am working, how to delete multiple rows from mysql using php and also active or inactive multiple selected rows. This is good one example to delete, active and inactive multiple rows in mysql using javascript and php. Preview Heritages.php If you like this or this is useful for you. Please comment us. Thank You

Change value of second select box according first select box.

How to change value of second select box according first select box.manually is easy, basicaly the same thing as for the first just with a different SQL request.

Upload multiple file using jquery and Coldfusion

Image
Sorry, But i did not do something  new for upload multiple files.I modified the files according to coldfusion requirement. It may be better but currently i have not enough time for experiments for these files. I will do better in future using these files.... but until use these files. If you have any solutions for making better please give me  suggestions. Download jquery files form  http://blueimp.github.com/jQuery-File-Upload/ uploadedfiles.cfm Output :- uploadfiles.cfm   Output: upload.cfm :   After click on Addfiles.. Select all files with ctr+a with firefox..... Click Start Upload and after on finish... Congratulation files uploaded.  I hope this is useful for upload multiple files with coldfusion using jquery file upload.

Twillo SMS API Integration with coldfusion.

Twillo SMS Integration with coldfusion. First create a account with twillo.com and download library and docs for help, From here you can get AccountsID and AuthToken. Here is a example to Integration with coldfusion I hope this is useful for you. thank you

Change div color on click event

Image
Change div color after click on a link or button. Index.html You can change color of click color box Screen : For Demo  Click Here

Change sequence no of multiple options field values using Javascript and mysql using coldfusion

Change sequence no of multiple options field values using Javascript and update database field values using coldfusion I hope this is usefull for new programmers.

Create CAPTCHA or Random Word In Coldfusion.

Image
This is simple program to generate random word or CAPTCHA code in coldfusion. OutPut : -

Create Image Thumbnail in Coldfusion without losing dimension ratio.

This is simple application to create image thumbnail in ratio using coldfusion. I think this is useful for new coldfusion programmers.

Login with facebook using coldfusion

Image
Here is a example. How to make facebooklogin for a website using coldfusion?. Before start you make a account with facebook. Step 1 :  Create a app for your website using facebooklogin.here you can get app_key and secret_key. Step 2: Step 4:  You can see this screen :   Step 5:   After filling UserName and Password a screen show like this...    After click ok the redirect to logininformation:- Output in logininformation.cfm  I hope this is useful for you. if you are facing any problem write us in comment. we are happy to solve that problem.   For more details visit these links : -   http://developers.facebook.com/docs/facebook-login/   //Permissions   http://developers.facebook.com/docs/reference/login/   https://developers.facebook.com/docs/reference/api/user/

Count character of textarea using Javascript

A programe that count character for textarea. You can set th length for textarea like 500 or 1000 or as you like. For Demo  Click Here Thank You.

Creating SOAP example using coldfusion

Image
Many coldfusion programmer faces  a problem to connect SOAP with CFC. Here a example to fix the problem that explain how to connect SOAP with CFC?. ----callcfc.cfc---- <cfcomponent output="false" >      <cffunction name="getelement" access="remote" returntype="any" output="false">         <cfargument name="name" type="string" required="false"/>         <cfargument name="firstNumber" type="numeric" required="false"/>         <cfargument name="secondNumber"type="numeric" required="false"/>         <cfreturn arguments.name & " Have " & arguments.firstNumber + arguments.secondNumber & " Point ">      </cffunction> </cfcomponent>  -----Index.cfm <cfsavecontent variable="soap"><?xml version="1.0" encoding="UTF-8"?> ...

Post data by ajax using coldfusion component

Image
In this example, we are using AJAX to handle the form submission with form validations, That's insert data into database table. Output : - On click Submit button: That form post the values on update.cfc file. On Successfully Submit data Screen : I hope this is useful for new coldfusion programmers. Thank You