Forum Moderators: coopster
<?php
if($_GET['nav']=='counters'){
include("counters.html");}
elseif($_GET['nav']=='mail'){
include("mail.html");}
elseif($_GET['nav']=='images'){
include("upload.php");}
elseif($_GET['nav']=='upload'){
include("upload.php?mode=upload");}
elseif($_GET['nav']=='thanks'){
include("thanks.html");}
elseif($_GET['nav']=='code'){
include("code.php");}
elseif($_GET['nav']=='support'){
include("support.html");}
elseif($_GET['nav']=='page1'){
include("page1.html");}
elseif($_GET['nav']=='page2'){
include("page2.html");}
elseif($_GET['nav']=='page3'){
include("page3.html");}
elseif($_GET['nav']=='page4'){
include("page4.html");}
elseif($_GET['nav']=='page5'){
include("page5.html");}
else{
include("updates/news.php");
}
?> For nav=images it called another php script allowing users to upload images. After submitting, this script requires a?mode=upload to know to put out the success message and what not. The action for the submit button is set to index.php?nav=upload which then called upload.php?mode=upload. You'll see where nav=upload.php?mode=upload. This does not work. Instead of calling upload.php and giving it?mode=upload, it just looks for file name upload.php?mode=upload and does not find it. How can I get around this?
You could solve your problem like this: index.php?nav=upload&mode=upload
Then when you include the script $_GET['mode'] will give you the mode, since an included file is within the scope of the including script (ie all variables available at the point of include is available inside the included script. Additionally, $_GET is always available)