Wie speichere ich HTML in einer PHP-Variablen? [geschlossen]
Ich erstelle eine PHP-Seite Ich möchte alle HTML-Dateien in einer einzelnen PHP-Variablen speichern und dann Ajax verwenden. Wie ich diese HTML-Dateien in PHP-Variablennamen # msg speichere, ist hier mein Code:
$msg="<div id="new2" style="background:#fff; width:779px; min-height:310px;">
<table align="center" width="779px" cellpadding="0" cellspacing="0" id="tb1">
<tr style="height:28px; font-size:12px;">
<td style="width:246px">Name</td>
<td style="width:145px">CITY</td>
<td style="width:102px">ABCDEF</td>
<td style="width:71px">BUDGET</td>
<td style="width:102px">MEMBERSHIP</td>
<td style="width:84px" id="td1">UNTIL</td>
</tr>
</table>
<?php
$color='#DADDE2';
$business=getbussinesspagination(0,$start,$per_page);
if ($business){
while ($row = $business->fetch_assoc ()){
if($color=='#DADDE2')
$color='#F9F9F9';
else
$color='#DADDE2';
?>
<div id="m1" style="width:246px; height:28px; background:<?php echo $color; ?>; float:left"><p style="padding-left:45px; margin-top:8px;"><?php echo ($row['title']); ?></p></div>
<div id="m2" style="width:145px; height:28px; float:left; margin:0 0 0 1px;background:<?php echo $color; ?>"><p style="padding-left:30px; margin-top:8px;"><?php echo ($row['cityName']); ?></p></div>
<div id="m3" style="width:101px; height:28px; float:left; margin:0 0 0 1px;background:<?php echo $color; ?>"><p style="padding-left:40px; margin-top:8px;"><?php if($row['article']!=''){ echo 'A';} if($row['event']!=''){echo 'E'; } ?></p></div>
<div id="m4" style="width:70px; height:28px; float:left; margin:0 0 0 1px;background:<?php echo $color; ?>"><p style="padding-left:25px; margin-top:8px;"><?php echo ($row['credit']); ?></p></div>
<div id="m5" style="width:99px; height:28px; float:left; margin:0 0 0 1px;background:<?php echo $color; ?>"><p style="padding-left:25px; margin-top:8px;"><?php echo ($row['name']); ?></p></div>
<div id="m6" style="width:84px; height:28px; float:left; margin:0 0 0 1px;background:<?php echo $color; ?>"><p style="padding-left:10px; margin-top:8px;"><?php echo ($row['renewal_date']); ?></p></div>
<div id="m7" style="width:23px; height:28px; float:left; margin:0 0 0 1px;background:<?php echo $color; ?>"><img src="messg.png" style="margin:8px 0 0 2px;"></div>
<?php
}
}
?>
<div id="m1" style="width:246px; height:28px; background:#DADDE2; float:left"></div>
<div id="m2" style="width:145px; height:28px; float:left; margin:0 0 0 1px;background:#DADDE2;"></div>
<div id="m3" style="width:101px; height:28px; float:left; margin:0 0 0 1px;background:#DADDE2;"></div>
<div id="m4" style="width:70px; height:28px; float:left; margin:0 0 0 1px;background:#DADDE2;"></div>
<div id="m5" style="width:99px; height:28px; float:left; margin:0 0 0 1px;background:#DADDE2;"></div>
<div id="m6" style="width:84px; height:28px; float:left; margin:0 0 0 1px;background:#DADDE2;"></div>
<div id="m7" style="width:23px; height:28px; float:left; margin:0 0 0 1px;background:#DADDE2;"><img src="messg.png" style="margin:8px 0 0 2px;"></div>
<div id="m1" style="width:246px; height:28px; background:#F9F9F9; float:left"></div>
<div id="m2" style="width:145px; height:28px; float:left; margin:0 0 0 1px;background:#F9F9F9;"></div>
<div id="m3" style="width:101px; height:28px; float:left; margin:0 0 0 1px;background:#F9F9F9;"></div>
<div id="m4" style="width:70px; height:28px; float:left; margin:0 0 0 1px;background:#F9F9F9;"></div>
<div id="m5" style="width:99px; height:28px; float:left; margin:0 0 0 1px;background:#F9F9F9;"></div>
<div id="m6" style="width:84px; height:28px; float:left; margin:0 0 0 1px;background:#F9F9F9;"></div>
<div id="m7" style="width:23px; height:28px; float:left; margin:0 0 0 1px;background:#F9F9F9;"><img src="messg.png" style="margin:8px 0 0 2px;"></div>
<div id="m1" style="width:246px; height:28px; background:#DADDE2; float:left"></div>
<div id="m2" style="width:145px; height:28px; float:left; margin:0 0 0 1px;background:#DADDE2;"></div>
<div id="m3" style="width:101px; height:28px; float:left; margin:0 0 0 1px;background:#DADDE2;"></div>
<div id="m4" style="width:70px; height:28px; float:left; margin:0 0 0 1px;background:#DADDE2;"></div>
<div id="m5" style="width:99px; height:28px; float:left; margin:0 0 0 1px;background:#DADDE2;"></div>
<div id="m6" style="width:84px; height:28px; float:left; margin:0 0 0 1px;background:#DADDE2;"></div>
<div id="m7" style="width:23px; height:28px; float:left; margin:0 0 0 1px;background:#DADDE2;"><img src="messg.png" style="margin:8px 0 0 2px;"></div>
<div id="m1" style="width:246px; height:28px; background:#F9F9F9; float:left"></div>
<div id="m2" style="width:145px; height:28px; float:left; margin:0 0 0 1px;background:#F9F9F9;"></div>
<div id="m3" style="width:101px; height:28px; float:left; margin:0 0 0 1px;background:#F9F9F9;"></div>
<div id="m4" style="width:70px; height:28px; float:left; margin:0 0 0 1px;background:#F9F9F9;"></div>
<div id="m5" style="width:99px; height:28px; float:left; margin:0 0 0 1px;background:#F9F9F9;"></div>
<div id="m6" style="width:84px; height:28px; float:left; margin:0 0 0 1px;background:#F9F9F9;"></div>
<div id="m7" style="width:23px; height:28px; float:left; margin:0 0 0 1px;background:#F9F9F9;"><img src="messg.png" style="margin:8px 0 0 2px;"></div>
<div id="m1" style="width:246px; height:28px; background:#DADDE2; float:left"></div>
<div id="m2" style="width:145px; height:28px; float:left; margin:0 0 0 1px;background:#DADDE2;"></div>
<div id="m3" style="width:101px; height:28px; float:left; margin:0 0 0 1px;background:#DADDE2;"></div>
<div id="m4" style="width:70px; height:28px; float:left; margin:0 0 0 1px;background:#DADDE2;"></div>
<div id="m5" style="width:99px; height:28px; float:left; margin:0 0 0 1px;background:#DADDE2;"></div>
<div id="m6" style="width:84px; height:28px; float:left; margin:0 0 0 1px;background:#DADDE2;"></div>
<div id="m7" style="width:23px; height:28px; float:left; margin:0 0 0 1px;background:#DADDE2;"><img src="messg.png" style="margin:8px 0 0 2px;"></div>
<div id="m1" style="width:246px; height:28px; background:#F9F9F9; float:left"></div>
<div id="m2" style="width:145px; height:28px; float:left; margin:0 0 0 1px;background:#F9F9F9;"></div>
<div id="m3" style="width:101px; height:28px; float:left; margin:0 0 0 1px;background:#F9F9F9;"></div>
<div id="m4" style="width:70px; height:28px; float:left; margin:0 0 0 1px;background:#F9F9F9;"></div>
<div id="m5" style="width:99px; height:28px; float:left; margin:0 0 0 1px;background:#F9F9F9;"></div>
<div id="m6" style="width:84px; height:28px; float:left; margin:0 0 0 1px;background:#F9F9F9;"></div>
<div id="m7" style="width:23px; height:28px; float:left; margin:0 0 0 1px;background:#F9F9F9;"><img src="messg.png" style="margin:8px 0 0 2px;"></div>
<div id="m1" style="width:246px; height:28px; background:#DADDE2; float:left"></div>
<div id="m2" style="width:145px; height:28px; float:left; margin:0 0 0 1px;background:#DADDE2;"></div>
<div id="m3" style="width:101px; height:28px; float:left; margin:0 0 0 1px;background:#DADDE2;"></div>
<div id="m4" style="width:70px; height:28px; float:left; margin:0 0 0 1px;background:#DADDE2;"></div>
<div id="m5" style="width:99px; height:28px; float:left; margin:0 0 0 1px;background:#DADDE2;"></div>
<div id="m6" style="width:84px; height:28px; float:left; margin:0 0 0 1px;background:#DADDE2;"></div>
<div id="m7" style="width:23px; height:28px; float:left; margin:0 0 0 1px;background:#DADDE2;"><img src="messg.png" style="margin:8px 0 0 2px;"></div>
<div id="m1" style="width:246px; height:28px; background:#F9F9F9; float:left"></div>
<div id="m2" style="width:145px; height:28px; float:left; margin:0 0 0 1px;background:#F9F9F9;"></div>
<div id="m3" style="width:101px; height:28px; float:left; margin:0 0 0 1px;background:#F9F9F9;"></div>
<div id="m4" style="width:70px; height:28px; float:left; margin:0 0 0 1px;background:#F9F9F9;"></div>
<div id="m5" style="width:99px; height:28px; float:left; margin:0 0 0 1px;background:#F9F9F9;"></div>
<div id="m6" style="width:84px; height:28px; float:left; margin:0 0 0 1px;background:#F9F9F9;"></div>
<div id="m7" style="width:23px; height:28px; float:left; margin:0 0 0 1px;background:#F9F9F9;"><img src="messg.png" style="margin:8px 0 0 2px;"></div>
<div id="m1" style="width:246px; height:28px; background:#DADDE2; float:left"></div>
<div id="m2" style="width:145px; height:28px; float:left; margin:0 0 0 1px;background:#DADDE2;"></div>
<div id="m3" style="width:101px; height:28px; float:left; margin:0 0 0 1px;background:#DADDE2;"></div>
<div id="m4" style="width:70px; height:28px; float:left; margin:0 0 0 1px;background:#DADDE2;"></div>
<div id="m5" style="width:99px; height:28px; float:left; margin:0 0 0 1px;background:#DADDE2;"></div>
<div id="m6" style="width:84px; height:28px; float:left; margin:0 0 0 1px;background:#DADDE2;"></div>
<div id="m7" style="width:23px; height:28px; float:left; margin:0 0 0 1px;background:#DADDE2;"><img src="messg.png" style="margin:8px 0 0 2px;"></div>
</div>