Note that there are some explanatory texts on larger screens.

plurals
  1. POI have a variable that i need to send to php to be written to a file
    primarykey
    data
    text
    <p>I have a specific array that php needs to access and write to a file. I also want to be able to call the php to get the array info back. I use JSON.strigify to store the array in a string, but i cant figure out how to send it to a server with php. I have very little php experience and i tried:</p> <pre><code>&lt;script language="javascript"&gt; var COMMENTS_FOR_DISPLAY = new Array('Have fun with this code: Chris'); // Adds a new comment, name pair to the Array feeding textualizer. function add_comment() { // Retrieve values and add them to Array. var new_comment = $('#kwote').val(); var new_name = $('#name').val(); COMMENTS_FOR_DISPLAY.push(new_comment + ': ' + new_name); // Reset &lt;input&gt; fields. $('#kwote').val(''); $('#name').val(''); var arrayAsString = JSON.stringify(COMMENTS_FOR_DISPLAY); } $(document).ready(function() { var txt = $('#txtlzr'); // The container in which to render the list var options = { duration: 5, // Time (ms) each blurb will remain on screen rearrangeDuration: 5, // Time a character takes to reach its position effect: 'random', // Animation effect the characters use to appear centered: true // Centers the text relative to its container } txt.textualizer(COMMENTS_FOR_DISPLAY); // textualize it! txt.textualizer('start'); // start }); &lt;/script&gt; </code></pre> <p>in main.php i put:</p> <pre><code>&lt;?php $kwoteString = $_GET["arrayAsString"]; echo $kwoteString; ?&gt; </code></pre> <p>I used echo to see if i was getting any output,but i wasn't. It could be a very simple fix, maybe im missing a header or something telling my html document to read main.php?? any help would be appreciated!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload