Jump to content

MarioHussein

New Members
  • Posts

    3
  • Joined

  • Last visited

MarioHussein's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks a million Ch0cu3r. Works just as I wanted. Now I'll get down to trying to make the form open in a popup window. Many thanks once again. Mario
  2. I've got the javascript for the popup window. What I would like to do is get the pop up window show only the corresponding example sentence when the button is clicked. I think this is done using ECHO but i am not quite sure how to do it.
  3. Hi, I have a .txt file with data in the following way: FRENEMY : a person with whom one is friendly despite a fundamental dislike or rivalry : There seems to be a frenemy relationship between John and Andrew. PORTMANTEAU : a word or morpheme whose form and meaning are derived from a blending of two or more distinct forms (as smog from smoke and fog) : Lewis Carroll's Jabberwocky is loaded with portmanteau words. The following is my PHP: <?php //Check your text file exits if (file_exists('interesting_words.txt')) { //Retrieve content of text file $content = file_get_contents('interesting_words.txt', true); //Add every line of file to array $lines = explode("\n", $content); //Cycle through all line in file $words = array(); foreach ($lines as $line) { //Split word and description by : list($word, $description, $example) = explode(':', $line); //Create a words array to hold word and description $words[] = array('word' => ucfirst(trim($word)), 'description' => ucfirst(trim($description)), 'example' => ucfirst(trim($example))); } //Generate random number from date //Remove to generate random word every page load srand(date("ymd")); //Use random number from 0 to the cound of words array to pick word of the day $word_of_the_day = $words[rand(0, (count($words) -1))]; //Use word, descriptionand example keys to print the results. echo '<span id="word">'.$word_of_the_day['word'] . '</span>'.'<br>'.'<br>'; echo '<span id="description">'.$word_of_the_day['description'].'</span>'.'<br>'.'<br>'; echo '<span id="example">'.$word_of_the_day['example'].'</span>'.'<br>'.'<br>'; } ?> I would like to have it displayed in the following way: FRENEMY a person with whom one is friendly despite a fundamental dislike or rivalry. BUTTON One would click the button to open a new popup window to show example sentences. My problem is how do I go about coding for the window part. All help appreciated. Many thanks
×
×
  • 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.