PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Tue Dec 18, 2018 7:14 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Thu Oct 18, 2018 10:43 am 
Offline
Forum Commoner

Joined: Thu Aug 10, 2017 4:48 pm
Posts: 33
Hi,

I'm looking for a way to make a page request in Ajax and retrieve the request page to a string. This string should be available to any function but in the example below it isn't because alert(data); doesn't popup. After converting to a string i want to manipulate the text by using "find" to look for a string or a text in a determined area. Can this be done?

Code:
<input type="text" id="http" value="http://www.example.com">
<br>
<input type="button" id="submit" onclick="myhttp()" value="Send!"/>
<script>
function myhttp() {
    var http = document.getElementById("http").value;
    var dataString = 'lsd=AVrls4dL&email=email@gmail.com';

            $.ajax({
            type: "GET",
            url: http,
            data: dataString,
            async: false,
            success: function(data){
            alert(data);
            }
            });
           
    }
</script>


Thanks


Top
 Profile  
 
PostPosted: Fri Oct 19, 2018 8:39 pm 
Offline
Site Administrator
User avatar

Joined: Wed Aug 25, 2004 7:54 pm
Posts: 13585
Location: New York, NY, US
Have you checked your Javascript console for errors. I suspect your are getting cross-site scripting error.

_________________
(#10850)


Top
 Profile  
 
PostPosted: Sat Oct 20, 2018 4:48 pm 
Offline
Forum Commoner

Joined: Thu Aug 10, 2017 4:48 pm
Posts: 33
Yes, is giving CORS error, do you have any other language suggestion? I tried in JS and PHP but it doesn't work.

Also, while i was searching i found a Python Script that does half of the work that what i'm trying to build. Is Python more open in terms of development?


Top
 Profile  
 
PostPosted: Mon Oct 22, 2018 3:57 pm 
Offline
Site Administrator
User avatar

Joined: Wed Aug 25, 2004 7:54 pm
Posts: 13585
Location: New York, NY, US
You can call a PHP script on the same domain as the Javascript. That PHP script can fetch the contents of another domain, parse it, and return data to the Javascript script.

_________________
(#10850)


Top
 Profile  
 
PostPosted: Sun Nov 11, 2018 3:45 pm 
Offline
Forum Commoner

Joined: Thu Aug 10, 2017 4:48 pm
Posts: 33
I can't add files to the server. The form i want to retrieve information is
https://www.facebook.com/login/identify?ctx=recover

Here is a Python script that works very similar to want i'm trying to achieve but i just want the info
https://github.com/PaulSec/osint-facebo ... t-password


Top
 Profile  
 
PostPosted: Mon Nov 12, 2018 11:01 pm 
Offline
Site Administrator
User avatar

Joined: Wed Aug 25, 2004 7:54 pm
Posts: 13585
Location: New York, NY, US
You can do it from a server with PHP, Python, etc. But you can't do it from the browser with Javascript.

_________________
(#10850)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group