To pass the contents of a php page into a text area

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ravisuguna
    New Member
    • Dec 2007
    • 15

    To pass the contents of a php page into a text area

    Hi,

    I want to pass the entire contents of a php page into a text area in another php page..The php page fetches some data from the database.I want those data to be displayed in a text area in another php page.Pl guide me


    php code
    <?php

    if(isset($_POST['id']))
    {
    $id = $_POST['id'];
    $n= count($id);


    echo"<table border='0' cellspacing=0 cellpadding=1 width='80%'>";
    echo " <caption class='h3'>The Services you have selected are</caption><tr class='maroon'> <th>Service</th><th>Cost</th></tr>";

    for($i=0; $i< $n ; $i++)
    {

    $r = mysql_query("se lect * from services where id='$id[$i]'");

    $r1= mysql_fetch_arr ay($r);
    echo "<tr><td>$r 1[service]</td><td align=left>$$r1[service_cost]</td></tr>";
    $D[] .=$r1[service_cost];
    }

    $d= array_sum($D);

    }
    ?>
    <tr><td class='maroon'> Total</td>
    <td><input type='text' width='10px' class='searchbo x' name='total' value='<? echo "$".$d; ?>'></td></tr>
    <tr><td></td><td align=left><inp ut type='button' value='send' href="www.paypa l.com"></td></tr>


    </table>
    </div>
    </div>
    </body>
    </html>
  • adamalton
    New Member
    • Feb 2007
    • 93

    #2
    Could you just do this?..
    [HTML]<html><head></head><body>
    <form action="whateve r" method="post">
    <textarea name="my_textar ea">
    <?php
    include 'page_that_gets _stuff_from_dat abase.php';
    ?>
    </textarea>
    </form></body></html>[/HTML]

    Comment

    • Markus
      Recognized Expert Expert
      • Jun 2007
      • 6092

      #3
      Originally posted by adamalton
      Could you just do this?..
      [HTML]<html><head></head><body>
      <form action="whateve r" method="post">
      <textarea name="my_textar ea">
      <?php
      include 'page_that_gets _stuff_from_dat abase.php';
      ?>
      </textarea>
      </form></body></html>[/HTML]
      That does seem so much easier..

      Comment

      Working...