bsamson Posted November 17, 2006 Share Posted November 17, 2006 Alright ... I thought I had a basic understanding of if statements ... but my current project has proved that wrong ...Let's say that I am calling this page: index.phpAfter I am calling another page via: index.php?p=contactNow, I have this code:[code]<?php // Get page $rpage = $_GET[p]; // Set Default page & title if p is empty if (empty($rpage)) { $page ="index_inc.php"; $title="NY Mobile LLC - Internal Network"; } if ($rpage="contact") { $page ="contact_inc.php"; $title="NY Mobile LLC - Internal Network - Contact Information"; }?>[/code] When I run this page it displays the contact page ... But $rpage is empty! Any help would be appreciated! Thanks![b]EDIT By thorpe: Please use the full <?php tags with our [ code ] tags, it adds the benifit of syntax highlighting. You should really be using them in your code anyway. Link to comment https://forums.phpfreaks.com/topic/27643-if-statements-issue/ Share on other sites More sharing options...
trq Posted November 17, 2006 Share Posted November 17, 2006 This line should be...[code=php:0]if ($rpage == "contact") {[/code]not...[code=php:0]if ($rpage="contact") {[/code] Link to comment https://forums.phpfreaks.com/topic/27643-if-statements-issue/#findComment-126423 Share on other sites More sharing options...
bsamson Posted November 17, 2006 Author Share Posted November 17, 2006 Perhaps the could be my problem ... Man thorpe, your a posting man! HAHA Link to comment https://forums.phpfreaks.com/topic/27643-if-statements-issue/#findComment-126427 Share on other sites More sharing options...
Adika Posted November 18, 2006 Share Posted November 18, 2006 But if you use [color=red]if ($rpage === "contact") {[/color]it would be better ;) Link to comment https://forums.phpfreaks.com/topic/27643-if-statements-issue/#findComment-126663 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.