7blake Posted April 21, 2015 Share Posted April 21, 2015 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 More sharing options...
maxxd Posted April 21, 2015 Share Posted April 21, 2015 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. Link to comment https://forums.phpfreaks.com/topic/295738-capture-website-code-and-send-to-php/#findComment-1509545 Share on other sites More sharing options...
7blake Posted April 21, 2015 Author Share Posted April 21, 2015 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 Link to comment https://forums.phpfreaks.com/topic/295738-capture-website-code-and-send-to-php/#findComment-1509546 Share on other sites More sharing options...
IThinkMyBrainHurts Posted April 21, 2015 Share Posted April 21, 2015 Wouldn't this only get the Body section and not the whole page? var x = $("body").html();EDIT:Here's how to get the lot, depending on how much: http://stackoverflow.com/questions/982717/how-do-i-get-the-entire-pages-html-with-jquery Link to comment https://forums.phpfreaks.com/topic/295738-capture-website-code-and-send-to-php/#findComment-1509548 Share on other sites More sharing options...
7blake Posted April 21, 2015 Author Share Posted April 21, 2015 Ah, my apologies. if I could correct my statement I would. (too late to edit) Thanks iThinkMyBrainHurts Link to comment https://forums.phpfreaks.com/topic/295738-capture-website-code-and-send-to-php/#findComment-1509550 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.