Announcement

Collapse
No announcement yet.

Insert php code in webpage (html)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Insert php code in webpage (html)

    Need help !!!!!!

    Where to insert php code:

    <?
    $filecnt = "ISOcnt.txt";
    if (file_exists($filecnt)) {
    $fp = fopen($filecnt,"r");
    $count = (int)fread($fp,24);
    fclose($fp);
    $count++;
    } else {
    $count = 1;
    }
    $fp = fopen($filecnt , "w");
    fwrite($fp,$count);
    fclose($fp);
    echo $count;
    ?>

    in the following html:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML><HEAD><TITLE>Untitled Page</TITLE>
    <META http-equiv=Content-Type content="text/html; charset=windows-1252">
    <META content="MSHTML 6.00.2900.2668" name=GENERATOR></HEAD>
    <BODY text=#000000 bgColor=#ffffff>
    <DIV style="LEFT: 0px; OVERFLOW: hidden; POSITION: absolute; TOP: 0px"
    align=left><IMG height=600 src="FCount_files/m219a.gif" width=700 align=top
    border=0> </DIV></BODY></HTML>

    in order $count appears on page ?
    Thanks!

  • #2
    Your question doesn't seem to be related to BlueVoda (the html is Internet Explorer generated code).

    The PHP code can be inserted into BlueVoda anywhere you like. All it does is open a text file and increase the page counter. Not a very effecient way of keeping statistics though... It will only slow down the server is you ask me :(
    Forum Moderator
    BlueVoda Spe******t

    Comment


    • #3
      Make efficient

      Hello,

      How to make it effecient ? Please a hint. Thanks.





      Originally posted by Pablo
      Your question doesn't seem to be related to BlueVoda (the html is Internet Explorer generated code).

      The PHP code can be inserted into BlueVoda anywhere you like. All it does is open a text file and increase the page counter. Not a very effecient way of keeping statistics though... It will only slow down the server is you ask me :(

      Comment


      • #4
        Why not use simply use the page statistics of vodahost? It already keeps track of all your page hits, and much more than that.
        Forum Moderator
        BlueVoda Spe******t

        Comment


        • #5
          Page statistics of vodahost ?

          Hello,

          Where to find page statistics of vodahost ? I looked for in the page properties,
          but could not find.


          Originally posted by Pablo
          Why not use simply use the page statistics of vodahost? It already keeps track of all your page hits, and much more than that.

          Comment


          • #6
            Personally, I like to have a counter on my website for the users to see. It is not just about stats.

            The stat programs are located in the Cpanel.
            ::Steven.H::

            Comment


            • #7
              Statistics not real time

              Hello,

              Page statistics of vodahost are not real time. Updated in 24 hours.
              Is it true ?


              Originally posted by Pablo
              Why not use simply use the page statistics of vodahost? It already keeps track of all your page hits, and much more than that.

              Comment


              • #8
                Yes, that's true.
                But the PHP script you're using will slow down the server, since it opens and updates the file with each page hit. You better off using a database table to store the results because MYSQL will cache your query/updates.
                Forum Moderator
                BlueVoda Spe******t

                Comment


                • #9
                  How to Insert PHP into HTML

                  I personally reccomend using IFRAMES.

                  Here it is Step by Step:

                  1. Open Notepad.

                  2. Copy and Paste this in Notepad:

                  <?
                  $filecnt = "ISOcnt.txt";
                  if (file_exists($filecnt)) {
                  $fp = fopen($filecnt,"r");
                  $count = (int)fread($fp,24);
                  fclose($fp);
                  $count++;
                  } else {
                  $count = 1;
                  }
                  $fp = fopen($filecnt , "w");
                  fwrite($fp,$count);
                  fclose($fp);
                  echo $count;
                  ?>

                  3. Save this as counter.php

                  4. Upload it to your HTML Documents folder on your FTP server.

                  5. Now, Insert HTML into your page in BlueVoda.

                  6. Paste this in the HTML box:

                  <IFRAME name="inlineframe" src="counter.php" width=122 height=40 marginwidth=0 marginheight=0 frameborder=0 scrolling=no></IFRAME>

                  7. Adjust your the size of the IFRAME using Width and Height.

                  8. Publish the page and check to see if it works!

                  -- I Hope this Works for You! --
                  The Eagle Radio! Playing the Best Hits From Rock to Oldies!

                  Click Here to Tune In Using Winamp Player!

                  Click Here to Tune in Using Real Player!

                  Comment

                  Working...
                  X