paulley23 Posted December 10, 2006 Share Posted December 10, 2006 hi alli got this this bit of code:-[code]<?phpif ($cmd=="") {include ("main.inc");}elseif ($cmd="clients") {include ("clients.inc");}elseif ($cmd=="services") {include ("services.inc");}elseif ($cmd=="support") {include ("support.inc");}elseif ($cmd=="contact") {include ("contact.inc";}elseif ($cmd=="about") {include ("aboutus.inc");}elseif ($cmd=="faq") {include ("faq.inc");}else {include ("error.inc");}?>[/code]but to dont work, i have just change over servers to mine own server and before i move it , it worked fine.when i go to /index.php?cmd=about i just displays the main.incany ideas why this could be.thankspaul Link to comment https://forums.phpfreaks.com/topic/30168-solved-got-a-problem-with-querystrings/ Share on other sites More sharing options...
alpine Posted December 10, 2006 Share Posted December 10, 2006 You're trapped by register_globals() set to OFF - as it should be!add this before your if's:[code]<?php$cmd = $_GET['cmd'];// if etc.?>[/code] Link to comment https://forums.phpfreaks.com/topic/30168-solved-got-a-problem-with-querystrings/#findComment-138676 Share on other sites More sharing options...
paulley23 Posted December 10, 2006 Author Share Posted December 10, 2006 now its showing a blank page not the page it surposed to be ??? Link to comment https://forums.phpfreaks.com/topic/30168-solved-got-a-problem-with-querystrings/#findComment-138682 Share on other sites More sharing options...
paulley23 Posted December 10, 2006 Author Share Posted December 10, 2006 sorted i left a = out like this[code]elseif ($cmd= "clients") {include ("clients.inc");[/code]in put back the =like this[code]elseif ($cmd== "clients") {include ("clients.inc");[/code]Sorted :D Link to comment https://forums.phpfreaks.com/topic/30168-solved-got-a-problem-with-querystrings/#findComment-138684 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.