jkkenzie Posted February 4, 2008 Share Posted February 4, 2008 I have a project downloaded from the internet(a shopping cart) .i have a file index.php, that when i load it gives a dialogue to save or open file. Its source shows only php scripts. I was expecting it to contain some html scripts. I need to load the home page but it seems the index.php home page has only php scripts. Regards, JKM Quote Link to comment Share on other sites More sharing options...
revraz Posted February 4, 2008 Share Posted February 4, 2008 You need to have php installed in order to parse it. You won't find any .html only shopping carts. Quote Link to comment Share on other sites More sharing options...
jkkenzie Posted February 4, 2008 Author Share Posted February 4, 2008 Alright thanks very for your prompt answer. Is Index.php normaly the start page? Does a page which has only PHP able to display in another computer without php? just like am bale to open a website created in php on my computer without php? Regards, JKM Quote Link to comment Share on other sites More sharing options...
bpops Posted February 4, 2008 Share Posted February 4, 2008 Typically by default, index.html/index.htm/index.shtml/index.php are all the start page. And PHP is run on the server (called 'server-side'), and the results are sent to the client. So you do not need PHP installed on your own computer so long as you are not running the server yourself. An example of a 'client-side' language would be javascript. Quote Link to comment Share on other sites More sharing options...
jkkenzie Posted February 4, 2008 Author Share Posted February 4, 2008 Ok, if i open a index.php file on my WAMP server using a web browser, it will run as expected? Quote Link to comment Share on other sites More sharing options...
bpops Posted February 4, 2008 Share Posted February 4, 2008 I'm not familiar with the term WAMP, but if you load http://www.domain.com/index.php (or whatever the address happens to be), it will run as expected, yes. The source code of the php file is hidden to the client. Quote Link to comment Share on other sites More sharing options...
revraz Posted February 4, 2008 Share Posted February 4, 2008 If the file resides on the WAMP server then yes, it should work fine. Ok, if i open a index.php file on my WAMP server using a web browser, it will run as expected? Quote Link to comment Share on other sites More sharing options...
jkkenzie Posted February 4, 2008 Author Share Posted February 4, 2008 thanks for the answers so far and we are heading somewhere.. when i open a page that starts and ends with <html><body><?php...?></body></html> , it opens perfectly whether i go through WAMP tray Icon - localhost - projects folder - index.php , or i just open directly the page using a web browser, it opens ok. BUT when i open a page that starts and ends with <?php.....?> directly using web browser it asks me to save or opne the file. What happens? Are there some settings i am missing. regards, JKM Quote Link to comment Share on other sites More sharing options...
bpops Posted February 4, 2008 Share Posted February 4, 2008 The web browser essentially sees the php file as another (html) page, and so will parse it. but if you don't have the html/body tags in there, it might not attempt to parse it. You need those in there. If you have a .php script that needs to be run to perform some function, then simply call it from another script, but it should not be displayed in the browser. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted February 4, 2008 Share Posted February 4, 2008 You need to have php installed in order to parse it. You won't find any .html only shopping carts. just to be technical of course you can have a .html shopping cart as long as a .html file is phrased as if it has php in it. you can not write a shopping script in "HyperText Markup Language" as this has no scripting abilities to it only presentation "Markup" Quote Link to comment Share on other sites More sharing options...
revraz Posted February 4, 2008 Share Posted February 4, 2008 Try something like this <?php echo "Hi"; ?> That should work fine. Quote Link to comment Share on other sites More sharing options...
revraz Posted February 4, 2008 Share Posted February 4, 2008 Maybe you should read the initial post and then my reply to that post instead of taking my reply out of context. You need to have php installed in order to parse it. You won't find any .html only shopping carts. just to be technical of course you can have a .html shopping cart as long as a .html file is phrased as if it has php in it. you can not write a shopping script in "HyperText Markup Language" as this has no scripting abilities to it only presentation "Markup" Quote Link to comment Share on other sites More sharing options...
jkkenzie Posted February 4, 2008 Author Share Posted February 4, 2008 I understand thanks very much all for you time. God bless Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted February 4, 2008 Share Posted February 4, 2008 just clarifying something that I always reanswer about SEO and .html files. Also some people like to not have to alter link structure but incorporate bits of php in their pure markup pages so this is very helpful when links do not need to be changed. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.