Jump to content

bob_rock

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

bob_rock's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Yep it did the trick , thank you very much
  2. Hi , I just started to learn php and I ran into a problem.The script should work like this when you press send button it will show the form inputs and go to the other form and when you press send on the other form it does something else.... I understand condition if (!$_POST['xxx']) , but when i press submit on the other form it just starts the script from the beginning ... Thank you This is just a simple example how i imagine the structure of the script, is this correct ? ??? <?php if (!$_POST['button1']) { ?> <form method="post" action="<?php $PHP_SELF?>"/> Name one: <input type="text" name="name" size="10" /><br /> <input type="submit" name="button1" value="Send!" /> <?php } else { $name = $_POST['name']; echo $name; if (!$_POST['button2']) { ?> <form method="post" action="<?php $PHP_SELF?>"/> Name two: <input type="text" name="name2" size="10" /><br /> <input type="submit" name="button2" value="Send" /> <?php } else { $name2 = $_POST['name2']; echo $name2; } } ?>
  3. Hello , I'm new to php and i'm wondering is there anykind of dynamic text box like in flash , where you load text into txtbox and it breaks text apart so it fits the txtbox.  ??? For example I have td size 300x300px and i load external txt into it- The size of the table must stay the same just text must break apart so it fits the box. this would be the code for getting text , and now i want to display it, in a different td. Comment : <br /> <form method="post" action="<?php echo $PHP_SELF;?> "> <textarea rows="5" cols="20" name="besedilo" wrap="physical"></textarea> Email : <input type="text" size="12" name="email" /> <input type="submit" value="submit" name="submit"> </form> <?php $besedilo=$_POST["besedilo"]; $email=$_POST["email"]; $ime="text.txt"; $datoteka=fopen($ime,'a')or die ("napaka pri odpiranju datoteke"); fwrite($datoteka,"<br />".$besedilo."<br />".$email); fclose($datoteka); $tekst = "text.txt"; $fh = fopen($tekst, 'r'); $vsebina = fread($fh, filesize($tekst)); fclose($fh); ?>
  4. yep i know how to use it when it's in a text but in my case if you did take a look at it , i got two variables in fwrite function ($besedilo and $email). I want $besedilo in one line and $email in one line, so when I will use fopen and use text that have been saved in file in one line there will be $besedilo and under this will be $email. Thanks for you efford anyway  :)
  5. Hello , I just started with php and i have a problem with new line in text. I would like that "email" text will be shown in different line that "textarea". I really don't know where to put /n. If this question was answered 10000 times i'm sorry ....  ;) Thank you [code]<form method="post" action="<?php echo $PHP_SELF;?> "> <textarea rows="5" cols="20" name="quote" wrap="physical"></textarea><br /> email:&nbsp;&nbsp;<input type="text" size="12" name="email" ; <input type="submit" value="submit" name="submit"><br /> </form> <?php $besedilo=$_POST["quote"]; $email=$_POST["email"]; $ime="text.txt"; $datoteka=fopen($ime,'a')or die ("napaka pri odpiranju datoteke"); fwrite($datoteka,$besedilo); fwrite($datoteka,$email); fclose($datoteka); ?> <br /> <?php $tekst = "text.txt"; $fh = fopen($tekst, 'r'); $vsebina = fread($fh, filesize($tekst)); fclose($fh); echo $vsebina; ?>[/code]
  6. Here it is, don't know if this is ok , but it's almost working. It reads the number of letters in the word and then it randomly prints out the letters. The anoying thing is that the letters repeat... Sorry for my bad english ...  :P <?php $beseda='Nina'; $sum=strlen($beseda); $i=1; $c=$sum-1; do { $a=$sum-($sum-$i); $i++; $b=rand(0,"$c"); $crka=$beseda[$b]; echo $crka; } while($a<$sum); ?>
  7. hello , I'm new to php , and i'm trying to make a script that will write down random numbers for example form 0-9. I know how to do this , but i don't want the numbers to repeat. thank you,
×
×
  • 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.