SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast Gamblingharry's Avatar
    Join Date
    Apr 2003
    Location
    UK
    Posts
    83
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Opening files with no extension in Dreamweaver

    Hi,

    Im trying to open a PHP file with no extension in Dreamweaver, but its not having it - says it cant find a valid editor for it. (This is so I can use URLs like www.mysite.com/reviews/45, where reviews is a PHP file). Anyone know how I can get it to open them?

    Thanks,

    Chris.

  2. #2
    3MTA3
    Join Date
    Jul 2003
    Location
    Florida
    Posts
    1,016
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If "reviews" is a php file, then what is "45"? This is new to me so I had to ask...

    I suppose you could add an extenstion to it and then take it off after you upload it... Just a thought.

  3. #3
    SitePoint Enthusiast Gamblingharry's Avatar
    Join Date
    Apr 2003
    Location
    UK
    Posts
    83
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    45 is the number of the review to be displayed from the database. The URL would normally be "/reviews.php?review_id=45" so that the variable 45 is passed to the page, and it can then load that review to display. I followed this article on SitePoint

    http://www.sitepoint.com/article/485

    Notice how they use the same technique.

    I could edit it with a .php extension, then change it, but that is a workaround where I dont think one should be needed. I should be able to tell DW to open a no extension file!

  4. #4
    SitePoint Enthusiast Gamblingharry's Avatar
    Join Date
    Apr 2003
    Location
    UK
    Posts
    83
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Now I know this has been bugging you all, so i thought i should share my solution:

    In my php file called "reviews" I just put the line :
    Code:
    <?php include("reviews_include.php"); ?>
    then put all the code that used to go in the page, in the file called reviews_include.php, which i can edit just fine in DW!! Im very pleased with myself! Think outside the box!

  5. #5
    Yugo full of anvils bronze trophy hillsy's Avatar
    Join Date
    May 2001
    Location
    :noitacoL
    Posts
    1,859
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Pleased you found a solution. FYI Dreamweaver will not open a file unless it has a file extension. A notable and very annoying limitation of what is otherwise a good tool...
    that's me!
    Now A Pom. And a Plone Nut
    Broccoli Martinez Airpark

  6. #6
    SitePoint Evangelist N9ne's Avatar
    Join Date
    Aug 2002
    Location
    UK
    Posts
    596
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Gamblingharry
    45 is the number of the review to be displayed from the database. The URL would normally be "/reviews.php?review_id=45" so that the variable 45 is passed to the page, and it can then load that review to display. I followed this article on SitePoint

    http://www.sitepoint.com/article/485

    Notice how they use the same technique.

    I could edit it with a .php extension, then change it, but that is a workaround where I dont think one should be needed. I should be able to tell DW to open a no extension file!
    Thanks for the link to that article. It was an interesting read, I've always wondered how article/xx/yy was done, and I never thought of using REQUEST_URI and exploding it into an array using / as a separator! Very simple yet extremely effective.


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
  •