Newbie first post and a Dreamweaver question

Discussion in 'HTML & Website Design' started by @nibb, Oct 30, 2010.

  1. #1
    Hi, hello to everyone. I know DigitalPoint from at least some years, I always landed here when looking for some certain things via Google, like software review, vbulletin, webdesign, etc.

    Finally I decided to register because I find there is a great programmer/webdesigner potential here. This is my first post.

    Im a more or less medium web designer and newbie programmer. I mainly use or always have used Dreamweaver but I never really used it on its full potential. Like for example I still edit code in dreamweaver but I dont use their FTP but ratter use CuteFTP instead.

    More and more I found im using less tools from Dreamweaver. I come from the font tag era and I did not updated some websites for long time so CSS just took me back allot as I still cannot properly dominate CSS. I use it now allot in a external file but I still confuses me sometimes specially when using tables.

    The question that brings me here is that I seem to have a big problem with dreamweaver now.

    One of my sites is composed of a dynamic PHP header and footer, which I include via a PHP command on each page. This was not a problem except that some weeks ago to optimize the website better I moved the CSS code to where its suppose to be in the first place, to the head section. That means my CSS code that displays the visual aids on a webpage is now loaded from head.php

    This is a big problem now, because when I open a webpage on Dreamweaver the page displays without any CSS formatting, as it cannot retrieve head.php which is of course on the server. The worst part is I cannot select any text and apply a CSS style to it because there is no style as DW cannot load the head. If I switch to live view and code the website shows fine, but then I cannot use any tools to apply CSS formatting.

    So how in the world do you guys use DW and see the page like it would on the server?
     
    @nibb, Oct 30, 2010 IP
  2. wgn_white

    wgn_white Active Member

    Messages:
    130
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    73
    #2
    I'm doing this my way for dynamic website which in my case, creating WordPress theme.

    Install Xampp on your computer.

    Put your website files in the htdocs.

    Run apache, if your website using mySQL, then you should setup it first.

    After the apache turns on, go to your browser http://localhost/website/index.php

    localhost is where the htdocs, so if you put your website inside a folder, add the folder name behind the localhost.

    Open dreamweaver and open the file inside the htdocs which happen to be your website! :D

    edit the code... to see the how it does in real life online, refresh the browser.

    If you use any javascript or jquery.

    Copy the website source code in the browser and then make new file in dreamwever, don't need to save this file.

    See it in live view and you see the website live...

    Trigger the javascript, for example the dropdown, or fireworrks or whatever.

    Then press f6 to freeze it.

    In live code view you can see the new html added to your existing code.

    So go back to your original file and edit them accordingly.

    Is that answering your question?
     
    wgn_white, Oct 30, 2010 IP
  3. @nibb

    @nibb Greenhorn

    Messages:
    74
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #3
    Hi, first thanks for your reply.

    That idea came to mind as well. But I thought that installing a local server would be to overkill, specially because I did enter a remote testing server in DW. If that is the only solution I would do it but the problem with this is you have to basically move all your data around and put it on different paths. And I have all my website data under a special partition and directory for safe backups.

    I did found out that DW says it cannot find head.php because the php include code is of course the remote server like:
    /home/path/public_html/head.php

    So on my local computer its on the same path but like D:/websitefolder/public_/html/head.php

    So on the html code I erased the code and left it like /public_head/head.php and then DW displays my head correctly and with it the included CSS, which lets me edit the website visually. After I edit i I have again to correct the path before uploading it to the server.

    So my question is ratter, if I could fool DW so it doesnt read /home/path/ and find the file in the local computer because after that part its the same and it does find it when manually edited.
     
    @nibb, Nov 1, 2010 IP
  4. wgn_white

    wgn_white Active Member

    Messages:
    130
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    73
    #4
    If you use xampp, you doesn't need to edit or re-edit the include code.
    Because the path will be the same as is your online server.

    Or if you want, your can just specify the exact url in the include code, then you don't have to edit or re-edit the code even you change your path as long as the url remain the same.

    After done edit, just FTP all your website to your webhosting.

    Done.

    Just like that.
     
    wgn_white, Nov 1, 2010 IP
  5. @nibb

    @nibb Greenhorn

    Messages:
    74
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #5
    Well I would need to put the files like /home/path/ etc on the computer and as far as I know you cannot use the full url in PHP included, it has to be the full path in the code so I would not be able to change it working locally and on the server, unless I replicate the server path on the local machine which is a little messy just for editing 2 files head and footers. Im not sure what you say the path will be the same. I dont think so unless I move all files around. I know Xampp and its great, what are the benefits of having a local test server instead of just using the remote one anyway?
     
    @nibb, Nov 1, 2010 IP
  6. wgn_white

    wgn_white Active Member

    Messages:
    130
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    73
    #6
    Yes, we can use full url in for include in php.
    Unless your server(webhosting) settings don't allow you to do so because this way any other ppl can directly hotlink your php files.

    Benefits of having local test server?
    So if you mess up offline, your online website still sit there nicely. ;)

    BTW, why not using WordPress?
     
    wgn_white, Nov 1, 2010 IP
  7. @nibb

    @nibb Greenhorn

    Messages:
    74
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #7
    I run my own server and I never tried to use full urls in PHP includes, I think thats a huge security risk. I do use WordPress as well but I would had the same problem if the CSS code is included on a remote PHP file.

    I just tried and full url in PHP actually dont work. You need to use the path.
     
    @nibb, Nov 1, 2010 IP
  8. wgn_white

    wgn_white Active Member

    Messages:
    130
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    73
    #8
    You are correct.
    Just like I said, other ppl can direct link your php files and exploit your server.

    That's why you need to start a good practice of making your own "offline clone" and work with it offline and leave the online website as is before you finalize your edit.

    This show your professionality as well.

    For example, isn't it very lame if DP is edited live by the admin?
    And sometimes you see the style okay, and sometimes no?

    Maybe now you don't feel it nessecary, but when you have huge traffic website then you know the importance of good practice working offline mode.
     
    wgn_white, Nov 1, 2010 IP
  9. @nibb

    @nibb Greenhorn

    Messages:
    74
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #9
    I think a symbolic link in Windows would work so I trick dreamweaver into opening files from /home/path on another folder.

    I will try to simulate an offline testing but what about databases? My site contains databases like in the case of wordpress as well, it would be amazing hard to see my local site just like the online is.
     
    @nibb, Nov 1, 2010 IP
  10. wgn_white

    wgn_white Active Member

    Messages:
    130
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    73
    #10
    I thought you are familiar with Xampp?

    Xampp have mySQL database function as well.

    You can go to your online website cPanel and export the database from phpMyAdmin and then import into your offline server using the mySQL admin.

    As simple as that. ;)

    As I said, Xampp is a virtual server.

    Actually, if you know your ip address, you can let other ppl browse the website from your computer as if the computer is a real server.
     
    wgn_white, Nov 1, 2010 IP