Jump to content
  • Advertisement
Sign in to follow this  
phil67rpg

beginner php

This topic is 516 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

<!DOCTYPE html>
<html>
<body>

<h1>My first PHP page</h1>

<?php
 echo "Hello World!";
?>

</body>
</html> 

I am using notepad++ to run this code, I am new to php, I am running IE emulation, this code is run under html filename extension. this code outputs "My first PHP page" but it does not output "Hello World!", I am unsure of what to do next

Share this post


Link to post
Share on other sites
Advertisement
PHP is a server-side web programming technology. You don't execute it in a browser, so your editors browser emulation is likely just ignoring the PHP tags.

You will need to set up some kind of local webserver to test your PHP, probably.

Share this post


Link to post
Share on other sites

Reading the other post thread, I think PHP isn't what you want. If you want to code web-based games, you should use Javascript and HTML5.

PHP is used (on a server side) to generate a "customized" webpage, using an engine, then send the "customized" webpage to the user. For example, blogs constantly generate "customized" pages: when you click on a tag, the engine will generate a page with all the posts (that might be in a database) and then send that page (containing only that information) to the user. That gives the illusion that the website is "dynamic".

 

Javascript, on the other hand, is a script language that will be executed in the client-side (in the user computer). It can be used to add, delete or modify the content that is already in that page in the client-side. 

Edited by felipefsdev

Share this post


Link to post
Share on other sites

actually I am not working on a game, I am reading a book on dynamic web site development. I have read several chapters on PHP but I am open to learning HTML5 and Javascript, I am new to web site design. I just want to work on a simple project.

Share this post


Link to post
Share on other sites

actually I am not working on a game, I am reading a book on dynamic web site development. I have read several chapters on PHP but I am open to learning HTML5 and Javascript, I am new to web site design. I just want to work on a simple project.

Ok, then you will need that PHP "engine" running. I have done it on Linux only, so I don't know which one is available on other systems or how to setup on them. Maybe this page can help with that: http://php.net/manual/en/install.windows.php

 

The engine will stay up running and listening to incoming requests. In this case, you go to the browser and try to access the page via localhost address. Based on that HTML with PHP code that you wrote, the PHP engine will generate the page and send to the client (the browser).

Share this post


Link to post
Share on other sites

You need to pick the language/tools/tech to match whatever project you're actually trying to put together.  "A dynamic website" can mean so many different things.  If you've never made a website of any kind before, it would make more sense to start with plain HTML, then add Javascript once you're ok with HTML, then move onto PHP once you're comfortable with static pages and have a better idea of what your requirements are.

A good tool for local testing / dev would be something like XAMPP- it's basically a really easy way to setup a web server.  Install it, hit the "start" button next to Apache, put your site in the /htdocs folder it makes, then access them by typing "localhost" into your browser.   Your PHP scripts will work this way.

Edited by TedEH

Share this post


Link to post
Share on other sites

is there any simple web site project that I can work on, I do not want to work on a game yet. I am learning html5 css3 and javascript

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!