javascript, php

Discussion in 'JavaScript' started by utrosa, Nov 29, 2004.

  1. #1
    I'm trying to refresh textboxes with values received from cgi scripts.

    I use php code within javascript that calls cgi scripts. So textboxes are refreshed every second with values received from cgi script.

    Example (javascript and php code set value in textbox received from cgi script):

    document.getElementById("id11").value= <? echo system(/home/apache/cgi-bin/id11.cgi'); ?>;

    But textboxes are always refreashed with values received from cgi scripts when they are called for the first time. If cgi script returns value 5 when it is called first time and written in textbox, then this value (5) will be written in textbox every next second. Correct value is written again in textbox when I refresh web page, but only when cgi is called for the first time. From there on the old value is written in textbox every next second again.

    How to solve this problem?
     
    utrosa, Nov 29, 2004 IP
  2. phrozen_ra

    phrozen_ra Peon

    Messages:
    147
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    make a function and call it with

    
    setTimeout('myfunction()', 1000);
    
    Code (markup):
    and

    
    function myfunction()
    {
       document.getElementById("id11").value= <? echo system(/home/apache/cgi-bin/id11.cgi'); ?>; 
    }
    
    Code (markup):
    it should work
     
    phrozen_ra, Jan 18, 2005 IP
  3. ashishhbti

    ashishhbti Peon

    Messages:
    67
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks !!!!
     
    ashishhbti, Jul 21, 2010 IP
  4. ashishhbti

    ashishhbti Peon

    Messages:
    67
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hi Admin..

    frm where user can delete own post ? I havn't found any option to delete my post. ...
     
    ashishhbti, Jul 21, 2010 IP