Jump to content

loading a .php file


jkkenzie

Recommended Posts

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

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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"

Link to comment
Share on other sites

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"

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.