(see "Having some configuration problems..." a few threads down if you need more info)

I installed XAMPP, so everything should be configured properly. However, I'm still having problems. So, here are some of the questions I have. If anyone could help me out on any of them, that would be great.

  1. What is a web server? :bemused: How is it helping me write PHP?

  2. When I open my PHP files in my browser, they are still not read properly. Any known reason why?

  3. How do you link to an external PHP script in an HTML file? Is there a such thing, or am I totally clueless?

I'm completely lost. Help, please? :queasy:

    1. A web server is a piece of software that serves up web pages, for an easy introduction to them read here.
      On it's own the server won't "help" you write PHP pages all it does is parse the script and turn it into HTML that browsers can read.

    2. It depends how you open the PHP pages in your browser, If you just select the file and open it with your browser it will simply display the contents of the page. If however you open the PHP script through your local server ( Usually 127.0.0.1 also referred to as localhost) then the PHP script will be parsed and the code run.

    3. Providing you save your files with the .php extension and open them through your server then you can write HTML and PHP commands in the same file and they should display properly.

      1 It's the thing that your browser communicates with.
      2. Your web server has not been configured to pass the php source to the php interpreter.
      3.<a href="php_file.php">php_file</a>

        Okay, the web server makes a lot more sense now, thanks. So, the next question is, how do I open my PHP through the local server?

          seuzy13 wrote:

          Okay, the web server makes a lot more sense now, thanks. So, the next question is, how do I open my PHP through the local server?

          1. Make sure the file is in the "htdocs" directory under the XAMPP directory or a subdirectory beneath it, and that the file name has a .php suffix.

          1. In the address bar, enter the page address as: http://localhost/pagename.php (or http://localhost/subdirectory/pagename.php if it's in a subdirectory of htdocs).

            Ah hah! It works perfectly now. Thanks, everybody. I'll read that article on web servers and get started on some coding. 😉

              Write a Reply...