Jump to content

Calling variables from a file


rebeccap

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
Link to comment
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]

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.