Jump to content


Photo

Calling variables from a file


  • Please log in to reply
1 reply to this topic

#1 rebeccap

rebeccap
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 17 April 2006 - 05:58 PM

I downloaded a form that uses php to process a file on a server with a 5 digit code (ie 12345.php is the new file name). I'm wondering if I can use the variables stored from the form to the file and reopen the form for editing the new file. I guess I can use another form to tell it what 5 digit code to use, but can you pass a variable from file to file with php without a database (both hosted databases are used.)

Thanks,
Rebecca
--
Fiction at your fingertips!
[a href="http://www.chippewapublishing.com" target="_blank"]http://www.chippewapublishing.com[/a]

#2 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 17 April 2006 - 11:29 PM

I am not sure if I got what you want... But let's say you have a "database file", and the values are stored as a serialized array...
So you can use something like this:

$data = unserialize(file_get_contents('file_name_here.php');

echo '<input type="text" name="name"  value="' . $data['name'] . '">';
echo '<input type="text" name="email"  value="' . $data['email'] . '">';


~ D Kuang




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users