Jump to content


Photo

Fwrite file extension


  • Please log in to reply
2 replies to this topic

#1 Webnerdz

Webnerdz
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 10 May 2006 - 05:31 PM

I tired to find this somewhere, but I had no luck.

I am trying to find the php code to write a file then a predefined extension. As in, the user enters a file name and the script creates the file and the predefined extenstion.

Right now I can create the file and contents, but the user enters the entire filename 'filename.ext'. I want them to enter 'filename' and the script create the '.php' part.

Hope that makes sense. Thanks in advance for your help.



#2 jfee1212

jfee1212
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 10 May 2006 - 06:47 PM

[!--quoteo(post=372987:date=May 10 2006, 01:31 PM:name=Webnerdz)--][div class=\'quotetop\']QUOTE(Webnerdz @ May 10 2006, 01:31 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
I tired to find this somewhere, but I had no luck.

I am trying to find the php code to write a file then a predefined extension. As in, the user enters a file name and the script creates the file and the predefined extenstion.

Right now I can create the file and contents, but the user enters the entire filename 'filename.ext'. I want them to enter 'filename' and the script create the '.php' part.

Hope that makes sense. Thanks in advance for your help.
[/quote]

Let's say the name of the variable containing the filename is "file"

$file .= ".ext"

this adds .ext onto the end if $file.


#3 Webnerdz

Webnerdz
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 10 May 2006 - 07:51 PM

Thank you for the fast and informative reply!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users