Webnerdz Posted May 10, 2006 Share Posted May 10, 2006 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 Link to comment Share on other sites More sharing options...
jfee1212 Posted May 10, 2006 Share Posted May 10, 2006 [!--quoteo(post=372987:date=May 10 2006, 01:31 PM:name=Webnerdz)--][div class=\'quotetop\']QUOTE(Webnerdz @ May 10 2006, 01:31 PM) [snapback]372987[/snapback][/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"[code]$file .= ".ext"[/code]this adds .ext onto the end if $file. Quote Link to comment Share on other sites More sharing options...
Webnerdz Posted May 10, 2006 Author Share Posted May 10, 2006 Thank you for the fast and informative reply! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.