.htaccess question

Discussion in 'PHP' started by lowridertj, Jul 21, 2007.

Thread Status:
Not open for further replies.
  1. #1
    How can I make a php/mysql INSERT

    to insert a new username and password for a htaccess file.

    I have a pay a site for instance that I want to force upon payment and ipn back that it inserts a username and a password for someone. How can I make this possible via htaccess

    Or would I have to just create the user database and have it check user database for login and have it insert that instead? then in the directory just have it echo to check login first before showing data?

    Please any help would be great.

    Thanks,
    TJ
     
    lowridertj, Jul 21, 2007 IP
  2. Bartuc

    Bartuc Active Member

    Messages:
    120
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    75
    #2
    check fopen(), fwrite() and fclose() functions for editing htaccess.
     
    Bartuc, Jul 21, 2007 IP
    lowridertj likes this.
  3. lowridertj

    lowridertj Well-Known Member

    Messages:
    2,882
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    195
    #3
    any examples?
     
    lowridertj, Jul 23, 2007 IP
  4. Gordaen

    Gordaen Peon

    Messages:
    277
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You could use system() to directly call htpasswd, but I think a PHP database is a better solution to what you need, because it would enable you to easily track users and various statistics (e.g., how often a given user is logging in).
     
    Gordaen, Jul 23, 2007 IP
    lowridertj likes this.
  5. lowridertj

    lowridertj Well-Known Member

    Messages:
    2,882
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    195
    #5
    thank you....
     
    lowridertj, Jul 23, 2007 IP
Thread Status:
Not open for further replies.