+ Reply to Thread
Results 1 to 9 of 9

Thread: Insert php code in webpage (html)
      
   

  1. #1
    ali
    ali is offline Corporal
    Join Date
    Jul 2005
    Posts
    17

    Exclamation 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. #2
    Pablo is offline Moderator
    Join Date
    May 2005
    Posts
    507

    Default

    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 Specialist

  3. #3
    ali
    ali is offline Corporal
    Join Date
    Jul 2005
    Posts
    17

    Default Make efficient

    Hello,

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





    Quote 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 :(

  4. #4
    Pablo is offline Moderator
    Join Date
    May 2005
    Posts
    507

    Default

    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 Specialist

  5. #5
    ali
    ali is offline Corporal
    Join Date
    Jul 2005
    Posts
    17

    Default Page statistics of vodahost ?

    Hello,

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


    Quote 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.

  6. #6
    Steven.H is offline Lieutenant Colonel
    Join Date
    Jul 2005
    Posts
    500

    Default

    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::

  7. #7
    ali
    ali is offline Corporal
    Join Date
    Jul 2005
    Posts
    17

    Exclamation Statistics not real time

    Hello,

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


    Quote 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.

  8. #8
    Pablo is offline Moderator
    Join Date
    May 2005
    Posts
    507

    Default

    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 Specialist

  9. #9
    Gray's Avatar
    Gray is offline Sergeant
    Join Date
    Jul 2005
    Location
    Texas
    Posts
    30

    Smile 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! --

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. HTML code
    By topcatgym in forum General Support Issues
    Replies: 6
    Last Post: 11-22-2005, 12:46 AM
  2. how do i insert php?
    By GiGoLo in forum mySQL & PHP
    Replies: 1
    Last Post: 11-19-2005, 12:04 PM
  3. HTML code for Contact Form
    By Patti Johnson in forum BlueVoda - General Issues
    Replies: 2
    Last Post: 09-22-2005, 06:56 PM
  4. Copy HTML into the code
    By Quint in forum VodaHits SEO Services
    Replies: 6
    Last Post: 09-16-2005, 12:23 PM
  5. How do I make a php webpage?
    By joeri in forum mySQL & PHP
    Replies: 2
    Last Post: 09-12-2005, 09:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49