35 users online (2 members and 33 guests)  


  Results 1 to 2 of 2

Related

  1. seo information ?    Forum: Search Engine Optimization - SEO - Forum
    Replies: 1
  2. IE and the information bar    Forum: Javascript Forum
    Replies: 2
  3. Hypercells....more information please    Forum: HTML Forum
    Replies: 0
  1. #1
    asahlot's Avatar
    New User

    Status
    Offline
    Join Date
    Dec 2008
    Posts
    1

    Getting information from hyper links in CGI

    Hi All,

    I have a cgi perl script to generate all of my html pages and I am not using any static html pages. Now on a page suppose if I put some hypelink to other page (which again I would generate dynamically using my cgi perl script), how can I do that?

    I mean how do I know inside my cgi perl script that which hyperlink was clicked by user on current page?

    Thanks in advance
    Asahlot

  2. #2
    xmassey's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Apr 2007
    Posts
    100

    Re: Getting information from hyper links in CGI

    Hi,

    In answer to your question you would ensure each link has a unique attribute value which could be carried forward and processed by the 2nd script (or you could easily combine both scripts into 1). For example...

    script1.pl
    Code:
    my @pages = qw(page1 page2 page3);
    foreach(@pages){
    print "<a href=\"script2.pl?page=$_\">$_</a><br>"
    }
    script2.pl
    Code:
    my $page = param('page');
    if($page eq "page1"){ print "this is page1"; }
    elsif($page eq "page2"){ print "this is page2"; }
    elsif($page eq "page3"){ print "this is page3"; }
    I hope this helps a bit. If you are more specific with what you want to do, and maybe post some code we can help further.

    Chris



Tags for this Thread