Results 1 to 12 of 12

Thread: What do they mean?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,170

    What do they mean?

    Could anyone answer my few questions below?

    1. Why on the <a href=$cgi_url?work=admsearch&user=$user> What does that question mark refers to? I don't see any codes that associated with that, i meant cgi.

    2. On the submit action form, the code is like this <td width="100%"><form enctype="multipart/form-data" method="POST" action="$cgi_url?user=$user">
    Again why not form.cgi or something instead $cgi_url?user=$user. I really completely lost about this code.

    Please and please, i really cannot find sources info on the web.

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: What do they mean?

    Anything before the ? is the address of the page, and anything after is parameters (separated by & ).

    So "$cgi_url?work=admsearch&user=$user" means:

    go to page $cgi_url, and tell it that work is equal to admsearch and user is equal to $user

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,170

    Re: What do they mean?

    So how did they come up with that? I mean where "those features" are located in cgi script?

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: What do they mean?

    It's become something of a status quo web standard

    I don't understand what you mean by locating those features. What are you trying to accomplish?

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,170

    Re: What do they mean?

    I mean how did they come up with that? I want to see what is the code that is associated with $cgi_url?user=$user... basically, I want to make a page that when I put my mouse on it, it will shows that kind of link instead of the plain link? It's hard to explain here, are there any resources on the web regarding that so I can read by myself?

    Thanks

  6. #6
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: What do they mean?

    I have no idea what you are after, but it's just a web address - in the same way that the "Classic VB FAQ" link below is (it goes to the page showthread.php , and passes the parameter t [thread number] =348141 )

    I presume that $cgi_url and $user are replaced at some point before the page is served to the browser.

  7. #7
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: What do they mean?

    You cannot find out until runtime. $cgi_url and $user are variables in the language you are using. They do get replaced like geek says. The only way for you to look at it would be on the page itself.

    Perhaps all you need is a CGI Perl tutorial?

  8. #8

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,170

    Re: What do they mean?

    Quote Originally Posted by si_the_geek
    I have no idea what you are after, but it's just a web address - in the same way that the "Classic VB FAQ" link below is (it goes to the page showthread.php , and passes the parameter t [thread number] =348141 )

    I presume that $cgi_url and $user are replaced at some point before the page is served to the browser.
    OK, I understand what you two were trying to mean and I kinda am getting there. could you any one of you give me a simple code that is related to the idea of that passing the parameter with that ? mark like we've been talking about? So that I may understand clearer.

    Thanks guys

  9. #9
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: What do they mean?

    What language?
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  10. #10
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: What do they mean?

    Your fave, Perl. Or so it would appear.

  11. #11

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,170

    Re: What do they mean?

    Quote Originally Posted by CornedBee
    What language?
    Perl

  12. #12
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: What do they mean?

    Hello, World. Note that there are far better methods of creating the headers, but I'd have to look them up and I'm too lazy.
    Code:
    #!/usr/bin/perl -w
    
    print "Content-type: text/html\r\n\r\n";
    
    // argv[1] contains the query string (everything after the ?)
    $argv[1] =~ /name=([^&]+)/
    print<<END
    <!DOCTYPE html (insert proper stuff here)>
    <html>
    <head>
    <title>CGI Hello, World</title>
    </head>
    <body>
    <h1>CGI</h1>
    <p>Hello, $1!</p>
    </body>
    </html>
    END;
    Admittedly, there might be a few errors in there. In particular, I'm not sure whether Perl does variable substitution in heredoc, or whether the ! messes it up.
    Anyway, put this stuff in a CGI file. Assuming that it's reachable as "hello.cgi", you can then do this:
    Code:
    <!DOCTYPE html blabla>
    <html>
    <head>
    <title>CGI Hello</title>
    </head>
    <body>
    <form action="hello.cgi" method="GET">
    <p>Enter your name: <input type="text" name="name"> <input type="submit" value="Say Hello"></p>
    </form>
    </body>
    Put this into a HTML file and open it in your web browser. (Note that you must retrieve it over a web server. Browsers can't interpret CGI.)
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width