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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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