Php Question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Houdini
    Confirmed User
    • Dec 2001
    • 1651

    #1

    Php Question

    Is it possible to include a php script in an html page? If so, what's the command to include it?
  • Chris
    Too lazy to set a custom title
    • May 2003
    • 27880

    #2
    dont you jsut embed it like you would html?
    i dunno
    [email protected]

    Comment

    • Napolean
      Misanthropic Egalitarian
      • Nov 2002
      • 4330

      #3
      depends on your server config.

      you could img src it tho
      HAH! FOUND IT FRIS

      Comment

      • Warden
        Confirmed User
        • Nov 2002
        • 2906

        #4
        shtml
        AIM: ZeeRiddler
        ICQ: 128160005
        Warden's MS

        Comment

        • arial
          Confirmed User
          • Jul 2002
          • 4012

          #5
          you can always parse your html to read as shtml

          Comment

          • Cogitator
            Confirmed User
            • Feb 2002
            • 672

            #6
            If you want it on client side: No

            You can put javascript or (in the case of Internet Exporer) vbscript, but not php.
            Last edited by Cogitator; 12-01-2004, 08:37 PM.
            - this space intentionally left blank -

            Comment

            • Houdini
              Confirmed User
              • Dec 2001
              • 1651

              #7
              Yeah, I know I can just change it to shtml and include it that way, but I don't really want to do that because my page is doing well with SEs. I don't know if changing the extention will screw that up. Anyone know?

              Comment

              • The Apprentice
                Confirmed User
                • Dec 2004
                • 839

                #8
                YES.


                Change yourpage.html to yourpage.php and add the script.

                It's that easy.
                SIG 4 SALE! $2 A YEAR!

                Comment

                • brizzad
                  holla
                  • Jul 2003
                  • 11769

                  #9
                  PHP Code:
                  <script type="text/javascript" src="http://www.makesomecash.net/include.php"></script>; 
                  
                  is a script im using

                  Comment

                  • Houdini
                    Confirmed User
                    • Dec 2001
                    • 1651

                    #10
                    Originally posted by brizzad
                    PHP Code:
                    <script type="text/javascript" src="http://www.makesomecash.net/include.php"></script>; 
                    
                    is a script im using
                    Thanks, I'll try that.

                    Comment

                    • Houdini
                      Confirmed User
                      • Dec 2001
                      • 1651

                      #11
                      Originally posted by The Apprentice
                      YES.


                      Change yourpage.html to yourpage.php and add the script.

                      It's that easy.
                      The whole point is to keep it an .html page.

                      Comment

                      • frankfortuna
                        Confirmed User
                        • Aug 2002
                        • 1504

                        #12
                        I'm no developer, but I know we do this quite frequently for tracking code insertion. I just asked our developer for a brief rundown:

                        <TonyMontana> off topic
                        <TonyMontana> what's the preferred way to embed php in html?
                        <TonyMontana> whilst keeping the .html extension
                        <geek> use .htaccess or configure httpd.conf to parse .html as php,
                        <geek> and the embed part
                        <geek> <body><?php // phpstuff to do whatever ?></body>

                        I hope this helps.

                        Comment

                        • JSA Matt
                          So Fucking Banned
                          • Aug 2003
                          • 5464

                          #13
                          AddHandler php-script .php .html

                          Comment

                          Working...