How to call SOAP api from PHP

This tutorial explains calling of SOAP API with PHP code, there is also work around for the problems while accessing host URL.

This code is tested with PHP 5.6.x version and is working without any issue.

 
Create PHP file and paste following below code in it, save and you’re done.
In below code we are calling SMS SOAP API to send SMS’.
Read More

Redirect old domain to new domain with 301

Here are the few lines of code you can add into your .htaccess to redirect your old domain to new domain with 301 (permanent redirect) code.

Open .htaccess file in any editor and add following below lines, please replace websterz.info with your own domain.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^websterz.info [NC,OR]
RewriteCond %{HTTP_HOST} ^www.websterz.info [NC]
RewriteRule ^(.*)$ http://websterz.info/$1 [L,R=301,NC]

 

That’s all 🙂

DDOS attacks on XMLRPC.php (Fixed)

wordpressXMLRPC.php is php file included with wordpress installation, it allows posting of content remotely through supported web blogs to wordpress blog, it provide many other features as well having many pros and cons. As far as web site security is concerned XMLRPC.php file is famous among hackers and attackers.

Most of the wordpress blogs get hits by attackers on XMLRPC.php usually called DDOS attacks. During the attack XMLRPC.php gets many requests and that makes web site goes down with excessive usage of allocated resources. Some web hosting providers suspend those accounts for high resource usage issues. Read More

WHMCS integration of domain check for PKNIC domains

PKNICPakistan’s largest domains (cTLDs) provider PKNIC has no WHMCS modules or domain checking mechanism for 3rd party tools.

You can add these domains checker functionality to your WHMCS by doing below simple steps:

  • Login to your FTP and edit file “WHMCS installation folder/includes/whoisservers.php” in any text editor or Dreamweaver
  • Now paste following below code at the end of the file and save that file to your server.

Read More

Simple .htaccess redirection and rewriting

Here is quick code for creating redirection for your web site:

Redirecting to www:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.example.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]

This will redirect all request from http://example.com to http://www.example.com

Redirecting to www with https:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]

This will redirect all request to https://www.example.com

Access page with multiple names/urls (SEO trick):

# The page login.php will be accessible by http://example.com/login and http://example.com/login.php
RewriteEngine On
RewriteRule ^login login.php [L]

Pass querystring (GET) values to PHP page:

# This will send id (GET) value as 1 to page checkout.php where you can get it into script via $_REQUEST[‘id’]

RewriteEngine On
RewriteRule ^checkout/id checkout.php?id=1 [L]

Above codes can be used for basic SEO and URL rewriting/redirection.