English 中文(简体)
网址:www.un.org
原标题:php printing a message in a div [closed]
  • 时间:2011-04-04 12:03:45
  •  标签:
  • php

Can I have someone watch this for me? I want to echo $msg in this div.

$msg = "five";
$msg1 = "<div class= warning ><img src= images/warning_icon.png  alt= Information  width= 32  height= 29  class= icon  /><strong>Warning:</strong>you ve added <?php echo $msg; ?> number of products<a href= #  class= close_notification  title= Click to Close  onclick= this.parentNode.parentNode.removeChild(this.parentNode); ><img src= images/close_icon.gif  width= 6  height= 6  alt= Close  /></a></div>";  
最佳回答

这将是oka。

$msg1 = "<div class= warning >
<img src= images/warning_icon.png  alt= Information  width= 32  height= 29  class= icon  />
<strong>Warning:</strong>you ve added " . $msg . " number of products<a href= #  class= close_notification  title= Click to Close  onclick= this.parentNode.parentNode.removeChild(this.parentNode); >
<img src= images/close_icon.gif  width= 6  height= 6  alt= Close  /></a>
</div>";  

问题是,当你将<代码><?php......放到“string以内,<$msg1

问题回答

I m not sure I understood, but it looks like you might just need

echo "<div>$msg</div>";

您也不妨研究这个关于插图的介绍性网页:

你们正试图在营地中重复一个营地的指挥(在座各位的布道上)。 由于你正在使用双引书,你可以把变数列入插图中。

修改你的法典,以便:

$msg1 = "<div class= warning ><img src= images/warning_icon.png  alt= Information  width= 32  height= 29  class= icon  /><strong>Warning:</strong>you ve added $msg number of products<a href= #  class= close_notification  title= Click to Close  onclick= this.parentNode.parentNode.removeChild(this.parentNode); ><img src= images/close_icon.gif  width= 6  height= 6  alt= Close  /></a></div>";
$msg = "five";
$msg1 = "<div class= warning ><img src= images/warning_icon.png  alt= Information  width= 32  height= 29  class= icon  /><strong>Warning:</strong>you ve added ".$msg." number of products<a href= #  class= close_notification  title= Click to Close  onclick= this.parentNode.parentNode.removeChild(this.parentNode); ><img src= images/close_icon.gif  width= 6  height= 6  alt= Close  /></a></div>";  
$msg = "five";
$msg1 = "<div class= warning ><img src= images/warning_icon.png  alt= Information  width= 32  height= 29  class= icon  /><strong>Warning:</strong>you ve added". $msg ."number of products<a href= #  class= close_notification  title= Click to Close  onclick= this.parentNode.parentNode.removeChild(this.parentNode); ><img src= images/close_icon.gif  width= 6  height= 6  alt= Close  /></a></div>"; 

You have <?php re$msg;?> 载于A.S.R.R.R.C.A.。 您只需要使用<代码><?php一次,以告诉教区说,它有一套php的文字。

$msg = "five";
$msg1 = "<div class= warning ><img src= images/warning_icon.png  alt= Information  width= 32  height= 29  class= icon  /><strong>Warning:</strong>you ve added $msg number of products<a href= #  class= close_notification  title= Click to Close  onclick= this.parentNode.parentNode.removeChild(this.parentNode); ><img src= images/close_icon.gif  width= 6  height= 6  alt= Close  /></a></div>";  

使用<条码>。

$msg = "five";
echo $msg1 = "<div class= warning ><img src= images/warning_icon.png  alt= Information  width= 32  height= 29  class= icon  /><strong>Warning:</strong>you ve added {$msg} number of products<a href= #  class= close_notification  title= Click to Close  onclick= this.parentNode.parentNode.removeChild(this.parentNode); ><img src= images/close_icon.gif  width= 6  height= 6  alt= Close  /></a></div>";  




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签