Jump to content

raila

Members
  • Posts

    19
  • Joined

  • Last visited

    Never

Everything posted by raila

  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\" /]
  16. [u]Im fairly new at this myselfe but try this lines:[/u] IF YOU WHANT TO MAKE A LINK TO THE FILE: echo"<a href='".trim($article)trim($id).".txt'>".trim($article)trim($id)."</a>"; if the file is in another directory(articles) use this: echo"<a href='articles/".trim($article)trim($id).".txt'>".trim($article)trim($id)."</a>"; THIS INCLUEDS A WHOLE FILE: include(trim($article)trim($id)); Or something like that should work fine.migt need some "" somwhere in there, but im not sure. if the name "article" is constant use: //if $id = 33 like you wrote include("article".trim($id).".txt"); this file is loaded : "article33.txt" if the file is in another directory simply add the name of the directory : include("articles/article".trim($id).".txt"); this file is loaded "articles/article33.txt" Raila
  17. Not sure i understod the problem, but i gave it a go anyways: If the problem is that you dont get the $id in download.php to say the same as te user typed in the textbox: Try this: This line gets the text the user typed ito the textbox called "id". (it needs to bee in the target file:) <form name='pdb_id' method=POST action=download.php> <input type=text name=id> <input type='submit' name='submit' value='Download PDB File'> </form> download.php: $id = $_POST['id']; // should return the text the user typed Not sure if this helps you in anyway but it was worth the try :-) Raila
  18. Thanks for te help :-)
  19. I have a textfile that contains the following: < 0> Brann < 0> Fredrikstad <4> viking i whant to separate the "< 0>" (everything between < & >) and the "Name" after the < & > When i have separated the string i whant to echo"Name" (i.e Brann or Fredrikstad or viking) whitout the < > and everything between them. Need all the help i kan get. thank Raila.
×
×
  • 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.