Results 1 to 2 of 2
Thread: (Fopen a Variable) Issue
-
01-24-2012, 08:14 PM #1
Sophomore
- Join Date
- Jan 2012
- Posts
- 125
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Feedback Score
- 0
(Fopen a Variable) Issue
Copy/pasted from my post at php-forum.com My issue is this: I have a simple text input box that feeds to this page. The Variable is $username. Everything is going great until I try to make a text file named after the entered username (future plans will write password to it). Below is the isolated "problem" code. Thanks for the help!
PHP Code:$ourFileName = $username".txt"; //issue here
$ourFileHandle = fopen($ourFileName, 'w') or die("Cannot Create Account. Please Try Again.");
fclose($ourFileHandle);
]
-
01-27-2012, 11:02 AM #2
Freshman
- Join Date
- Apr 2010
- Posts
- 38
- Thanks
- 0
- Thanked 1 Time in 1 Post
- Feedback Score
- 0
At first line of your PHP code put a dot(.) after variable $username.
PHP Code:$ourFileName = $username.".txt"; //Put a dot to join string.
$ourFileHandle = fopen($ourFileName, 'w') or die("Cannot Create Account. Please Try Again.");
fclose($ourFileHandle);
]
Similar Threads
-
Variable reference to a column in MS SQL
By DCSS in forum DatabasesReplies: 6Last Post: 12-29-2010, 08:49 PM -
Variable Column Name - MS SQL
By manik in forum DatabasesReplies: 3Last Post: 12-13-2010, 01:05 PM -
Passing value through URL then creating a variable for pagination
By Abina in forum ColdFusionReplies: 1Last Post: 02-02-2010, 11:34 AM -
JavasScript variable to Coldfusion
By Abina in forum ColdFusionReplies: 1Last Post: 02-02-2010, 11:11 AM -
Variable Top Select Microsoft SQL
By manik in forum DatabasesReplies: 3Last Post: 12-24-2008, 10:06 AM


Reply With Quote

