Recent Articles
Use of curl in php
Jul 30, 2010 Php Leave a comment
cURL is a library which allows you to connect and communicate to many different types of servers with many different types of protocols.PHP supports libcurl, that allows you to connect and communicate to many different types of servers with many different types of protocols. libcurl currently supports the http, https, ftp, gopher, telnet, dict, file, and ldap protocols. libcurl also supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading (this can also be done with PHP’s ftp extension), HTTP form based upload, proxies, cookies, and user+password authentication. Using cURL you can:
- Access and Implement many web services like payment gateways’ payment notification scripts, crm integration etc..
- Download and upload files from remote servers.
- Login to other websites and access members only sections.
- Send post form data with curl.
Disadvantage/Drawback of AJAX.
May 27, 2010 Ajax, Php Leave a comment
AJAX technology is very help full but as we know every coin has two aspect . Like other AJAX technology also have some drawbacks/disadvantage some are list below. So before developing your application with AJAX you should know about advantage and disadvantage of AJAX.
1. The page address doesn’t change while working , so you can’t bookmark
AJAX-enabled pages.
2. Search engines may not be able to index all protions of your AJAx
application site.
3. The Back button in browsers , doesn’t produce the same result as with
classic web applications, because all actions happen inside the same page.
4. Javascript can be disabled at the client side, which makes the AJAX
application non-functional, so it’s good to have another plan in your
site, whenever possible, to avoid losing visitors.
How can I fetch data from one database on a server and store them in other database on another server using PHP?
Jan 12, 2010 Mysql, Php 1 Comment
Many times we need to transfer data from one database exists on a server to another database exists on another server ,in that case we can use fourth parameter of mysql_connect function which is an optional parameter. If fourth parameter is true then it will create a new link for another database connection even if we have created database connection earlier with same detail with same database or with another database. Lets discuss how it works by an example.
Function syntax:
mysql_connect ( [string $server [, string $username [, string $password [, bool $new_link [, int $client_flags]]]]] )
Now Connect database1 using host, username and password as given below
$db1 = mysql_connect(”host”,”user”,”pwd”)
mysql_select_db(’db1name’, $db1);
Fire a query on db1
$res1 = mysql_query(”query”,$db1);
Connect database2 using host, username and password and include fourth parameter true as given below
$db2 = mysql_connect(”host”,”user”,”pwd”, true)
mysql_select_db(’db2name’, $db2);
Fire a query on db2
$res2 = mysql_query(”query”,$db2);
Now both link will remain live.If you will not use fourth parameter than setting of $db1 will be overwrite by $db2 so you can not use both objects without using this fourth parameter as true.Now after using fourth parameter you can use both database1 and database2 on same page.You can fetch data from first database and than insert that data in second database .
javascript validation to check only one checkbox among multiple checkboxes
Dec 8, 2009 Php Leave a comment
Suppose you have a page with the listing of all the users registered on your site. Every record has a check box with it to select that record . Client want that user can select only one record at a time from that list and user must select one record for further action. Now what to do . Don’t worry this is not so hard , you can found the solution on web for this or you can write your logic for this. But i am giving here so you can find it very easily.Here it is:
Read More..
javascript validation to check if two combo boxes has same value
Dec 8, 2009 Javascript Leave a comment
Suppose you have a form with 5 different combo boxes and those combo boxes have same data. Now client want that you can not select same data in 2 combo boxes.Also you have to select all 5 combo boxes.
How to do this by javascript. ok let me show you these 2 functions. I made these 2 functions when i faced this problem in one of my website , now i am giving this to you. Have it and enjoy the programming.
Read More..
