Jump to content

Tumaini

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Tumaini's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Well, I found the extra error that made it undefined...I'd forgotten two single quotes around a character that messed everything up. That's working now. Time to try and get the saving working as well.
  2. Thanks for the answers. I would try it, but now the line I used for loading the file has broken. I can't see what's wrong. Is anything wrong with this line itself? [code]var spelning = '<? echo get_file_contents('spelning.txt') ?>'.split('§');[/code] It used to work just fine, but now it makes my page go totally blank if it's included, and half an hour ago the same line gave a "spelning not declared" later down in in the code (btw, there are underscores in "get_file_contents"). Should I load the file some other way? Actually, that doesn't seem to be the problem, as if I define it by putting in values directly, it still says it's undefined. Will have to investigate (again).
  3. Ok, let's say I want to do it this way: When the submit button is clicked, a javascript function is run, where the select array entries are joined together, seperated by § (done). Then the js variable which stores this "joined array" is converted to a php variable - how do I do this? Then it's saved (done using fopen, fwrite, and fclose). So, how do i convert a js variable to a php variable?
  4. Greetings! This is my first post here, and I'm so glad to have found a place with helpful people, who don't call you an idiot for not knowing something! :) Here's my problem: I'm trying to save a select array to a file as a string (joining the entries in the array with '§'). I tried alot of things, before someone finally told me that I can't use js-variables in php code. So I tried to find out how you turn a js-variable/array into a php-variable/array. I found $_POST, but when I use: [code]<?php $saving = $_POST['turnelista']; echo $saving; ?>[/code] where 'turnelista' is the name of the select list in the form that has the method="post" and action="spara.php", which is the page that has the above php-code, it echoes nothing. Seems you can't use $_POST to get a php-array out of a select form? If you have an explanation for this, please let me know. If you have any better ideas of how to save the info from a select list into a single string on a file, each entry seperated by §, please let me know! Thanks in advance!
×
×
  • 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.