Jump to content

Capture website code and send to PHP


7blake

Recommended Posts

Hi. Not too sure how to word this right. I remember once when I was learning how to send javascript variables to PHP, I accidentally sent a capture of the entire index.php.

Ive been trying to find the answer online but I guess im not wording it right. Does anyone know how to do this?

Link to comment
https://forums.phpfreaks.com/topic/295738-capture-website-code-and-send-to-php/
Share on other sites

It sounds like you're looking for information on AJAX. You can send information from JavaScript to php, process it on the server side in php, and return data to your client-side JavaScript. Here's information on using JQuery - it makes AJAX calls easier to deal with.

Thanks alot, got the ball rolling :)

So incase anyones new and interested too, to capture the dynamic state of the HTML you only need

var x = $("body").html();
alert(x);
			
			

To capture the saved state of a file and send via aJax

 $.ajax({ 
        url: "fileName.php",
        type: "POST",
        dataType: "text",
        success: function(data) {
            alert(data);
        }
    });


I'm not sure how to capture dynamic variables in Javascript though. I suppose it just needs a script to update an array, then send the array that way.

Thanks for the info maxxd
 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.