Wrox Programmer Forums
|
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
 
Old March 17th, 2014, 07:00 PM
Authorized User
 
Join Date: Apr 2013
Posts: 16
Thanks: 2
Thanked 0 Times in 0 Posts
Default 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>
 
Old March 17th, 2014, 07:23 PM
Authorized User
 
Join Date: Jul 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to rhieger
Default 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
Code:
<?php
and a closing tag of
Code:
?>
.

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 View Post
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>
 
Old March 19th, 2014, 12:59 AM
Authorized User
 
Join Date: Apr 2013
Posts: 16
Thanks: 2
Thanked 0 Times in 0 Posts
Default 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;?>">





Similar Threads
Thread Thread Starter Forum Replies Last Post
Leading PHP Web Developer for PHP website development epixeltechno Perl 1 November 13th, 2011 10:26 PM
PHP Syntax gilbertsavier Beginning PHP 1 July 18th, 2009 05:01 AM
Beg. PHP 5 > Ch. 11 - fetch_field.php crater BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 0 January 2nd, 2007 12:20 PM
begin php & mysql - chapter 12, user_form.php jon_stubber Beginning PHP 1 March 9th, 2006 10:57 AM
Error: movie.php & commit.php on p182-186, ch6 willburke BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 October 12th, 2004 02:48 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.