hi, Thnx to all of you... Actually I realized that my problem is slightly more different and complicated..
The xml output is actually received from a servlet (sorry for saying php before!:)) and Needs to be directly passed into another PHP which contains an XMLparser... The data has to be dynamically fed into the parser... I am trying to make the parser into a form of a class with a function that receives this variable but so far Unsuccessful.. If anyone has any further suggestions/ideas, wud be damn gratefull!! I can post the parser here if needed... TIA, sands -----Original Message----- From: Pac mon [mailto:[EMAIL PROTECTED]] Sent: segunda-feira, 14 de Janeiro de 2002 14:48 To: [EMAIL PROTECTED] Subject: Re: [PHP-WIN] Re: passing variables There is NO need for that... When including a file it's as if the file were inline with the code in the spot in which include() is called. You may want to use require() to make sure that the file is actually being added. Also you just need to use $data wherever you want.. Or you can do it like this: $sign = $data; > >when you call the 2nd script, new.php, call it like this: > >new.php?sign=$data > >that is one way to pass it ... or you can keep the variable hidden by using >sessions > >1. xmlparse.php >------------------------------- >session_start(); // start a session >session_register("data"); // register 'data' as a session var >$data = "whatever"; // assign a value >--------------------------------- > >2. now going on to the next script: new.php >--------------------------------- >session_start(); // start a session > >$sign = $data; // $data should already have the value previously assigned; >since it's in session, the value carries over > >echo $sign; // should display "whatever" >------------------------------------------- > >try that. >also, you can try doing this in your original example: > ><snip> > new.php > > include('xmlparse.php') > > global $data; // add this line; do a "global" to make sure you >grab the $data var > > $sign = "$data"; > > echo "$sign"; ></snip> > >Goodluck! >Nicole Amashta >www.aeontrek.com >======================== >"Sandeep Murphy" <[EMAIL PROTECTED]> wrote in message >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > > > hi all, > > > > I have a variable in a file called xmlparse.php called $data. $data >stores > > in it an output returned by another php script.. > > > > I need to pass this variable $data now into yet another php file say >new.php > > .. > > > > xmlparse.php > > > > $data = "blah blah"; > > > > >-------------------------------------------------------------------------- >-- > > ---- > > new.php > > > > include('xmlparse.php') > > > > $sign = "$data"; > > > > echo "$sign"; > > > > But my echo "$sign"; is NOT printing anything.. Whats wrong here?? > > > > TIA, > > > >-- >PHP Windows Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] > _________________________________________________________________ Join the world's largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]