Click to browse extension page.
Here the link to install this extension. I am waiting for all kind of comments and suggestions.
Take Care :)
I'll share all my work to learn technologies while also I am studying. Thus, if you wanna learn programming let's keep up with me. I might have some mistakes about explanations or codes, if you realize please warn me to correct it, remember I am new learner too.
23 Ağustos 2010 Pazartesi
Solution against file_get_contents(url) restriction in host server!
$content= file_get_contents("http://blabla");
echo $content;
If you need to use such php code for your purpose such as cross domain xmlhttprequest, there can be a problem depends on you hosting company. They could disable the opportunity to have contact with external files because of security reasons. Thus, here is the solution.
<?php
$ch = curl_init();
$timeout = 5; // set to zero for no timeout
curl_setopt ($ch, CURLOPT_URL, "http://blabla");
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
curl_close($ch);
// display file
echo $file_contents;
?>
Take care!
20 Ağustos 2010 Cuma
Here My New AJAX Project "BusStop Editor"!
It is my one of the recent project and I think I've done well. But I guess there are some flaws at the moment because of the browser and database differences. I've done it specifically for Google Browser and PostGreSQL database but currently I converted it to MySQL database and make some changes to be available in my webhost and the other bowsers. It is working on IE now but not in FireFox and for best performance use Google Chrome.By the way this application is Turkish learn some Turkish first. :)
Thanks!
http://erengolge.0fees.net/busStopEditor/duraklar.php
Thanks!
http://erengolge.0fees.net/busStopEditor/duraklar.php
16 Ağustos 2010 Pazartesi
My Basic Solution For Cross Domain XMLHTTPRequest
As I told in my last post, I was working on the problem of cross domain XMLHTTPrequest and now I have a solution. I think it is easy to use and really basic implementation. Here the solution.
First we have a php that takes the content of the specified URL.
(I am using this to use the googleMAP reverse geocoding.)
Then we have a basic XMLHTTPRequest JavaScript;
This is an example implementation. Maybe you need to change some part of the program but this example is to get the idea behind the solution.
Take Care:)
First we have a php that takes the content of the specified URL.
(I am using this to use the googleMAP reverse geocoding.)
//proxy.php
<?php>
$content= file_get_contents("http://maps.google.com/maps/api/geocode/xml?latlng=36.9125,30.6897222&sensor=true");
echo $content;
?>
Then we have a basic XMLHTTPRequest JavaScript;
<html>
<head>
<script type="text/javascript">
var xml;
function loadXMLDoc()
{
var file = "proxy.php";//our php file
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
xml = xmlhttp.responseText;
}
}
xmlhttp.open("GET",file,false);
xmlhttp.send();;
}
function parseXML(){
try{
loadXMLDoc();
xml = (new DOMParser()).parseFromString(xml, "text/xml");
path='/GeocodeResponse/result/address_component[type="route"]/long_name/text()';
// code for IE
if (window.ActiveXObject)
{
var nodes=xml.selectNodes(path);
//alert("fsdgsdg"+nodes[0].nodeValue);
document.write(nodes[0].nodeValue);
document.write("
");
}
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation && document.implementation.createDocument)
{
var nodes=xml.evaluate(path, xml, null, XPathResult.ANY_TYPE, null);
var result=nodes.iterateNext();
while (result)
{
alert(result.nodeValue);
document.write(result.nodeValue);
document.write("
");
result=nodes.iterateNext();
}
}
}catch(err){
alert(err);
}
}
</script>
</head>
<body onLoad="parseXML();">
</body>
</html>
//-->
</script>
</head>
This is an example implementation. Maybe you need to change some part of the program but this example is to get the idea behind the solution.
Take Care:)
15 Ağustos 2010 Pazar
Today's gain is about XMLHTTPRequest to other server.
Today I was working on parsing a XML document that is coming from one of the Google servers. I wanted to use one of the datum in my map processing program and I was really happy since I could get such info. from Google server. However, suddenly and sadly :( I realized that XMLHTTPRequest the my most trusted tool cannot talk with another server beside mine because of the security reasons. Thus, I started to search about this problem on internet as a Google oriented computer engineer and I found three solution. I will give some little explanations not all implementations. If you wan to get more please ask to internet.
1-)(most common one) The best approach is having a server-side proxy that receives Ajax requests, and in turn, sends HTTP requests to other servers. This should be carefully implemented by sanitizing input and whitelisting the types of requests that are sent, and the servers that are contacted.
2-)If you are using apache server, configure your server to be able to give permission for such connection
3-) What you can do as a third is dynamically create a SCRIPT tag and reference an external address
choose one and search it... good luck :)
1-)(most common one) The best approach is having a server-side proxy that receives Ajax requests, and in turn, sends HTTP requests to other servers. This should be carefully implemented by sanitizing input and whitelisting the types of requests that are sent, and the servers that are contacted.
2-)If you are using apache server, configure your server to be able to give permission for such connection
3-) What you can do as a third is dynamically create a SCRIPT tag and reference an external address
choose one and search it... good luck :)
Kaydol:
Kayıtlar (Atom)