www.webdeveloper.com
Results 1 to 2 of 2

Thread: php input boxes

  1. #1
    Join Date
    Apr 2013
    Posts
    40

    php input boxes

    I realize that code I used in the past finds disfavor with many
    and I'm trying to improve. However if it works... Here's the code
    to my current work. My problem is that only one line generates value
    from my database (I've confirmed the database field). I've commented
    the line that works. If I substitute that line in another it works but
    editing the relocated line doesn't work. Also the date doesn't work.
    I get no error messages. I'll appreciate any constructive criticism:
    HTML Code:
    <html><body background="oldorchard.jpg"><center>
    PHP Code:
    <?php
     error_reporting
    (E_ALL E_NOTICE);
    error_reporting(0);
    mysql_connect('localhost','root',''); 
    mysql_select_db('homedb') or die("Unable to select database"); 
    $query="SELECT acctno,pd,payrec,orderno,
    bname,bstreet,
    $city,bstate,bzip,
    sname,sstreet,scity,sstate,szip,
    terms,duedate FROM oocust WHERE payrec = 'R' && pd = ''"
    ;
    $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))
       { 
    <!--
    the below code is for the date-->
        
    $format "D M d Y g:ia";
        
    $date date($formattime());
    <!--
    the above code is for the date-->
    ?>
    <form name='form'>
    <input type=text size=25 value="Old Orchard Plumbing">
    <input type=text size=25 value="2210 E. Hogan Hollow Road">
    <input type=text size=25 value="Margate, Fl  33063"><p>
    <!--?-->
    <input type=text size=25 value="Date - <?php echo $mm/dd/yyyy;?>" />
    <!--?-->
    <!--the below line inserts the database field-->
       <input type=text size=25 value="Acct# - <?php echo $acctno;?>" /><br>
    <!--the above line inserts the database field-->

    <TABLE BORDER=0 CELLPADDING=10 CELLSPACING=10>
          <TD>
    <p><label for="bname"><b>
    <input type=text size=25 value="Bill To"><br>
           <input type=text size=25 value="Name<?php echo $bname;?>" /><br>
    <input type=text size=25 value="Street - <?php echo $bstreet;?>" /><br>
        <input type=text size=25 value="City - <?php echo $bcity;?>" /><br>
      <input type=text size=25 value="State - <?php echo $bstate;?>" /><br>
          <input type=text size=25 value="Zip - <?php echo $bzip;?>" />
         </TD>
       <td>
    <p><label for="sname"><b>
       <input type=text size= 25 value="Ship To"><br> 
        <input type=text size=25 value="Name - <?php echo $sname;?>" /><br>
    <input type=text size=25 value="Street - <?php echo $sstreet;?>" /><br>
        <input type=text size=25 value="City - <?php echo $scity;?>" /><br>
      <input type=text size=25 value="State - <?php echo $sstate;?>" /><br>
          <input type=text size=25 value="Zip - <?php echo $szip;?>" />
         </TD>
          <TR>       
         <TD>
         <input type=text size=25 value="Terms - <?php echo $terms;?>" /><br>    
    <input type=text size=25 value="Due Date - <?php echo $duedate;?>" /><br>
      <input type=text size=25 value="order# - <?php echo $orderno;?>" />
         </td>
        <TD>
    <img src="dave pic.jpg" width=175 height=200>
        </td> 
       </tr>
        </table>
      <?php
        
    }
        } 
    ?>
    HTML Code:
    </form></body></HTML>

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    18,926
    As a quick suggestion for a first step in debugging, comment out this line, since it is turning off all error reporting:
    PHP Code:
    error_reporting(0); 
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles