Php and html issues

Discussion in 'PHP' started by Jaden Alvin, Oct 14, 2013.

  1. #1
    Hello everyone

    I'm having a strange issue with my site, when i open site on filezilla it shows .php file but when i save online webpage to my computer (save as) it turns to .html format how is this happening. same page with two format.

    please need help.
     
    Solved! View solution.
    Jaden Alvin, Oct 14, 2013 IP
  2. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #2
    DUH! its normal that you don't get the PHP code otherwise everybody could read the sources of your sites. With browsers you see processed output of the PHP scripts... if you want more information about php read http://www.php.net
     
    EricBruggema, Oct 14, 2013 IP
  3. eritrea1

    eritrea1 Active Member

    Messages:
    182
    Likes Received:
    9
    Best Answers:
    2
    Trophy Points:
    70
    #3
    This is pretty strange question. What does "when i open site on filezilla" even mean? FileZilla is a file transfer software, you can not open a 'site' with it. Second thing, if you are trying to save a file as .php then you must type it, as it when saving the file, otherwise, if you have saved a page with html before, it will default to html.
     
    eritrea1, Oct 15, 2013 IP
  4. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #4
    Uhm. You "open the site" in FileZilla - ie. you open the FTP-connection to upload or download files - and of course you'll see the content / filenames as they were put on the server. When you chose "save as" in a browser, you'll save the page as-is - ie. the output that is shown in the browser-window - normally this will be a .html-file - it can be something else, it could be an image, a text-file, or something completely different - but it will NOT be a PHP-file - it will be the output from the PHP file. This should be fairly obvious.
     
    PoPSiCLe, Oct 15, 2013 IP
  5. #5
    you're saving the file the wrong way.
    Where is the .php file that you're opening with FileZilla THAT is the actual .php file
    When you use your brower and goto File - SaveAs You're saving the website in entirety with images etc to a folder on your computer. You're NOT saving the .php file youre instead saving the HTML file that's created AFTER the php has loaded the content.

    so for example if your .php had a var like = echo $widget;

    when you File - SaveAs you're not going to get that in the source code, instead its a rendered HTML file and the source code will show = "cool widget"
    Not the PHP code. Its a rendered file you're saving.

    The Solution: Find the .php file that you open with FileZilla and copy/drag /drop that file to where you want it ..as that is the real .php file.
    the .html file you have is something you saved with a browser and that's not the correct way to save your own files. You must save the source code of .php
     
    ezprint2008, Oct 30, 2013 IP