DaveLinger Posted September 15, 2006 Share Posted September 15, 2006 I'm getting both of these errors now that I've switched to a new server. The code it doesn't like is...[code]<?phpif($_GET['page'] == ''){$id="index";}else{$id = $_GET['page'];}?>[/code] Quote Link to comment Share on other sites More sharing options...
onlyican Posted September 15, 2006 Share Posted September 15, 2006 That should workA little tip to make it cleaner$id = isset($_GET["page"]) ? $_GET["page"] : "index";try usin the isset(); Quote Link to comment Share on other sites More sharing options...
DaveLinger Posted September 15, 2006 Author Share Posted September 15, 2006 what about for something like this?[code]if($id == ''){$query="SELECT *, DATE_FORMAT(Date, '%W, %M %D %Y') AS my_date FROM wg_pages WHERE id=\"$id2\" ORDER BY datetime DESC";}else{$query="SELECT *, DATE_FORMAT(Date, '%W, %M %D %Y') AS my_date FROM wg_pages WHERE id=\"$id\" ORDER BY datetime DESC";}[/code] Quote Link to comment Share on other sites More sharing options...
Barand Posted September 15, 2006 Share Posted September 15, 2006 Depends on whether $id has previously been defined or not . Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.