|
|
Joined: Dec 2001
Posts: 50
Member
|
Member
Joined: Dec 2001
Posts: 50 |
I didnt know where to put this, so im putting it here. Anyway can someone make a template webpage for me on how to make something like index.php?section=misc or something along those lines, if you could, id be grateful.
« ----------------- Info -----------------» Email: [email protected] Web Site: Blue-Wave « --------------- End Info ---------------»
|
|
|
|
Joined: Nov 2001
Posts: 436
Member
|
Member
Joined: Nov 2001
Posts: 436 |
Not sure about PHP, but CGI would look like this: ======================= #!/usr/bin/perl if ($ENV{QUERY_STRING} eq page=section) { page2() }; print "Content-type:text/htmlnn"; print< Main page goes here. page1 exit;
sub page2 { print "Content-type:text/htmlnn"; print<Content for "Section" page goes here. page2 exit; } =======================
Basically, this line of code: if ($ENV{QUERY_STRING} eq page=section) { page2() }; is saying, "If the query string (everything after the "?" in the URL) equals "page=section", than display Subroutine "page2".
And then below that, the main page (page1) is just what is displays with nothing in the query string, and then sub page2 is what will be displayed if they have http://www.url.com/cgi-bin/mywebsite.cgi?page=section .
Sorry if that's not what you're looking for.
|
|
|
|
Joined: May 2000
Posts: 1,356
Addict
|
Addict
Joined: May 2000
Posts: 1,356 |
moving to `Server Side Scripting` Forum...
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 87
Joined: December 2001
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|
|