Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Apr 2005
    Posts
    388
    Thanks
    0
    Thanked 0 Times in 0 Posts

    more strange phpdev results

    howdy,
    when using phpdev423, I create a page that has php in it, I name it with an .html extension the script doesnt run, I name it with a .php extension it does run. Is there a setting somewherer in php.ini that I need to set?

    also, when using $REQUEST_URI I get back the following string
    /paginfo.html
    is there a way to strip the '/' from the front of it?

    thanks. Hope all you dads had a great Fathers Day, I did.

    nevermind about the send question trim does the job just like it is supposed to.
    thanks.
    Last edited by davehaz; 06-19-2005 at 11:59 PM.

  • #2
    Senior Coder
    Join Date
    Aug 2003
    Location
    One step ahead of you.
    Posts
    2,815
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Apache must know which files are supposet do be parse by php. Yolu have to edit apache's .conf file.
    I'm not sure if this was any help, but I hope it didn't make you stupider.

    Experience is something you get just after you really need it.
    PHP Installation Guide Feedback welcome.

  • #3
    Regular Coder
    Join Date
    Apr 2005
    Posts
    388
    Thanks
    0
    Thanked 0 Times in 0 Posts
    any idea what the line would say to notify apache to parse php?

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    your apache config file:
    Code:
    AddType application/x-httpd-php .php .html
    I don't really recommend using .html as a php parsed extension, mearly for compatibility. If you want to select a similar ending, I'd recommend phtml or pml. Lol, pml.
    If you do not have access to your apache config file you may also create this within a .htaccess file.
    I believe it would be done like so:
    Code:
    <ifModule mod_mime.c>
      AddType application/x-http-php .php .html
    </ifModule>
    Edit:
    I recommend you access $REQUEST_URI via the $_SERVER superglobal as well, $_SERVER['REQUEST_URI']. To strip out the character you can look at using the basename function as well.
    Last edited by Fou-Lu; 06-20-2005 at 01:10 AM.


  •  

    Posting Permissions

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