www.webdeveloper.com
Results 1 to 5 of 5

Thread: html/php

  1. #1
    Join Date
    Apr 2013
    Location
    gastonia NC
    Posts
    91

    html/php

    Merry Christmas. i'm trying to code up a dark figured page with input boxes
    with values in them which will be displaced with user input. You guys have
    been great helping with my pastime and I hope will now. I'm including my
    feeble attempt below:
    PHP Code:
    <html><body background="oldorchard.jpg "bgcolor="#ccffff"><b><center>
    <?php
    // echo "date("m/d/Y");

    <input type=text size=25 value="Invoice<? echo '$acctno'?></b><br />";

    /****** I think the above line is closest to being the right code ******/

    echo "Invoice No: $acctno</b><br />";
    include (
    'getpercent');
    // error_reporting(E_ALL ^ E_NOTICE);
    error_reporting(0)
    $result=mysql_query($query);
    $num=mysql_numrows($result);
    while(
    $row mysql_fetch_array($result))
    {
    mysql_select_db('homedb') or die( "Unable to select database");
    $query="SELECT  * FROM oocust WHERE payrec = 'R' && pd = ' '";
    $result=mysql_query($query);
    $num=mysql_numrows($result);
    echo 
    date('m/d/y');
    $result=mysql_query($query);
    if(
    mysql_num_rows($result))  
       {
    while(list(
    $acctno$orderno$bname$bstreet
    $bcity$bstate$bzip,  $sname$sstreet$scity
    $sstate$szip$terms$fob$descr$charges,  $tax$amtdue)= mysql_fetch_row($result))
       { 
    <
    TABLE BORDER="1" CELLPADDING="10" CELLSPACING="10">
           <
    TD>
    <
    TABLE BORDER="1" CELLPADDING="3" CELLSPACING="3">
           <
    TD>
    <
    TABLE BORDER="1" CELLPADDING="1" CELLSPACING="1">
       
    <
    td><input type=text size=25 value="Bill To:"><br>


    /***** below another attempt *****/
          
    <input type=text size=25 value="$bname"><br>

          <
    input type=text size=25 value="$bname"><br>
      <
    input type=text size=25 value="$bstreet:">><br>
          <
    input type=text size=25 value="$bcity"><br>
         <
    input type=text size=25 value="$bstate"><br>
           <
    input type=text size=25 value="$bzip"></TD><p>
         <
    td>
    <
    input type=text size=25 value="Ship To:"><br>    
     <
    input type=text size=25 value="$sname:"><br>
     <
    input type=text size=25 value="$street"><br>
      <
    input type=text size=25 value="$scity"><br>
     <
    input type=text size=25 value="$sstate"><br>
       <
    input type=text size=25 value="$szip"><p></TD>    
          <
    tr>
        <
    td>
         <
    input type=text size=25 value="Terms: $terms"><br>
    <
    input type=text size=25 value="Due Date: $duedate"><br>
    <
    input type=text size=25 value="Order No: $orderno"></TD
          <
    TD>
    <
    img src="dave pic.jpg" width=250 height=350></td>
    }
    }
    }
    ?>
       </b></BODY></HTML>

  2. #2
    Join Date
    Jul 2013
    Location
    Voorheesville NY USA
    Posts
    859
    So many things wrong with your code - right from line 1. And you don't tell us AT ALL what you are having trouble accomplishing.

    Line 1 -
    <input type=text size=25 value="Invoice<? echo '$acctno'?></b><br />";

    - No quotes on your type attribute
    - A starting double quote on your value attribute and then some text and a variable value(needlessly in quotes!) then a bold end tag, a newline and no end of your input tag.

    And to sum it all up - this line is NOT php so it needs to be echoed itself!

    Perhaps if you have some code that actually does something then you can tell us what you want it to do differently/correctly and we can help you out.

    Merry Xmas to you and yours and good luck in the new year with your attempts at programming.

  3. #3
    Join Date
    Dec 2013
    Posts
    2
    PHP and HTML interact a lot: PHP can generate HTML, and HTML can pass information to PHP.

  4. #4
    Join Date
    Dec 2013
    Posts
    4
    Not forgetting the variable $acctno hasn't even been assigned a value at that point.

    This is awful code, if you can call it code??!!

    Like ginerjm said, "good luck in the new year with your attempts at programming".

  5. #5
    Join Date
    Dec 2013
    Posts
    63
    ...and please don't use background="...", bgcolor="..." or center tags. Such things should be placed in css.

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