Ajaxified File Uploader Using IFrame

Filed Under (Ajax, PHP) by Subesh Pokhrel on 22-07-2008

Tagged Under : , ,

Today, while writing a code for AJAX file uploader, I was trying to do with SALAJAX. But, with SALAJAX I could not manage to send the headers for $_FILES. So I thought of an alternative. And the alternative was to load the action page of the form on IFrame, whose display would be hidden and the work for uploading the file will be done on the background without refreshing the page. Yeha.. Its not AJAX, but it gives a user the feel of asynchronous working on the page. So, my code is Asynchronous Feel Without Javascript and XML (AFWJAX). What do think about this?
So, Here’s the code.The code below is for the form.


<form action="iframeinc.php" method="post" enctype="multipart/form-data" id="uploadform" target="iframe" name="uploadform">
 File:
  <input name="pic" type="file" id="pic" style="margin-right:50px;" />
  <br />
<input type="submit" name="Submit" value="Upload" ><br />
<iframe name="iframe" src="iframeinc.php" width="200" height="500" style="display:none;"> </iframe>
</form>

Read the rest of this entry »

Tabbed Infowindow in Google Maps

Filed Under (Google Maps) by Subesh Pokhrel on 16-07-2008

Tagged Under : , , ,

I wanted to show different categories of information on one GMarker. That is I wanted to show different types of information on a Infowindow for a point on Google Maps. For that I used a tabbed info window, which helped me to show different data on each tabs. Here is the code of what I have done. I have shown the latitude and longitude of a placed clicked on the map on the tabbed info window. This is just the script part. The demo and download links are given below. Read the rest of this entry »

Mapping The IP Address to Latitude and Longitude In Google Maps

Filed Under (Google Maps, PHP) by Subesh Pokhrel on 11-07-2008

Tagged Under : , , , ,

At last I found hostip.info provides a service for getting the latitude and longitude of a place on the basis of the user’s ip address. Its light weight and free, rather than downloading bulky database and getting paid services, for getting latitude and longitude on the basis of IP.
Here is the simplest way to do it. Requested to http://api.hostip.info/?ip=$ip&position=true it responds XML formatted output. So we need to parse XML code using DOM class of PHP.(#19-#23). Remember, the position=true should be set to get the latitude and longitude otherwise it will not show on default.

Here is the code and I will soon upload the working demo.
[sourcecode=”php”]
/*
Subesh Pokhrel
subesh.com.np
Get the code for Real IP of the site from roshanbh.com.np
Mapping The IP Address to Latitude and Longitude.
*/
function IPtoLatLng($ip)
{
$latlngValue=array();
$dom = new DOMDocument();
$ipcheck = ip2long($ip); Read the rest of this entry »

Wikilinki Ver 1.0 Released

Filed Under (WP Plugins) by Subesh Pokhrel on 08-07-2008

Tagged Under : , ,

For last few days I have been trying to understand wordpress ins and outs, and had an idea of developing simple plugin for wordpress. I thought people would want to give the reference of most of the words they use in their post to wikipedia, and placing it manually would be a very difficult task. Like the way I have done for the wordpress word above. So thought “wikilinki” would be a helpful plugin for those people.
And here I have it today the wikilinki plugin developed. This is just the initial version, I would add more functionality later. Because I am so excited to release it, I will add other things later on. Its easy to implement it just use [WIKI]Words[/WIKI] all in small on the post to get the reference URL of the word from wikipedia. I had to encode the usage because I have already installed it and it would parse it too. Place wikilinki.php under wp-content/plugins and activate from the admin.
You can download wikilinki from Get Wikilinki (Updated) Read the rest of this entry »

Surprised ! I installed a new theme.. Yeha

Filed Under (Asides) by Subesh Pokhrel on 04-07-2008

I was just wandering through the themes factories of wordpress I came across this theme BlueUzor by skinpress, had a demo view and I had opened the last theme I installed on the tab of mozilla. Then I compared the two.. I thought what a bad choice I had before! :D Read the rest of this entry »

Theme Modified By Self based on BlueUzor & BlueMechanics.