Loading ...
Sorry, an error occurred while loading the content.

Basic file input / output

Expand Messages
  • rootkidd
    Hi, I have two webpages which I ll call 1 and 2. 1 contains buttons to other pages ( namely 2 ) On page 2 there are data fields for information, when a user
    Message 1 of 976 , Mar 12, 2001
    • 0 Attachment
      Hi, I have two webpages which I'll call 1 and 2.
      1 contains buttons to other pages ( namely 2 ) On
      page 2 there are data fields for information, when a
      user fills in the fields and submits the form it
      executes my perl script and sends off the data to a
      database which is seperate from either page. What I need
      to do is get a timestamp appearing in a text field
      on 1 when the user submits page 2. See,I can get the
      script to send a timestamp to page 1 but it merely
      appends the stamp to the bottom which is not what I need
      I need to actualy get the stamp into an html input
      field. This is what I have so far.<br><br>$timestamp =
      localtime;<br>open(FILE, "<< page1.html") || die "$!";<br>print FILE
      "$timestamp";<br>close(FILE);<br><br>Obviousely this just adds the stamp to the bottom of page 1.
      I have 4 fields in page 1 where I need info to be
      placed once the user submits page 2. How can I
      edit/improve this source to specify the field that the data is
      placed in.<br><br>on page two the field I need the stamp
      in looks like this.<br><br>End of the last
      outage:<br><br><input type="text" value ="$info" name="last_out_p"
      size=25><br><br>as u can see I have called the value $info. thats
      where I need page 2's timestamp to be
      placed.<br><br>Any help would be great as I have only just started
      perl 2 weeks ago and Ive been searching for days now
      with little success, although I have learned about
      other things :)<br><br>thanx
    • Ubercat
      Hi there. I m trying to make a global hash in a use strict Perl program for a school assignment, and I declared a hash outside of any
      Message 976 of 976 , Feb 27, 2002
      • 0 Attachment
        Hi there.<br><br>I'm trying to make a global hash
        in a use strict Perl program for a school
        assignment, and I declared a hash outside of any
        blocks...<br><br>my %names<br><br>I have declared several global
        arrays, but the global hash isn't working out as well. I
        keep getting "requires explicit package" errors when
        the program has to use the $names{key} form. How dfo
        I get around this so that the hash reference is
        also recognized by the program?
      Your message has been successfully submitted and would be delivered to recipients shortly.