/    Sign up×
Community /Pin to ProfileBookmark

opening file content in new window

Hey guys,
I’m stuck on a problem that involves mostly php and some javascript, I believe. I’m having my site output filenames and folders for a given directory. I have a “create new file” link at the top which opens up a popup to create and save a new file in the directory. Next to the listed filenames, I have an “edit” link. Right now that pops open the same “create new file” link. I want it to copy in the contents of the filename next to the edit link. Does that all make sense? Any help would be appreciated.
Thanks
Mike

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@dmikester1authorDec 12.2007 — Anyone have any ideas or need any clarification?

Basically I need to load the contents of a given file into the editable content area of a new window that pops up. Does anyone know how I can do that?

Thanks

Mike
Copy linkTweet thisAlerts:
@hastxDec 13.2007 — [code=php]
$file=file_get_contents("MyFile.txt");
...
...

[/code]


[CODE]
<textarea name="edit" value="" rows=15 cols=75><?php echo "$file"; ?></textarea>
[/CODE]
Copy linkTweet thisAlerts:
@SyCoDec 14.2007 — You can bring it into one line if that suits your fancy
[code=php]
<textarea name="edit" value="" rows=15 cols=75><?php echo file_get_contents("test.txt") ?></textarea>[/code]
×

Success!

Help @dmikester1 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...