PHP in HTML code
| From: | Martine Osias | Date: | Sat, 13 Mar 2010 02:58:18 +0000 |
| Subject: | PHP in HTML code | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-302768@lists.php.net to get a copy of this message | ||
An HTML/PHP code migrated to a different hosting platform seems to behave differently. The PHP statements within HTML fields or within tables does not execute
PHP within table:
<tr>
<td align="left"><?="«".$_SESSION['scripture_text']."»"?></td>
</tr>
This PHP code doesn't print in the HTML page.
PHP within form field:
<input type="text" name="reservation_date" value="<?=$_GET['rdate'];?>" readonly="">
This PHP code shows on the page when it shouldn't. The same variable is an input and an output in this form:
********************************************
<form name="frm" method="post" action="ins_reservation.php" onsubmit="return (submitonce(this) && doValidate(this));">
<table border="0" width="100%" align="center">
<tr>
<td valign="top" width="23%">
<strong>Your Pledge For:</strong></strong></td>
<td width="75%">
<p>
<?php if($_POST['reservation_date'] != "") { ?>
<input type="text" name="reservation_date" value="<?=$_POST['reservation_date'];?>" readonly="">
<?php }else { ?>
<input type="text" name="reservation_date" value="<?=$_GET['rdate'];?>" readonly="">
<?php } ?>
<img src="images/cal.gif" onclick="cal17.select(document.forms[0].reservation_date,'anchor17','MM/dd/yyyy'); return false;" name="anchor17" id="anchor17">
<!--<td width="1%">-->
<?php require("calendar/make_update_calendar.php"); ?>
</p>
<?php if ($totalRows_findme == 0 && $_GET['email'] != "") { // Show if recordset empty ?>
<span class="style1">Not found. Please enter info</span> <?php } // Show if recordset empty ?></td>
</tr>
</table>
<table border="0" width="100%" align="center">
<?php if ($totalRows_findme == 0) { // Show if recordset empty ?>
<tr>
<td class="st1">Email:<span style="color: #CC0000;">*</span></td>
<td class="st1"><input name="email" type="text" class="v_email" id="email" value="<?=$_GET['email'];?>" />
<span style="padding-left: 3px;">
<input type="button" name="button" id="button" value="Get my Information" onclick="getacctt()" />
</span></td>
</tr>
<tr>
<td width="34%" class="st1"> First Name:<span style="color: #CC0000;">*</span> </td>
<td width="66%" class="st1"><input name="first_name" type="text" class="v_required" value="<?=$_GET['fname'];?>" /></td>
</tr>
<tr>
<td class="st1">Last Name:<span style="color: #CC0000;">*</span></td>
*******************************************
Are there times when the <? statements in HTML code don't execute?