SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Feb 2001
    Posts
    302
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    After reading kyanks php/mysql tutorial from webmasterbase I set up my index page and a couple of others as semi dynamic pages like he suggested in the advanced php section of his tutorial.

    Anyway everything was working fine until I put an
    .htaccess file in that folder, it is just a fairly standard .htaccess that password protects the file, but the trouble is that now when I try to generate a new index page instead of using the path http://localhost/admin/index.php when looking at the template (index.php) which it needs to do for the php on the template to run, it goes to c:/phpdev/www/admin/index.php so as the browser is not used the php is not run and I get a load of code on index.html, I don't think I've explained this that well so I hope the code and comments below help.

    This is part of the code used basically is uses $srcurl as a source file then puts into a variable and through fwrite etc it puts it all in a temporay file then finally writes it to index.html.

    <!-- generateindex.php -->
    <?php
    $srcurl = "http://localhost/admin/index.php";
    $tempfilename = "tempindex.html";
    $targetfilename = "index.html";
    ?>

    The problem is that with the .htaccess forcing it to use the path on the harddrive rather than the url none of the PHP from the tempate index.php gets converted.

    If anyone knows a way to get around this or wether I will just have to leave my admin files unprotected, I'd appreciate the help.

    -Neil

  2. #2
    SitePoint Zealot moshe_be's Avatar
    Join Date
    Dec 2000
    Posts
    169
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    RE: Problems with creating a semi-dynamic page and an .htaccess file?

    I think that this will work

    http://user:pass@localhost/admin/index.php

    Put a working username and password and replace the localhost with the domain name.

  3. #3
    SitePoint Addict
    Join Date
    Feb 2001
    Posts
    302
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks very much Moshe that seems to have solved the problem.

    - Neil


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •