Jump to content

Igor

Members
  • Posts

    8
  • Joined

  • Last visited

Igor's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Jeez, that ###### I. lol I copied the file but it did not work, I copied just like this one: https://raw.githubusercontent.com/cowboy/php-simple-proxy/master/ba-simple-proxy.php I accessed this file directly and he returned these errors: Notice: Undefined index: url in /home/user/public_html/proxy.php on line 145Notice: Undefined variable: header in /home/user/public_html/proxy.php on line 194Notice: Undefined index: mode in /home/user/public_html/proxy.php on line 196Notice: Undefined index: full_headers in /home/user/public_html/proxy.php on line 217Notice: Undefined index: full_status in /home/user/public_html/proxy.php on line 229Notice: Undefined index: HTTP_X_REQUESTED_WITH in /home/user/public_html/proxy.php on line 241Warning: Cannot modify header information - headers already sent by (output started at /home/user/public_html/proxy.php:1) in /home/user/public_html/proxy.php on line 242{"status":{"http_code":"ERROR"},"contents":"ERROR: url not specified"} It is normal appear that?
  2. If I understand, I did so: file index.php <!doctype html><html><head><meta charset="utf-8"><title>xxx</title></head><body>INPUT<script src="/folder1/folder2/cep.js"></script></body></html> file cep.js // *** Inicio CEP Automatico *** //function getEndereco() {if(jQuery.trim(jQuery("#cep").val()) != ""){jQuery.getScript("/folder1/folder2/proxy.php?mode=native&url=" + encodeURIComponent("http://cep.republicavirtual.com.br/web_cep.php?formato=javascript&cep="+jQuery("#cep").val()), function(){if(resultadoCEP["resultado"]){jQuery("#rua").val(unescape(resultadoCEP["tipo_logradouro"])+" "+unescape(resultadoCEP["logradouro"]));jQuery("#bairro").val(unescape(resultadoCEP["bairro"]));jQuery("#cidade").val(unescape(resultadoCEP["cidade"]));jQuery("#estado").val(unescape(resultadoCEP["uf"]));}else{alert("Endereço não encontrado!");}});}} file proxy.php <?php$enable_jsonp = false;$enable_native = true;$valid_url_regex = '/^http://cep.republicavirtual.com.br/(.*)';?> That's how it should be done?
  3. Yes, I even got in touch with them and offered SSL for free, as a courtesy to them, but the problem is that they do not respond. Do you know how would the script the way you spoke? I do not know programming, then it gets complicated, did not find anything related online.
  4. Thanks for the reply. So that I know, so much so that I host the "jquery.min.js" within my server, so I use: <script type="text/javascript" src="/my_site/query.min.js"> The problem is directly with the script that possess the http, I do not know how to solve. :/
  5. Really I did not understand, I can not change the http to https, there the link does not work .. Do you know any way to run this same script?
  6. What do you mean? Did you mean download the script that does the query? (//cep.republicavirtual.com.br/web_cep.php?formato=javascript&cep=) If so, you can not because I have no access to this file, I use their API.
  7. Hi, Thanks for the answer, unfortunately did not work for me, had already trying it before. Some other solution? A colleague of mine told me the following: A workaround is to create a proxy on your side. Your ajax requests your location server-side script, and the server-side that really catches the api republicavirtual. or Creates a get-cep.php file, where it receives a parameter via get (the CEP in this case). With this file, you can call the republicavirtual using the CURL library, for example. I just do not know how to do, then do not help much ..
  8. Hello, I have a little problem here and do not know how to solve. I have the following script: // *** Inicio CEP Automatico *** //function getEndereco() {if(jQuery.trim(jQuery("#cep").val()) != ""){jQuery.getScript("http://cep.republicavirtual.com.br/web_cep.php?formato=javascript&cep="+jQuery("#cep").val(), function(){if(resultadoCEP["resultado"]){jQuery("#rua").val(unescape(resultadoCEP["tipo_logradouro"])+" "+unescape(resultadoCEP["logradouro"]));jQuery("#bairro").val(unescape(resultadoCEP["bairro"]));jQuery("#cidade").val(unescape(resultadoCEP["cidade"]));jQuery("#estado").val(unescape(resultadoCEP["uf"]));}else{alert("Endereço não encontrado!");}});}} What is happening is that the page which will use the script, possess installed SSL, then the script is not being loaded with the page to be considered unsafe (because it not contains the https link). I was told that you can modify the form of consultation to work with SSL. Is there any alternative to solve this?
×
×
  • Create New...