Link to home
Start Free TrialLog in
Avatar of Bruce Gust
Bruce GustFlag for United States of America

asked on

How to write a line break in an alert box that's being "echoed" in PHP?

Here's what I've got:

	if($_SESSION['guarantor_session']['PaymentWithin30Days']==0)
			{
				$javascript_message="<script language=\"JavaScript\">
			
				alert(\"Hello<br>How are you?\");
				</script>";
				echo $javascript_message;
			}			

Open in new window


It works exactly the way that I want it to, with the exception that I get this:

User generated image
I want to get a legitimate line break and even after trying "\n," I still don't get a break.

Any suggestions?
SOLUTION
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bruce Gust

ASKER

Excellent, guys!

Thanks!

I've got it working, now I'm trying to make it look prettier. I've got that at https://www.experts-exchange.com/questions/28964572/Is-there-a-way-I-can-make-this-alert-a-little-more-pretty.html. Feel free to weigh in.

Rock on!