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

help required on matt's guestbook.

Expand Messages
  • eventualdeath
    Hi,On Matt s guestbook, I want to modify the output in such a way that it has the ability to sent to either www.myurl.com/primary.shtml/ or
    Message 1 of 2 , Oct 1, 2001
    • 0 Attachment
      Hi,

      On Matt's guestbook, I want to modify the output in such a way that it has
      the ability to sent to either www.myurl.com/primary.shtml/ or
      www.myurl.com/secondary.shtml/ or
      www.myurl.com/university.shtml/
      depending on which values of the form field being selected.

      Lets assume the drop-down form field values as either (1) primary (2)
      secondary (3) university

      I've spent quite some time playing with the operator "if" but it just
      would'nt work.
      Would appreciate any help.

      I guess, below are the infomations that's required.

      #### Set Variables ######

      $primary = "/usr/home/web/h/hereonly/primary.shtml";
      $secondary = "/usr/home/web/h/hereonly/secondary.shtml";
      $university = "/usr/home/web/h/hereonly/university.shtml";

      ###### Begin the Editing of the Guestbook File #####
      ## note that I do not wish to put the things ######
      ## that I've tried here, so as not to cause ######
      ## confusion . #######################

      open (FILE,"$primary") || die "Can't Open $primary: $!\n";
      @LINES=<FILE>;
      close(FILE);
      $SIZE=@LINES;

      ###### Open Link File to Output #######

      open (GUEST,">$primary") || die "Can't Open $primary: $!\n";



      _________________________________________________________
      Do You Yahoo!?
      Get your free @... address at http://mail.yahoo.com
    • Ferry I
      ... Hope this will do some help .... if ($drop_down_value==1) { $primary = /usr/home/web/h/hereonly/primary.shtml ; } elsif ($drop_down_value==2) $primary =
      Message 2 of 2 , Oct 2, 2001
      • 0 Attachment
        At 14:17 02/10/01 +0800, eventualdeath wrote:
        >Hi,
        >
        >On Matt's guestbook, I want to modify the output in such a way that it has
        >the ability to sent to either www.myurl.com/primary.shtml/ or
        >www.myurl.com/secondary.shtml/ or
        >www.myurl.com/university.shtml/
        >depending on which values of the form field being selected.

        Hope this will do some help ....

        if ($drop_down_value==1) {
        $primary = "/usr/home/web/h/hereonly/primary.shtml";
        } elsif ($drop_down_value==2)
        $primary = "/usr/home/web/h/hereonly/secondary.shtml";
        } else {
        $primary = "/usr/home/web/h/hereonly/university.shtml";
        }

        Assuming the drop down menu name is 'drop_down', you can either use the
        following to parse the value of $drop_down_value
        * On Matt Script, may be this will work (I can't tell as I don't have the
        script :)
        $drop_down_value = $Config{'drop_down'};
        * Using CGI.pm
        use CGI; $q = new CGI;
        $drop_down_value = $q->param('drop_down');

        Best Regards,
        Ferry I
      Your message has been successfully submitted and would be delivered to recipients shortly.