Posts

Showing posts from 2015

HOW TO FIX ACQUIRING NETWORKING ADDRESS

There are few steps we can resolved Acquiring Networking Address issue during to connect wireless  internet connection. Step1.   Unplug the cable /DSL Modem (Digital Subscriber  Line) Step2 .  Unplug the wireless router. Step3.  Wait for 60 sec. then plug in the modem. Step4. When the modem I completely online plug in the wireless router Step5.  On the Pc ,open a command prompt (Cmd ) on window vista ,click  the window orb, type “cmd.exe”. when cmd.exe appears under programs , right click it , and select “Run as administration ” On window Xp, click start ,Run ,type cmd OK . Step 6. Once you have a command prompt ,first type “Ipconfig /flushdns”. Step7. Next, type “ ipconfig/release”. Step8 . Then type ipconfig /renew , Click your wireless connection status in your computer then click properties . Now you will see your preferred connection then remove it and restart  again your Router then add again wireless Network . Now you will see it is work. Have

Eager Loading vs Lazy Loading in MVC pattern

I am describing basic difference between Eager Loading vs Lazy loading.  Eager Loading :1 .Resource loading.    2. Since eager fetching load all relationship , it's a big  performance hog.    3. Eager fetching makes for easier programming , since less code is required.  Lazy loading :   1. Time consuming.      2. Lazy fetching doesn't load any relationship unless told to, which lead to better                                       performance.    3. Lazy loading could lead to bugs if entire system isn't           properly tested.

URL redirect/rewrite using the .htaccess file

Q How to redirect http to https RewriteEngine on RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] Q How to redirect http:// to https://www RewriteEngine on RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L] Q How to redirect non-www to www RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] Q How to redirect all pages to newdomain RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^olddomain\.com$ [NC] RewriteRule ^(.*)$ http://newdomain.com [R=301,L] Q What is meaning of L & R flag in htaccess htaccess L fag causes to stop processing the rule set, if the rule matches, no further rules will be processed htacces R flag causes a HTTP redirect to be issued to the browser and 301 means its permanent redirect. Q How to redirect homepage to another Website Redirect / http://www.khunt.com/ Q How to redirect to another directory within s

How to pass objects in php function

This is the simple way to pass object in php  function .Before run these codes you should aware of following files. 1. Khunt.php :-                     This is the main class file. 2. ReqMsgDTO.php :-          This file have setter and getter properties. 3. Sale.html :-                       This file basically provides the User Interface along with Order Id and Mid. 4. test.php  :-                        This file will  invoke the generateTrnReqMsg($object) along with pass object .                                          1. Khunt.php <?php  include("ReqMsgDTO.php"); class Khunt     {   function generateTrnReqMsg($reqMsgDTO)         {                                     try             {                 if ($reqMsgDTO == null || $reqMsgDTO->Mid == null || $reqMsgDTO->Mid == ""                 || $reqMsgDTO->OrderId == null || $reqMsgDTO->OrderId == ""                                 )                 {       

What is curl in php

cURL is a library that lets you make HTTP requests in PHP. it is a way you can hit a URL from your code to get a html response from it.  cURL means client URL which allows you to connect with other URLs and use their responses in your code Remark: The curl_exec command in PHP is a bridge to use curl from console.  curl_exec makes it easy to quickly and easily do GET/POST requests,  receive responses from other servers like JSON and download files. Example: $url = 'url_to_post';     $data = array("first_name" => "First name","last_name" => "last name","email"=>" email@gmail. com ","addresses" => array ("address1" => "some address" ,"city" => "city","country" => "CA", "first_name" =>  "Mother","last_name" =>  "Lastnameson","phone" => "555-1212", &quo

Php Program to Send a Message from Client(php program) to Server (java program)

What this program does? 1. Make Use of php Socket Programming including with IP address and port number of Server (java program). 2. First starts a server (server.java) which will be always running listening to a port 8080(Server.java) 3. Client (Client.php) sends a number (message) to the server (Sever.java). 4. Server receives this number or messages from Client.php which is run on your Apache server  1. This is Client .php treated as Client which is run on your xampp or wamp server. <?php $address = '172.16.50.122'; // java server ip address $port = 8080; // port number $socket = socket_create(AF_INET, SOCK_STREAM, getprotobyname('tcp')); socket_connect($socket, $address, $port); $message = '<?xml version="1.0"?>'; $message .= '<root>'; $message .= '<attribute-value attribute="sample attribure">'; $message .= '<value>sample value</value>'; $message .=

Socket Programming using Php

<?php There are only two files are require to execute socket programming . Server .php Client.php This is server.php file .   $host = " 127.0.0.1" ; default ip address for TCP/IP $port = 3306 ; // default port number. // don't timeout! set_time_limit(0); // create socket $socket = socket_create(AF_INET, SOCK_STREAM, 0) or die("Could not create socket\n"); // bind socket to port $result = socket_bind($socket, $host, $port) or die("Could not bind to socket\n"); // start listening for connections $result = socket_listen($socket, 3) or die("Could not set up socket listener\n"); // accept incoming connections // spawn another socket to handle communication $spawn = socket_accept($socket) or die("Could not accept incoming connection\n"); // read client input $input = socket_read($spawn, 1024) or die("Could not read input\n"); // clean up input string $input = trim($input); echo "Cli

Magento Directory Structure

Image
When we are starting development in magento there're few things should be essential to know directory structures. There are some files and folders must keep in mind. 1.. htaccess: mode_rewrite rule, which are are prominent for the search engine url.There you can also find the website server and php directive will improve your Web site performance. 2..htaccess. Sample :basically, it is the back up of the. htaccess file. 3.app: App directory contains the modules, theme, configuration and translation files apart from template files for the default administration themes and the installation. This is most important directory structure. 3. Cron.php: Define the time period will ensure that the Magento caching system will not affect the website. 4. Downloaded: This directory store the websites perspective files. Like images, pdf,.doc Microsoft office. Etc. 5.index.Php: This is the main file of Magento this file first excecute when magento run. 6. Index.Php.Sample: It is the backu

Error 1217

Error 1217: can't delete or Update a parent row: a foreign key constrain Fail in mysql. This is the funny things all tables would be deleted except some of left due to the Foreign key constrain. Wheneve you try to drop database then you got same aforesaid message. If you disable the Foreign key check or You should be set Foreign_key_Check=0 For instance Set Foreign_key_check=0; Drop table myfirsttabletodrop; Drop table mysecoubdtabletodrop Set foreign_key_check=1; I hope you will solve your problem. Have a nice day.