Jump to content

raila

Members
  • Posts

    19
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

raila's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. raila

    hmm

    You can? please show me :-) I welcome any surgestions. Raila
  2. raila

    hmm

    seems to work perfectly:-) Thanks!!!
  3. raila

    hmm

    File to bee read: <q> what is your name? <a1> Thomas <a2> Roger <a3> John Result i want: Question: What is your name? ($question = What is your name?) posible answers: Alternative 1: Thomas ($a1 = Thomas) Alternative 2: Roger ($a2 = Roger) Alternative 3: John ($a3 = John)
  4. raila

    hmm

    this was an replypost to the original post.. http://www.phpfreaks.com/forums/index.php/topic,145320.msg621675.html#msg621675 but something fishy happend so it posted as new topic.. belive it will be mutch clearer if you all read that first :-)
  5. raila

    hmm

    pure php please :-)
  6. raila

    hmm

    I do see what you meen, but i don't get the result i whant from that. But i may have missed completly on the bitt of code..... Here is what i want to happen: I am making a smal quiz. the question file looks like this: (submitted by users) <q> What is your name? <a1> Thomas <a2> Roger <a3> John --end of file-- I want to make a script that identify each line ass a question(q) or an alternative(a1,a2,a3......) and buts the line into a string so i can print it on the page in the right order. can anyone help me out here?
  7. raila

    hmm

    I do see what you meen, but i don't get the result i whant from that. But i may have missed completly on the bitt of code..... Here is what i want to happen: I as making a smal quiz. the question file looks like this: (submitted by users) <q> What is your name? <a1> Thomas <a2> Roger <a3> John --end of file-- I want to make a script that identify each line ass a question(q) or an alternative(a1,a2,a3......) and buts the line into a string so i can print it on the page in the right order. can anyone help me out here?
  8. can you use this? : if(empty($_POST['note']) { fwrite("to note file", "empty"); } this will write the word "empty" to the file. I know that's not what you're looking fore but it is the only way i know to solve it.
  9. <html> <body bgcolor="#D8EEA3"> <hr> <?php $filref = fopen("sporsmal.1", "r"); foreach($filref as $linje) { list(,$question,$name) = split ('[<>]', $linje); if($question = "q") { echo("The question is:<br><b><u>"); echo($name); echo("<br></b></u>"); unset($name); } elseif($question = "a1") { echo("Alternativ 1 : "); echo("$name"); unset($name); } elseif($question = "a2") { echo("Alternativ 2 : "); echo("$name"); unset($name); } elseif($question = "a3") { echo("Alternativ 3 : "); echo("$name"); unset($name); } else { die("This question contains an error!"); } } fclose($filref); ?> </body> </html> Warning: Invalid argument supplied for foreach() in C:\Program Files\Apache Group\Apache2\htdocs\quiz\sporsmal\sporsmal.php on line 7 Sorry about the repost.. got screwed up a bit the first time..
  10. code : <html> <body bgcolor="#D8EEA3"> <hr> <?php $filref = fopen("sporsmal.1", "r"); foreach($filref as $linje) { list(,$question,$name) = split ('[<>]', $linje); if($question = "q") { echo("The question is:<br><b><u>"); echo($name); echo("<br></b></u>"); unset($name); } elseif($question = "a1") { echo("Alternativ 1 : "); echo("$name"); unset($name); } elseif($question = "a2") { echo("Alternativ 2 : "); echo("$name"); unset($name); } elseif($question = "a3") { echo("Alternativ 3 : "); echo("$name"); unset($name); } else { die("This question contains an error!"); } } fclose($filref); ?> </body> </html> error : Warning: Invalid argument supplied for foreach() in C:\Program Files\Apache Group\Apache2\htdocs\quiz\sporsmal\sporsmal.php on line 7 Can't figure this out!!! please help!!
  11. ;D No. no porn site. The idea came up when we where having a party and we broadcasted the party via MSN so friends of us coud see what we where doing and stuff. No bedroom peeking or anything kinky, just for fun. raila.
  12. Ok. i have ownloaded te program. i get the program to stream (show picture and sound) Now what i'm wondering of is how to put the stream to a link on my website.... so peapole can se MY camera via my website. Any ideas? Thanks raila
  13. I would alsow like to know how this can bee done. whit php or not :-) Raila
  14. Thanks. That worked just fine. Sorry for sutch a stupid question, but i just coulden't think of it :-) Raila [img src=\"style_emoticons/[#EMO_DIR#]/laugh.gif\" style=\"vertical-align:middle\" emoid=\":laugh:\" border=\"0\" alt=\"laugh.gif\" /]
  15. I need to sort a file, but get the result in "reverse". Anyone knows how to change this ? The file that is to bee sorted contains the following information: <6>Tromsø <7>Start <9>Fredrikstad <9>Ham-Kam <9>Vålerenga <10>Viking <11>Lyn <11>Molde <11>Sandefjord <12>Stabæk <14>Odd-Grenland <14>Rosenborg <21>Brann <21>Lillestrøm I Need it to sort these lines by the number infornt of the name, but it needs to write the name. eksample: lines read: <9>Ham-Kam <14>Rosenborg <21>Brann The file is sorted here. And then it produses this result: Lines typed: Ham-Kam Rosenborg Brann What i want to bee written is the "opposit": Brann Rosenborg Ham-Kam I use the following lines to do this: $alt = file(the file to bee sortet, Needs to use natsort since that is the only sorting that works for this file) natsort($alt); is there a command or anything to make natsort work in "reverse"? Thanks for all help :-) [img src=\"style_emoticons/[#EMO_DIR#]/huh.gif\" style=\"vertical-align:middle\" emoid=\":huh:\" border=\"0\" alt=\"huh.gif\" /]
×
×
  • 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.