how can create using shell script and develop the web page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gupta24
    New Member
    • May 2008
    • 11

    how can create using shell script and develop the web page

    How can create web page using shell script.......

    Like web page like

    winner of the month(given the input) = john
    type of the prize(given the input)= gold

    the given page like


    winner of the month john
    type of the prize gold

    please help

    bye
    gupta
  • Brosert
    New Member
    • Jul 2008
    • 57

    #2
    You probably need to provide a little more information...I t's not immediately clear exactly what you want to do

    Here are some helpers/ideas along the way....

    Code:
    #Read a variable
    read NAME
    
    #output header1 html tag 
    echo "<h1> ${NAME} </h1>"
    Piping your output to a file will help in creating a page - you will still need to open it through a browser...
    It might be a lot of work, though, as you would need to create all the tags around it as well....you might want to read them from a pre-prepared file
    Of course, you can call shell commands through PHP scripts on a web page - and have them output the result back to the php page being generated....

    Post back with more info if I'm way off track with what you want to do....

    Comment

    • gupta24
      New Member
      • May 2008
      • 11

      #3
      yes i want open file from browser and display the information what ever given the input in the web page itself

      please help

      gupta


      Originally posted by Brosert
      You probably need to provide a little more information...I t's not immediately clear exactly what you want to do

      Here are some helpers/ideas along the way....

      Code:
      #Read a variable
      read NAME
      
      #output header1 html tag 
      echo "<h1> ${NAME} </h1>"
      Piping your output to a file will help in creating a page - you will still need to open it through a browser...
      It might be a lot of work, though, as you would need to create all the tags around it as well....you might want to read them from a pre-prepared file
      Of course, you can call shell commands through PHP scripts on a web page - and have them output the result back to the php page being generated....

      Post back with more info if I'm way off track with what you want to do....

      Comment

      • Brosert
        New Member
        • Jul 2008
        • 57

        #4
        You can do this a number of ways.
        Basically (if I understand waht you want to do), you want to create a file from a script, and later open the information generated by that script in a browser.

        There are probably at least two reasonably simple approaches
        1) you could directly generate the HTML from the script - probably long and tedious
        2) you could save the information to a temporary file, which may or may not contain some HTML formatting, and have a generic file (in say php) to create a page using the information in that file.

        Probably what I would do, is redirect the output to a .csv file which would look something like (result.csv):

        [code]
        winner, John
        prize, Gold
        [code]

        you then create a file which includes something like the following php (lottery.php) {I haven't made sure that works so their may be little oversights in it}:
        Code:
        <? 
        //Check File exists
        if(exists_file("result.csv'"))
        {
        //Open file for reading
          $myfile=fopen("result.csv". "r");
          //read the csvlines - note 1000 here is >= file length- may need to extend if you open bigger files 
          while (($line = fgetcsv($myfile,1000,",")!=false)
          {
            echo "<h2>".$line[0]." is ".$line[1]."!!";
          }
        }
        ?>

        Comment

        Working...