SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    May 2002
    0 Post(s)
    0 Thread(s)

    Exclamation HTML table using PHP

    Ok, here's my problem. At the moment i'm writing a HTML form. A person fills out the form and then submits the details with a 'submit' button on the
    bottom of the screen. Then, using PHP the details that the person has entered are used to create a completed copy of the form which the person can
    then print out. In other words when the person presses submit a new page is generated that, using a javascript function, contains a completed copy of
    the form. My problem lies with how i present this info in the form. When a person enters information on the first page its all very straight forward.
    For instance, to enter his/her name i use the following line of code (i've created the form using tables)

    <td><input type = "text" name="persons_name" value = "<?php echo $persons_name ?>" size="43"></td>

    All very straight forward (if someones reading this and asking where did u get the "<?php echo $persons_name ?>" thats not important to the problem so
    don't worry about it)

    As you can see a little text box is created that the person fills their name into. The problem is when i want to then reproduce that on the completed
    form ie. display the persons name, it doesn't quite work. Again i use

    <td><input type = "text" name="persons_name" value = "<?php echo $persons_name ?>" size="43"></td>

    to display the name and this works fine in Internet Explorer. The problem is with Netscape. It doesn't display the persons name because i'm using 'input
    type = "text"'. So what i want to know is how do i as such create an 'output' text box that will hold my information. Before everyone starts replying,
    just use a textarea, that isn't what i'm looking for. All i need is a little box (with NO scrollbar or anything) that will hold the persons name. Sounds
    nice and easy but i can't seem to find an answer. Can anyone help??please!thanks,

  2. #2
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Nashvegas Baby!
    0 Post(s)
    0 Thread(s)
    Is there a reason why you're using FORMS on the page that is to be printed? Why not just print out the variables to the page in plain HTML?

    <b><?php echo($first_name); ?></b><br>

    <b><?php echo($last_name); ?></b><br>

    <b><?php echo($phone_number); ?></b><br>

    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  3. #3
    SitePoint Enthusiast
    Join Date
    Apr 2002
    0 Post(s)
    0 Thread(s)
    There's no reason why this shouldn't work. I guess it's more likely a Javscript / Browser issue than PHP.

    Do you have an example for us to view?

    But I am also surprised you display this in form-fields instead of a good old table...


Posting Permissions

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