Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting up PHP #2

Open
github-learning-lab bot opened this issue Nov 8, 2020 · 0 comments
Open

Setting up PHP #2

github-learning-lab bot opened this issue Nov 8, 2020 · 0 comments

Comments

@github-learning-lab
Copy link

Setting up PHP

PHP is server-side code that runs on top of a normal HTML website. This means you can use HTML and PHP together.

  • Get started by creating a PHP document in the www folder in WAMP. Index.php is considered by most websites to be the "home page"
  • Open index.php in your text editor and type the following HTML code
<!DOCTYPE html>
<html>
  <head>
    <title>PHP Store</title>
  </head>
  <body>
    <?php
    // Using two forward slashes we create comments in php.
    // Within the php tag, we can insert values into our HTML.
    echo "<h1>Welcome!</h1>";
    ?>
  </body>
</html>

Displaying Content

In this example, we used the "echo" command to insert an HTML header within the php tags. All of our php code will be contained in these tags.

Make sure you always end every statement with a semicolon

In your browser, click on the php-course folder, and you should see the header we inserted being displayed.

If it worked, save your changes to GitHub.

git add index.php
git commit -m"initial php setup"
git push origin master
@suman313 suman313 reopened this Nov 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant