Here is the php
PHP Code:
<?php
$flashcards = file_get_contents('flashcards.txt');
$flashcards = explode(',',$flashcards);
$flashcards_number = count($flashcards);
$flashcards_number = $flashcards_number-1;
$random_note = rand(0,$flashcards_number);
$flashcard_picked = rand(0,$flashcards_number);
$flashcard_picked = $flashcards[$flashcards_number];
$spanish_word = explode('|',$flashcard_picked);
$spanish_word = $spanish_word[0];
$english_answer = $spanish_word[1];
echo $spanish_word;
echo '<center>';
echo '<br /><a href=javascript:alert("' . $english_answer . '");>English Answer</a> | <a href="flashcard.php?card=' . $random_note . '">Random Flash Card</a>';
echo '</center>';
?>
The text it is taking from is located at *example removed*
The script itself is installed on *example removed*
It won't switch words, it won't display the answer, and I'm kind of trying to prepare for an exam with this script. Could anybody help me get this working? Maybe I have my text file written front, maybe it's an error with the code.