Posts

Showing posts with the label php

Observer in magento

Send Email/ Sms on Change Order Status in Magento  Steps 1. Create Module Suppose to "Sendsms_Custmail"  copy and paste the following code into app/etc/modules/ Sendsms_Custmail.xml <?xml version="1.0" encoding="UTF-8"?> <config>     <modules>         <Sendsms_Custmail>             <active>true</active>             <codePool>local</codePool>         </Sendsms_Custmail>     </modules> </config> Steps 2. now Create the Observer.php file and put the following path  app\code\local\Sendsms\Custmail\Model\ <?php class Sendsms_Custmail_Model_Observer {      public function invoicedStatusChange($event)     {         $order = $event->getOrder(); $orderStatus = $order->getStatus();        ...

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 .= ...