echo not cooperating

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dreeves
Forum Commoner
Posts: 39
Joined: Thu Oct 22, 2009 8:53 am

echo not cooperating

Post by dreeves »

When my form is submitted and entered into the database, I use 'echo' to display information to the user. When the form is submitted successfully the user should see:
I use this code:

echo "No errors occurred";
echo "$row record was added successfully";
echo "Thank you";

I am hoping to see:

No errors occurred
1 record was added successfully
Thank you

but instead I get:
No errors occurred1 record was added successfullyThank you

What's the problem? Why won't it enter it on multiple lines?
Reviresco
Forum Contributor
Posts: 172
Joined: Tue Feb 19, 2008 4:18 pm
Location: Milwaukee

Re: echo not cooperating

Post by Reviresco »

You need to add breaks, paragraphs, etc.

Code: Select all

echo "No errors occurred<br />";
echo "<p>No errors occurred</p>";
dreeves
Forum Commoner
Posts: 39
Joined: Thu Oct 22, 2009 8:53 am

Re: echo not cooperating

Post by dreeves »

Got it. Thanks.
I used
echo "text <br>\n";
Post Reply