Hey, I'd like to learn PHP but for some reason, when I edit the code, and then save it as .PHP, when I click the icon for it, it comes out in a web browser and I download it. How would I preview my own code? Sorry for typing fast, hope you understand.
PHP is a preprocessed server side language, you can't just open it up like HTML. For it to function you need to have your PHP scripts on a web server with PHP enabled. I myself develop on a packaged setup mostly. One setup--the one I use--that will have all the servers/settings you need to get started is VertrigoServ (vertrigo.sourceforge.net), it's free so go download it and have a good time. Once you start the server, you can use the icon in the task manager to goto the website, or the folder where you docs are stored. Hope this helps. Eli
Yet another great package is WAMP (Win, Apache, MySQL, PHP) - When you install it, you choose where to put the www/ folder; - So if you save your file like this c:/.../www/myFirstSite/test.php the url to test it will be http://localhost/myFirstSite/test.php
Okay here is a quick run down Click on the easyphp icon to start the servers. It should come up with a little box with traffic lights on when the server are started they will turn green. You can then minimize this and it will go to your system tray. Now if you go into the folder for easyphp in your programme files. Find a folder called www. This is your document root. The document root is where all files you want to be processed by php should be stored. Create a shortcut this folder on your desktop as you need access to it all the time. Now as a start just to check all your servers are working Open a word document Input this <?php echo "If this is written in the browser then we have lift off."; ?> PHP: Save this file as test.php to that folder called www. Now open your web browser and type the following into the address bar http://localhost/test.php When you hit enter the above message should appear. Lemme know if you need any more help
Thanks man, I got it working. Repped! EDIT: Notice: Uninitialized string offset: 0 in C:\Program Files\EasyPHP 2.0b1\www\PHProxy.class.php on line 1020 Notice: Uninitialized string offset: 0 in C:\Program Files\EasyPHP 2.0b1\www\PHProxy.class.php on line 1023 Notice: Uninitialized string offset: 0 in C:\Program Files\EasyPHP 2.0b1\www\PHProxy.class.php on line 1026 Notice: Uninitialized string offset: 0 in C:\Program Files\EasyPHP 2.0b1\www\PHProxy.class.php on line 1029 Warning: PHProxy::include_once(url_form.inc) [function.PHProxy-include-once]: failed to open stream: No such file or directory in C:\Program Files\EasyPHP 2.0b1\www\PHProxy.class.php on line 435 Warning: PHProxy::include_once() [function.include]: Failed opening 'url_form.inc' for inclusion (include_path='.;C:/Program Files/EasyPHP 2.0b1\php5\pear\') in C:\Program Files\EasyPHP 2.0b1\www\PHProxy.class.php on line 435 Code (markup): Whats that all about? btw, its a PHP code and when I put it in, thats what comes up above the the webpage
I take it its a cut and paste of a code. I wouldn't really know withous seeing the code what the problem was. Thanks