sheetal's blog

User defined xml reponse in drupal 6 webservices

XMLRPC server gives xml reponse in following way. <methodResponse>   <fault>    <value>     <struct>      <member>       <name></name>

Request webservices in drupal 6

1. Following is the xml format for sending the request $xmlrequest= "<?xml version='1.0'?> <methodCall>   <methodName>myservices.test</methodName>     <params>

Creating your own Webservices with drupal 6

1. Download services module from http://drupal.org/project/Services 2. Unzip the service module directory and copy inside sites/all/modules directory

Validate user IP address using javascript

1. Read user IP address. var ip = '<!--#echo var="REMOTE_ADDR"-->' 2. Enter list of allowed ips var allowed_ips = ["11.11.11.11","22.22.22.22"] 3. Create a regular expression string. var handleips = allowed_ips.join("|") handleips = new RegExp(handleips, "i")

Send a mail using SMTP in PHP

1. First create a instance of smtp server. $smtp_server = fsockopen("smtp.yourdomain.com", 25, $errno, $errstr, 30); 2. Check for errors while connecting to mail server. if(!$smtp_server) { // We have an error, do something exit; }

Syndicate content