|
-
Dec 21st, 2005, 05:50 PM
#1
Thread Starter
Frenzied Member
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.
-
Dec 21st, 2005, 06:51 PM
#2
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
-
Dec 21st, 2005, 10:43 PM
#3
Thread Starter
Frenzied Member
Re: What do they mean?
So how did they come up with that? I mean where "those features" are located in cgi script?
-
Dec 22nd, 2005, 09:10 AM
#4
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?
-
Dec 22nd, 2005, 01:49 PM
#5
Thread Starter
Frenzied Member
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
-
Dec 22nd, 2005, 02:03 PM
#6
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.
-
Dec 22nd, 2005, 03:14 PM
#7
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?
-
Dec 22nd, 2005, 05:14 PM
#8
Thread Starter
Frenzied Member
Re: What do they mean?
 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
-
Dec 23rd, 2005, 08:57 AM
#9
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.
-
Dec 23rd, 2005, 09:57 AM
#10
Re: What do they mean?
Your fave, Perl. Or so it would appear.
-
Dec 23rd, 2005, 10:37 AM
#11
Thread Starter
Frenzied Member
Re: What do they mean?
 Originally Posted by CornedBee
What language?
Perl
-
Dec 23rd, 2005, 10:55 AM
#12
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|