Skip to main content

Posts

Showing posts from December, 2012

PHP: A webservice to query MySQL database via JSON

Here is a very basic webservice to query mysql database via GET or POST methods. It will return the result in json format. <?php /** * @filename service.php * @author Abhishek Kumar **/ include 'config.php'; function db_query($iQuery, $iReturn) { $output = array(); if($connection = mysql_connect(DB_HOST, DB_USER, DB_PASS)) if($database = mysql_select_db(DB_SCHEMA)) if($result = mysql_query($iQuery)) { if($iReturn) { while ($data[] = mysql_fetch_array($result, MYSQL_ASSOC)); mysql_free_result($result); $output['success'] = $data; } else $output['success'] = $result; mysql_close($connection); } else $output['failure'] = mysql_error(); else $output['failure'] = mysql_error(); else $output['failure'] = mysql_error(); return $output; } $query = (!isset($_REQUEST['query']))? NULL : $_REQUEST['query']; $type = (!isset($_REQUEST['type&#

How to enable/disable directory browsing on Red5?

To enable/disable directory browsing on Red5, follow the steps given below: Open the folder where Red5 is installed. Go inside the conf folder. Open the web.xml file. Search for the key string  listings in the xml. As show below, Edit it's value as:  true - to enable directory listings false - to disable directory listings Save the xml file. Restart the Red5 server. Try to access the path like http://localhost:5080/live/ , if you get  HTTP Status 404 then directory listings is disabled otherwise it is enabled. After verification, you're done!

How to setup OpenMeetings?

Recently, I got a requirement for which I have to install an Apache OpenMeetings on the Windows 7 server. So here I am sharing some of my experience that could be beneficial for readers who may use it as notes or guidelines. Apache OpenMeetings  is a web-based application that is developed using OpenLaszlo  and Red5 Media Server . Here,  OpenLaszlo  is alternate to flex-sdk that takes xml files as input, compile them and return swf as output; while  Red5 Media Server  is alternate to Flash Media Server or Adobe Media Server . That means, every bit of this product is open-source. Now to start with, you need to download  Apache OpenMeetings  from here . According to the  Latest Official Release ,  Apache OpenMeetings Incubating 2.0 comes integrated with Red5. So you won't have to download it separately. But they're saying that future release of OpenMeetings will be independent of Red5. Which means user would get the flexibility to use OpenMeetings with any Red5 versio