Want to show fetched data in page.
Somebody help me in this.
My problem is that in my main page i have a form.
When i click submit button i want to fetch the data and i need to show that data in my form page itself not in another page. How to do this.
I have written the query and i fetched the data but i cant display it in my main page where i had the form. I can display it in another page only.
How to send the fetched data from one page to another page. Somebody help me out in detail.
Unless I misunderstand your question, I don't think you can do what you are attempting. In any browser known to me, when you submit a form by clicking a submit button, the browser will automatically fetch a new page. The content of the newly displayed page will consist of whatever the CGI form handler returns, which, as the CGI programmer, can be anything you want.
I will hazard a guess that you are really asking how to exchange data between the browser and server without causing the page to be re-drawn. As I understand it, the usual solution to this is through AJAX mechanisms. It is probably beyond the scope of one LQ thread to fully describe how to accomplish that, but there is plenty of online documentation that explains the process. The Wikipedia AJAX page is probably a good jumping off point.
Based on your other posts, I'll assume PHP. Did you even try to look this up?? First hit for "passing data from one php page to another":
You really should get a book on the basics of PHP programming, and look at one of the MANY PHP tutorials you can find online, and learn the basics.
I agree with TBOne. How are we to know what's your programming environment if you dont tell us.
But there are some ways to achieve what you need -- assuming that you are learning HTML.
Uuse hidden fields as below.
(1) Initially, at the very beginning of the program,
(1a) Check that the hidden field is defined and if defined does it have a value.
(1b) If so then set a flag not to initialise the data in the form.
(2) Proceed as usual.
(3) Finally, when the submit button is clicked, first populate the hidden field with data.
(4) Now if your GET/POST/SCRIPT CALL is set to call the same code then, step (1a) will be true ...
|All times are GMT -5. The time now is 07:20 PM.|