Jump to content

noob question


bob_rock

Recommended Posts

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]
Link to comment
https://forums.phpfreaks.com/topic/31814-noob-question/
Share on other sites

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  :)
Link to comment
https://forums.phpfreaks.com/topic/31814-noob-question/#findComment-147523
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.