How do I add a line break between these two lines when they get outputted?
<?php
$first=$_POST[‘first’]; $second=$_POST[‘second’];
?>
[code=php] <?php $first = $_POST['first']; $second = $_POST['second']; echo "$first <br> $second" ?> [/code]
[code=php] <?php $first = $_POST['first']; $second = $_POST['second']; echo("First:" . $first . "<br>Second:" . $second . "rn"); ?> [/code]
[code=php] <?php if(isset($_POST['first'])) { $first = $_POST['first']; }else{ $first = "Unset"; } if(isset($_POST['second'])) { $first = $_POST['second']; }else{ $first = "Unset"; } echo("First:" . $first . "<br>Second:" . $second . "rn"); ?> [/code]
[code=php] <?php $first - $_POST['first']; $second = $_POST['second']; // an escaped new line (n) for win/*nix // an and escaped return (r) for mac echo $first . 'nr' . $second; ?>[/code]
[code=php]<?php $myFile = "file1.txt"; $fh = fopen($myFile, 'r'); $theData = fread($fh, filesize($myFile)); fclose($fh); echo $theData; ?> <html> <body> <form action="insert.php" method="post"> First Name: <input type="text" name="first"> <br> Enter Sentence: <input name="second" type="text" value="" size="50" maxlength="50" /> <br/> <input type="Submit" value="Enter"> </form> </body> </html>[/code]
[code=php]<?php $first - $_POST['first']; $second = $_POST['second']; ?> <html> <body> <? $ffile = "file1.txt"; $fh = fopen($ffile, 'w'); fwrite($fh, $count); fwrite($fh, "n"); fwrite($fh,$first); fwrite($fh,$second); fclose($fh); $myFile = "file.txt"; $fh = fopen($myFile, 'r'); $theData = fread($fh,1); fclose($fh); if ($theData == 0){ $count=1; $ffile = "file.txt"; $fh = fopen($ffile, 'w'); fwrite($fh, $count); fwrite($fh, "n"); fwrite($fh,$first); fwrite($fh,$second); fclose($fh); } else{ $ffile = "file.txt"; $fh = fopen($ffile, 'a'); fwrite($fh, $count); fwrite($fh, "n"); fwrite($fh,$first); fwrite($fh,$second); fclose($fh); } $myFile = "file.txt"; $fh = fopen($myFile, 'r'); $theData = fread($fh, filesize($myFile)); fclose($fh); ?> <br><hr> <? echo $theData?> <hr> <form action="index.php"> <input type="Submit" title="back"> </form> </body> </html>[/code]
Help @cin_ruz spread the word by sharing this article on Twitter...