-2

I've recently started using the Brackets IDE to do web development. However, I've stumbled across an issue. While using the "Live Preview" feature within Brackets, the HTML code will be fine, however whenever I try to utilize any CSS or PHP scripts, it will not behave. For CSS the formatting and styling just doesn't show and for PHP it says cannot POST /practice.php. However if I don't use "Live Preview" and just open the .HTML file itself in the browser, the PHP script will execute perfectly fine.

I've also noticed when I go in and select "live preview" for the PHP file itself it will tell me: "To launch live preview with a server-side file, you need to specify a Base URL for this project." however, I'm confused as to what they want me to do when they say that.

I know that localhost is referring to my machine and I need to give a url for the project, however I'm not sure where I could find the base URL that it wants from me.

Holger Just
  • 52,918
  • 14
  • 115
  • 123
Matt Jones
  • 61
  • 1
  • 10

1 Answers1

1

i got your problem.. you have to set the BASE URL. BASE URL means the root folder where you stored the php files... so you have to set the base url. i will show you one example

http://localhost/School/Register/index.html this is the file path of our php file.

you can set http://localhost/School/Register/ as the BASE URL.Try it

Jok3r
  • 454
  • 3
  • 9
  • I'm aware that local host means the loopback IP of the machine itself (127.0.0.1) but in what context would I use it for the base URL? The path to my php\index.html file is: C:\Users\tornado711\Desktop\PHP so where would I put the "localhost" part in the file address? Thanks! – Matt Jones Jul 25 '17 at 13:46
  • do you have any local server in your machine .? – Jok3r Jul 26 '17 at 08:40
  • do you have any local server in your machine .if you have tell the name of your local server.. if you are using any local server you will be having one folder in your machine.. example: [link](C:\xampp\htdocs) this is my local server location.. i mean here is the place i will store my php files.. do you have any location like this ? – Jok3r Jul 26 '17 at 08:50
  • My php files are stored in: C:\Users\tornado711\Desktop\PHP so would I simply use that as the base URL? – Matt Jones Jul 26 '17 at 16:55
  • which server you are using ? localserver or what? tell the name of the server..? – Jok3r Jul 26 '17 at 17:45
  • I'm not using any server. I'm using my machine I have no server set up. This web development I'm working on is completely offline, it's not on any server, it's just a file stored on my hard drive. – Matt Jones Jul 27 '17 at 02:56
  • ok. Are you sure that you don't have any server? if you want to run php files you need a server.in most case we can't afford the real servers, so what we will do is we will set up a local server in our system. like XAMPP,WAMP. you need to download it and install it.without a local server you can't run your php files.so install it. i will give you the link..for XAMPP http://www.wikihow.com/Install-XAMPP-for-Windows just go through this.. – Jok3r Jul 27 '17 at 04:52
  • Okay but one question? I've been using PHP before. If I just run the straight HTML file and have the PHP script execute, I have no issue, it's only when I use LIVE PREVIEW in brackets that I have an issue, so are you sure that's the case? – Matt Jones Jul 27 '17 at 16:51
  • ok..try this.. this may help you..https://stackoverflow.com/questions/25108420/brackets-live-preview-not-working – Jok3r Jul 28 '17 at 04:54