Results 1 to 8 of 8

Thread: Preview a page with PHP code (Secure Site - PHP data connector)

  1. #1
    Junior Member
    Join Date
    Jun 2013
    Posts
    25

    Default Preview a page with PHP code (Secure Site - PHP data connector)

    I am running Windows 7 IIS 7 as my test environment. When I publish to the site everything works GREAT. But as I design a page if I put a connector on the page and try to preview I get the dialog box I have enclosed.
    If I open or try open I get the Windows Internet Explore save pop-up and nothing displays.
    I a relatively new to NOF and learning fast. It would be great and same me a lot of time if I could get the preview to work. The manual indicates that I should get placeholders for the connector.
    Have I configured something wrong.?
    Click image for larger version. 

Name:	error1.png 
Views:	522 
Size:	32.7 KB 
ID:	1536

  2. #2
    Senior Member RayC's Avatar
    Join Date
    Apr 2010
    Location
    Toronto-ish, Canada
    Posts
    1,732

    Default

    PHP is a server-side scripting language which means you have to publish to a web server for the code to be properly executed. Your web browser can only interpret HTML and execute some client-side scripts.

    When a web server serves up a PHP page, it basically executes the code and outputs HTML which is sent to the browser.

    The only way to "preview" locally is to install server software on your computer along with the various components like PHP, SQL, etc. You would publish your page to your local "server" the same way you would publish to a remote server, then direct your browser there. WAMP is fairly popular, but I like MOWES, which you can set up to run off a USB stick if you like.

    Often just as easy to create a /test/ directory on your web server and publish there to test things out.
    Ray Cambpell
    Sounds In Sync
    Linked in

  3. #3
    Senior Member franko's Avatar
    Join Date
    Apr 2010
    Location
    Tasmania Australia
    Posts
    2,642

    Default

    Ray, he said he had IIS installed as his test environment. IIS is a web server (although a not very good one). adellis - have you installed PHP onto your server? Have you set the appropriate IIS permissions to run the script (I'm a Unix man so can't help you at all with IIS but somebody here may be running IIS)?

  4. #4
    Junior Member
    Join Date
    Jun 2013
    Posts
    25

    Default

    I am running PHP on the server and the test server is working Great. My question is if you preview a page from the tabs below in the design view. Is NOF supposed to render the page with placeholders for the PHP objects?

  5. #5
    Senior Member franko's Avatar
    Join Date
    Apr 2010
    Location
    Tasmania Australia
    Posts
    2,642

    Default

    I haven't tried but I would doubt it very much. The tabs at the bottom of design view are just for quick layout checks as is the Preview button in the menu bar. To check your page you really need to do a local publish (doesn't take long if you haven't got a multi-thousand page site). For me, this is SOP; I virtually never use Preview in NoF, always a local publish.

  6. #6
    Senior Member RayC's Avatar
    Join Date
    Apr 2010
    Location
    Toronto-ish, Canada
    Posts
    1,732

    Default

    Wow, I sure took the wrong exit on this one.

    Well, I use Preview all the time. Although I understand the risks of doing so, when I'm doing little tweaks I want to check it fast. And if I'm into PHP pages, it's a pain to either publish online or to my local server just to see how things line up.

    In answer to your follow-up, if you're using NOF components, typically it should simply Preview with some sort of placeholder for where you dropped the component. Obviously the component will not actually do anything at this point. However, a Local Publish will get you the Open/Save popup since your browser doesn't know what to do with .PHP files.
    Ray Cambpell
    Sounds In Sync
    Linked in

  7. #7
    Junior Member
    Join Date
    Jul 2013
    Posts
    1

    Default

    Hi all,

    When I include PHP code on my pages (in a text box using the HTML button), and then preview the page either by clicking the preview site or by clicking page preview, all of the PHP code shows up mixed with the other page elements. Also, any parts of the php code that are html show their results. This generally just gives a big mess and thus the Preview modes are not usuable and one has to publish to the website to see what things will look like. Keep in mind that I don't have PHP on my work computer, but only the server of the website.

    Is there any work around for this problem.
    Softsyshosting.com affordable web hosting.

  8. #8
    Senior Member LBA's Avatar
    Join Date
    Jan 2010
    Location
    California
    Posts
    543

    Default

    You just answered your own question. Since you don't have PHP installed on your computer, your computer doesn't have the ability to process PHP code and so you just see the raw unprocessed code. You need to either install PHP on your computer or upload your page to a server that already has it... your web host.

Tags for this Thread

Posting Permissions

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