Today, while writing a code for AJAX file uploader, I was trying to do with [wiki]SALAJAX[/wiki]. 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 [wiki]IFrame[/wiki], 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 [wiki]AJAX[/wiki], 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>
Continue reading “Ajaxified File Uploader Using IFrame” »
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.
Continue reading “Tabbed Infowindow in Google Maps” »
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.
< ?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);
Continue reading “Mapping The IP Address to Latitude and Longitude In Google Maps” »
For last few days I have been trying to understand wordpress ins and outs, and had an idea of developing simple plugin for [wiki]wordpress[/wiki]. 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)
Continue reading “Wikilinki Ver 1.0 Released” »
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!
Continue reading “Surprised ! I installed a new theme.. Yeha” »
Everybody is already familiar with WYSIWYG editor. Before, doing CMS projects I used to use fckeditor, and I always had a problem with its bad design and loading time. Though you can config the editor to just the actions you need. I still felt something was not right about it. And I searched about editors, then I came across TinyMCE editor.
Continue reading “Configuring TinyMCE:Simple Setup” »
I have already posted similar post for finding out the latitude and longitude of a place using Google maps, but when I studied the traffic details and found out that when people visit that post, they sometime come with keywords like zipcode+latitude and longitudes, so I thought it would be better to them to post another article, giving them what they exactly want.
Continue reading “Latitude and Longitude Of a Place in Google Maps Using Zip Code” »
On doing one of my project, I came across this situation when I need to find out whether the domain name supplied by the user is available or not? I then came up with a solution, here’s is what I did. But before that let me explain somethings. There is something called WHOIS LOOKUP. WHOIS LOOKUP is action relating to look on official WHOIS database server for the information related to domain name.
Continue reading “Checking if the domain is registered or not ?” »
I was just adding my site on Alexa and in some minutes Alexa generated a thumbnail of my html site. And again it was same with blog catelog. So I thought is there any PHP code that crawled the site and generates its image thumb? After a lots of research I came out with these. Remember, this only works in windows server.
There is one thing called IECapt.exe ( A Internet Explorer Web Page Rendering Capture Utility). This renders the page and generate thumbnail of it. You can download it from IECapt.exe. And to run that through php here’s the code.
Continue reading “How To Generate Thumbnail of HTML Pages” »
I could not stop myself from posting this blog post, because it has been over four weeks I launched this site and its Alexa ranking has improved by 24 million in three days interval. As I first started it was around 29 Million. After a week it went to 25 million figure, it was 25,214,769 on 5th June to be specific . And today on 8th June it has 1,996,306 ranking. So in three days the ranking took a 24 million leap. I don’t know if its natural or “alexaral” but there is no any other pleasure for those people, who keep on looking for their page rank or alexa rank of there site like me, to have such a giant leap.