Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3977926
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:58:56+00:00 2026-05-20T04:58:56+00:00

What is the big difference between PHP and JavaScript? Can we do website only

  • 0

What is the big difference between PHP and JavaScript?

Can we do website only with PHP (and HTML) or is it absolutely necessary you need JavaScript too?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T04:58:57+00:00Added an answer on May 20, 2026 at 4:58 am

    PHP runs on the server.

    Javascript runs within the browser (what’s called the client).

    They are completely distinct. You can do a website without Javascript; however, any in-browser “scripts” will not run with PHP being given to the browser, since the browser does not understand PHP.

    So think about it like this…

    1. You create a PHP page on your server, called mypage.php.
    2. Within it contains PHP code.
    3. The PHP code is parsed on the server when accessed over HTTP (http://example.com/mypage.php).
    4. Which sends the output, or HTML and other “resources” (Javascript and CSS mostly), to the browser (client).

    Javascript would be part of the response to the browser requesting the mypage.php content. On the server, HTML/Javascript/CSS are considered a special kind of text, and have no bearing on the PHP code itself. PHP is meant to ease the management of outputting HTML/Javascript/CSS to browsers, mostly.

    A More Extensive Answer

    Server – mypage.php

    <html>
    <head>
    <style type="text/css">
    body p {
      background-color: #dddddd;
      color: #ff0000;
    }
    </style>
    <script type="text/javascript">
    
    alert('Thank you for visiting!');
    
    </script>
    </head>
    <body>
    <p><?php print 'Hello World!'; ?></p>
    </body>
    </html>
    

    What the browser (client) sees – http://example.com/mypage.php

    <html>
    <head>
    <style type="text/css">
    body p {
      background-color: #dddddd;
      color: #ff0000;
    }
    </style>
    <script type="text/javascript">
    
    alert('Thank you for visiting!');
    
    </script>
    </head>
    <body>
    <p>Hello World!</p>
    </body>
    </html>
    

    Notice the script tags stay as they are, but the PHP tags go away. They are parsed by the PHP parser on the server-side, before outputting the HTML code (with style and script tags intact) to the browser (client).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is the big difference between launching Equinox via java -jar plugins/org.eclipse.osgi_3.6.0.v20100517.jar and using
Is there a big performance difference between those two sql count statements, when performing
Is there a big difference (in the way of coding, ...) between the direct3d
What is the big difference between parsing and typecasting? I try to use type
I know there's a big difference between the drawable-* folders, but what should I
According to new article from css-tricks there is a big difference between how you
Is the Linux kernel preemptive or not? There is a big difference between Understanding
Is there a big performance difference between varcharColumn IS NOT NULL and tinyint =
How big difference is it between ThreadPriority.Lowest and ThreadPriority.BelowNormal . How do I know
Is there a big performance difference between: Process A writing to a temp file,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.