Forum Moderators: coopster

Message Too Old, No Replies

Create a new line?

         

zulx

7:22 pm on Feb 4, 2004 (gmt 0)

10+ Year Member



When the choices of the checkbox is printed out, how can I get it to print on a new line instead. Currently it prints like this:

checkbox1 checkbox2

I would like it to be like this:

checkbox1
checkbox2

Here's the abstract of my scripts:

<?php
if(isset($_POST['checkbox1'])){
echo $_POST['checkbox1'];
}
if(isset($_POST['checkbox2'])){
echo $_POST['checkbox2'];
}
?>

Thanks

Timotheos

7:42 pm on Feb 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Zulx, welcome to Webmaster World!

You'll have to echo some html tags to get the formatting you want. Easiest way is to append some break tags.

<?php
if(isset($_POST['checkbox1'])){
echo $_POST['checkbox1'] . "<br>";
}
if(isset($_POST['checkbox2'])){
echo $_POST['checkbox2'] . "<br>";
}
?>

RonPK

7:45 pm on Feb 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi zulx,

Try good old <br>:

echo $_POST['checkbox1'], '<br>';

If you want a newline in the output as well:

echo $_POST['checkbox1'], "<br>\n";

zulx

7:48 pm on Feb 4, 2004 (gmt 0)

10+ Year Member



Perfecto! <br>
Cheers Mates! Hehe