Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 11-11-2009
Member
 
Join Date: Aug 2009
Posts: 51
Response of a PHP form in variable

I will explain my problem:

I have a php page that offers a form of this type <forms action="login.php" method="post"> "

I would like to have the response of this form of login.php page in a variable, is this possible?

A diagram:
Page 1 => send form => Page 2
Page 2 => dispatch resp. => Page 1
Page 1 => Backup page.
Reply With Quote
  #2  
Old 11-11-2009
Member
 
Join Date: Apr 2008
Posts: 2,001
Re: Response of a PHP form in variable

Use session. PHP Session consists of a way to preserve certain data across subsequent accesses. This enables you to build customized applications and increase the appeal of your web site. Session handling was added in PHP 4.0.0 and so if you are having version 4.0 then it would be best option for you. For more information: http://www.php.net/manual/en/intro.session.php
Reply With Quote
  #3  
Old 11-11-2009
Member
 
Join Date: Aug 2009
Posts: 51
Re: Response of a PHP form in variable

Page 1 => send form => Page 2
Page 2 => dispatch resp. => Page 1
Page 1 => Backup page.

in fact I have a whole list of parameters, and what I want to do is my top number 1 transfer form with each parameter one by one and saves the response on Page 2 in a file.

without displaying page 2 if possible and all automatically without clicking anywhere

is this possible given that I just do not change on page 2?
Reply With Quote
  #4  
Old 11-11-2009
Member
 
Join Date: May 2008
Posts: 685
Re: Response of a PHP form in variable

What is the response to page2? Is this an HTML page and want to recover the code? I recommend you always Ajax's jQuery for this type of coding.

Syntax

Code:
jQuery.post( url,[data],[callback],[type])
Quote:
Description:

Load a remote page using an HTTP POST request.

This is an easy way to send a simple POST request to a server without having to use the more complex $.ajax function. It allows a single callback function to be specified that will be executed when the request is complete (and only if the response has a successful response code).

The returned data format can be specified by the fourth parameter. If you need to have both error and success callbacks, you may want to use $.ajax. $.post is a (simplified) wrapper function for $.ajax.

$.post() returns the XMLHttpRequest that it creates. In most cases you won't need that object to manipulate directly, but it is available if you need to abort the request manually.
Check a few examples, I think it may interest you.
Reply With Quote
  #5  
Old 11-11-2009
Member
 
Join Date: Aug 2009
Posts: 51
Re: Response of a PHP form in variable

So if I understood in my page1.php, I have to code for example:

HTML Code:
$.post("page2.php", 
    {  accountName: "conte1", 
     password: "azerty" 
 }, 
   function(data){ 
     alert("Data Loaded: " +  data); 
   } 
 );
or I have created the form in html and the script will handle the post and returned to me the answer?
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Response of a PHP form in variable"
Thread Thread Starter Forum Replies Last Post
Google Chrome is opening in basic HTML form instead of the Standard form Beatrix Technology & Internet 5 25-05-2011 10:21 PM
how to get items in a form to auto-resize with the form using visual basic deansmylie93 Software Development 2 02-05-2011 07:06 AM
Runtime Error 91 : Object Variable or with block variable not set Ryan21 Software Development 2 28-08-2009 07:51 PM
What is Global Variable static? Declaring static variable instead of Global variable Reckon Software Development 3 25-04-2009 11:34 AM
Problem reloading MDI child form in main form. AFFAN Software Development 3 30-01-2009 09:05 PM


All times are GMT +5.5. The time now is 05:00 AM.