Jump to content

Archived

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

rebeccap

Calling variables from a file

Recommended Posts

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

Share this post


Link to post
Share on other sites
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:

[code]$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'] . '">';[/code]

Share this post


Link to post
Share on other sites

×

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.