PHP Query Strings

admin

Administrator
Staff member
Being fairly new to PHP, I'm having some problems with my PHP-coded stuff. I'm trying to use query strings to do the following:

Let's say I have a bunch of pages that have various Download descriptions on them, and a link on each page that would look like <!-- w --><a class="postlink" href="http://www.website.com/disclaimer.php?Download">www.website.com/disclaimer.php?Download</a><!-- w --> =filename.ext (this link would take you to a disclaimer page). Then, on the disclaimer page, there would be a link/button that would say 'Click here to Download '. What I'm trying to do is figure out how I can use a query string(s) to tell the disclaimer.php page what file is going to be Download ed when a person clicks on the Download link. I'd be pointing to the disclaimer.php page from all of the Download description pages, but with different query strings for each Download page.

Any help would be appreciated. Thanks.you could do like
$Download = $_GET['Download '];
this gets what ever the value of Download is in the query string, so like if it was bob.zip, $Download would hold the value of "bob.zip"

so then output all the disclaimer stuff, then whe you get to the link for it you could be like
<a href=http://www.htmlforums.com/archive/index.php/"<?php echo "path/to/Download s/$Download "; ?>">continue to Download </a>Ok, sounds simple enough... I'll try it out. Thanks!You want to use this code...


<?php

if(isset($_GET['page'])){

switch($_GET['page']) {
case 'news' :
include 'news.php';
break;
case 'photos' :
include 'photos.php';
break;
}
}
else {
include('news.php');
}
?>


Just change the things in the case section then it will look like this...

file.php?page=news...but you do realize that wasnt what he was trying to do?:) Oops sorry guys. I'll have to start reading the post properly. I'm just eager to help people.
 
Back
Top