ya i had seen such examples  often. But this is an example. you can the 
following

First change the form action to "self" which actually passes all of your post 
data in the same page.

<form action="self" method="post"

and also u can retrieve the data by this global variable  $PHP_SELF.
u can insert the data to database by checking the $PHP_SELF variable.
Hope this will help..

Habib


--- On Wed, 7/30/08, tomcarr1 <[EMAIL PROTECTED]> wrote:
From: tomcarr1 <[EMAIL PROTECTED]>
Subject: [php_mysql] Passing data from php page to html page. Question from a 
beginner.
To: php_mysql@yahoogroups.com
Date: Wednesday, July 30, 2008, 1:37 PM










    
            I am just learning php.



I have crated 2 web pages. Page test01.html accepts data in a form and

then passes it to page test02.php using this statement:



<form action="test02. php" method="post"



Page test02.php uses the data passed from test01.html to update a

database. I have all of this working.



I am confused about reading data from the database in test02 and

passing it back to be displayed in test01. Can that be done?



All the examples I have seen show a page like test02 creating a web

page on the fly using data from the database, putting it all in in a

big string like $display_block and then using:



echo $display_block;



Is this the only way to do it?



What if test01.html is a big elaborate web page and all you want to do

is display one extra name in it. You get that name from the database

you read in test02.php. Do you have to rebuild all of test01.html with

code in test02.php, or is there some way you can just pass back that

one name?

tc101 is online now Report Post         Edit/Delete Message




      

    
    
        
         
        
        








        


        
        


      

[Non-text portions of this message have been removed]

Reply via email to