HTML and CSS Reference
In-Depth Information
footer {
clear: both;
}
footer p {
margin: 0;
color: #889;
font: italic 12px/1.67em sans-serif;
text-align: center;
text-shadow: 1px 1px 1px white;
}
Load your htML file in a browser and you'll see your styled markup (see Figure 3-5 ).
Figure 3-5. The styled page that will send and receive messages with Pusher
Now that you have a page that has an area of the uI designated to both sending and receiving messages, we can
start adding in realtime functionality by publishing and subscribing. Looking at the htML, we know that the form
will submit entries to a file called post.php ; let's start by creating that file and including the pusher php library.
Download the pusher php library from https://github.com/pusher/pusher-php-server and copy the lib
directory to the same folder where your htML file is saved.
With that saved, we can create a new pusher object and start sending data in just a few short lines of code to
post.php :
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
require_once 'lib/Pusher.php';
Search WWH ::




Custom Search