Jump to content

Send information from one file to another


reckdan

Recommended Posts

I have two files search.php and update.php, i have a combo box which is populated with a list of organizations and a search button on search.php and a detail form on update.php.

Now I want to code the search button such that when i select an organization and click on the search buttom, details of the selected organization will pupolate the form on update.php.

Basically i want to send the information on the search.php to the update.php so that i can use it to retrieve detail information on the update.php

 

Help need urgently

Well if you have a bunch of variables you would like to transfer from one script/page to another you could use sessions...

 

 

search.php

<?php
//Start a session
session_start();

$name = "Some Name";
$email = "[email protected]";

//Store the variables as session variables
$_SESSION['name'] = $name;
$_SESSION['email'] = $email;
?>

 

 

update.php

<?php
//Start a session
session_start();


echo $_SESSION['name']; //Will print "Some Name"
echo $_SESSION['email']; //Will print "[email protected]"

?>

 

That's a simple transfer of variables from one page to another... if that's not what you meant please specify your problem :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.