 |
| Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

March 17th, 2014, 07:00 PM
|
|
Authorized User
|
|
Join Date: Apr 2013
Posts: 16
Thanks: 2
Thanked 0 Times in 0 Posts
|
|
PHP syntax
Hi, please tell me why the following code. No error message, just doesn't work.
PHP Code:
<input type="text" STYLE="color: #000000; background-color: #AAFFAA;" size=25 name="acctno" value="<? echo $acctno;?>"></td>
<input type=text size=25 STYLE="color: #000000; background-color: #AAFFAA;" name="bname" value="<? echo $bname;?>"><br>
|
|

March 17th, 2014, 07:23 PM
|
|
Authorized User
|
|
Join Date: Jul 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I Believe the Problem is Your Script Tags
Hi ataloss,
I believe I know what might be causing your problem. By default, PHP expects an opening script tag of
and a closing tag of
.
Therefore for the relevant section of your code, I believe you need to write it as follows:
Code:
value=<?php echo $acctno; ?>
and
Code:
<?php echo $bname; ?>
.
Hope this works for you.
Sincerely,
Robert Hieger
Quote:
Originally Posted by ataloss
Hi, please tell me why the following code. No error message, just doesn't work.
PHP Code:
<input type="text" STYLE="color: #000000; background-color: #AAFFAA;" size=25 name="acctno" value="<? echo $acctno;?>"></td>
<input type=text size=25 STYLE="color: #000000; background-color: #AAFFAA;" name="bname" value="<? echo $bname;?>"><br>
|
|
|

March 19th, 2014, 12:59 AM
|
|
Authorized User
|
|
Join Date: Apr 2013
Posts: 16
Thanks: 2
Thanked 0 Times in 0 Posts
|
|
php syntax
Thanks for your response and of course you're right. Following is the current code. The error setting is set as it is to dismiss "undefined variables". The
only display is the date.
PHP Code:
<?php
// ini_set('display_errors', 1);
// ini_set('error_reporting', 2047);
// error_reporting(E_ALL ^ E_NOTICE);
error_reporting(0);
mysql_connect('localhost','root','');
mysql_select_db('oodb') or die("Unable to select database");
$query="SELECT acctno,pd,payrec,orderno,
bname,bstreet,bcity,bstate,bzip,
sname,sstreet,scity,sstate,szip,
terms,duedate
FROM FROM oocust WHERE payrec = 'R' && pd = 'N'";
$result=mysql_query($query);
if(mysql_num_rows($result) )
{
while(list($acctno,$pd,$payrec,$orderno,
$bname,$bstreet,$bcity,$bstate,$bzip,
$sname,$sstreet,$scity,$sstate,$szip,
$terms,$duedate)= mysql_fetch_row($result))
{
}
}
?>
Code:
<input type="text" STYLE="color: #000000; background-color: #D4FFD4;" size=15 value="Billing Date">
<input type="text" STYLE="color: #000000; background-color: #D4FFD4;" size=25 value="Account#"><br>
<input type="text" STYLE="color: #000000; background-color: #AAFFAA;" size=15 name="Date" value="<?php echo date('m/d/y');?>">
<input type="text" STYLE="color: #000000; background-color: #AAFFAA;" size=25 name="acctno" value="<?php echo $acctno;?>">
|
|
 |