LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 12-30-2011, 10:00 AM   #1
PradeepRahul
LQ Newbie
 
Registered: Dec 2011
Location: Chennai
Posts: 8

Rep: Reputation: Disabled
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.
 
Old 12-30-2011, 12:41 PM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
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.

--- rod.
 
Old 12-30-2011, 12:50 PM   #3
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 15,078

Rep: Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713
Quote:
Originally Posted by PradeepRahul View Post
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.
Help you with WHAT?? You don't provide any useful details...all you tell is is there's a "form", and you want to send data to another page. Great...how about telling us what this form is written in? Where the data is going TO? Is this PHP? JSP? ASP? What?? ANY Details at all??

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":
http://mrarrowhead.com/index.php?pag..._variables.php

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.
 
Old 01-03-2012, 03:28 AM   #4
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Distribution: UBUNTU 5.10 since Jul-18,2006 on Intel 820 DC
Posts: 658

Rep: Reputation: 160Reputation: 160
Hi Pradeep,

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 ...

OK

Last edited by AnanthaP; 01-03-2012 at 03:30 AM.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OCI limitation on size of data fetched ? ALInux Linux - Server 0 12-13-2009 07:11 PM
Disappearing mail fetched with fetchmail simjii Linux - Software 2 12-02-2009 04:23 AM
retreived data and display data upon choice from first page? ati Programming 0 05-06-2006 06:43 AM
How to send "fetched"mail into a separate folder for each pop3 account fetched anovick Linux - Newbie 2 03-12-2005 08:24 AM
Man page does'nt show up. Kernel 2.6.9, Slackware 10.0 Adan Linux - Software 4 12-22-2004 02:28 PM


All times are GMT -5. The time now is 06:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration