Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a new file?

Status
Not open for further replies.

ScoobyDood

Programmer
Jun 10, 2002
15
US
I need to know how to create a new file after the user submits information into a form. I know how to make it write the file, but how do I actually save it as a new web page and add it to my directory? Computers - Can't live with 'em, can't live without 'em! Check this out:

 
open (NEW, "PATH\\TO\\MY\\FOLDER\\new.html") || die "$!";
# write , close etc
# u just need to create it in your "web root" ---------------------------------------
wmail.jpg


someone knowledge ends where
someone else knowledge starts
 
oups should have the > operator
open (NEW, ">PATH\\TO\........... ---------------------------------------
wmail.jpg


someone knowledge ends where
someone else knowledge starts
 
no it dont !
as long that those folders are in the "web root" ---------------------------------------
wmail.jpg


someone knowledge ends where
someone else knowledge starts
 
A good way to do this is to use the Apache Environtment variable:
$ENV{DOCUMENT_ROOT}
Like this:

open(FILE, ">$ENV{DOCUMENT_ROOT}/some_bin/file_name.txt");

--jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top