Results 1 to 2 of 2
  1. #1
    drewtoby is offline Sophomore
    Join Date
    Jan 2012
    Posts
    125
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Feedback Score
    0

    Default (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);


  2. #2
    susen is offline Freshman
    Join Date
    Apr 2010
    Posts
    38
    Thanks
    0
    Thanked 1 Time in 1 Post
    Feedback Score
    0

    Default

    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

  1. Variable reference to a column in MS SQL
    By DCSS in forum Databases
    Replies: 6
    Last Post: 12-29-2010, 08:49 PM
  2. Variable Column Name - MS SQL
    By manik in forum Databases
    Replies: 3
    Last Post: 12-13-2010, 01:05 PM
  3. Replies: 1
    Last Post: 02-02-2010, 11:34 AM
  4. JavasScript variable to Coldfusion
    By Abina in forum ColdFusion
    Replies: 1
    Last Post: 02-02-2010, 11:11 AM
  5. Variable Top Select Microsoft SQL
    By manik in forum Databases
    Replies: 3
    Last Post: 12-24-2008, 10:06 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Partners: BOSTON WEB DEVELOPER, LLC   |   WEBCOSMO CLASSIFIEDS