Jump to content

[SOLVED] Data from Javascritp to Php


rshadarack

Recommended Posts

I have a bunch of data in some client-side javascript code that I want to get to php code.  I would typically just manually build the url string to send it over in GET, but because of the amount of data, this is not possible.  So as far as I know, the only other method I have is to use POST.  And the only way I know how to do this is to build a form by adding elements to the dom and submit it.  However, this is rather ugly, is there any easier way?

Link to comment
https://forums.phpfreaks.com/topic/106213-solved-data-from-javascritp-to-php/
Share on other sites

From my understanding, hidden iframes are used to have persistent data in javascript, but you can't use one to transfer data from javascript to php.  Is that correct?

 

I didn't realize this before, but the size of the arrays I have to transfer can be determined when the php script is running.  So I can create a hidden form by just using php to make html instead of modifying the dom, and then submit it by javascript code (I think?) which will send the data needed in POST.

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.