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

  • Home
  • SEARCH
  • 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 9248737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:00:53+00:00 2026-06-18T10:00:53+00:00

I need to include some javascript in my php file but im having difficulty

  • 0

I need to include some javascript in my php file but im having difficulty with the quotes inside the javascript

This is the javascript:

<scripttype="text/javascript">

    var sc_project = $$$$;

    var sc_invisible = $;

    var sc_security = "$$$$$$$";

    var scJsHost = (("https:" == document.location.protocol) ? "https://secure." : "http://www.")

    document.write("<sc" + "ript type='text/javascript' src='" + scJsHost + "statcounter.com/counter/counter.js'></" + "script>");

</script>

I tried

echo {
    '<scripttype="text/javascript">

                var sc_project = $$$$$$;

                var sc_invisible = $;

                var sc_security = "$$$$$$";

                var scJsHost = (("https:" == document.location.protocol) ? "https://secure." : "http://www.")

                document.write("<sc" + "ript' . 'type=\'text/javascript\' src='' . ' + scJsHost + "statcounter.com/counter/counter.js'.'></" + "script>");

            </script>';
        }

Any way to have this appear on my php page?

  • 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-06-18T10:00:54+00:00Added an answer on June 18, 2026 at 10:00 am

    Your script tag should be:

    <script type="text/javascript">
    

    Because type is an attribute.

    When you are using quotes in PHP, you can mix quotes for simple things…

    $test = '<p id="example">Example using mixed quotes</p>';
    

    And you can escape quotes if it gets more complicated…

    $test = '<p id="example">Example using \'escaped\' quotes</p>';
    

    So you could use this:

    echo '<script type="text/javascript">
    
        var sc_project = $$$$;
    
        var sc_invisible = $;
    
        var sc_security = "$$$$$$$";
    
        var scJsHost = (("https:" == document.location.protocol) ? "https://secure." : "http://www.")
    
        document.write("<sc" + "ript type=\'text/javascript\' src=\'" + scJsHost + "statcounter.com/counter/counter.js\'></" + "script>");
    
    </script>';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to include a html file inside a php file, I tried using
I need some help trying to match a C include file with full path
I have done some javascript validation for my HTML form but I need to
I need to include some kind of notifications in a sidebar gadget, preferably systray
I'm packaging an ejb and I need to include some .classes from a dependency
I need to include a dashboard in a JavaScript application I am building. The
I have a front-end component view that I need to include a .js file
I have a PHP page with this structure: <?php include 'header.php'; include 'content.php'; include
according facebook's Javascript SDK, facebook application should include Channel File on their init code.
I am currently working on this website , and i need some help regarding

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.