Archadian Posted March 3, 2007 Share Posted March 3, 2007 can anyone see why its making the index.php show up white in IE? if (isset($_COOKIE['user']) { include('include/dbcon.inc'); $uname = $_COOKIE['user']; $sql = mysql_query("SELECT uname FROM users WHERE uname = '$uname'") or die("Could not get the username from the DB."); $name = mysql_fetch_array($sql); echo "<table class=\"login\" align=\"center\" valign=\"middle\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\" height=\"35\">"; echo "<tr>"; echo "<td align=\"left\" width=\"50%\" height=\"35\">Welcome " . ucfirst($name) . "! </td>"; echo "<td align=\"left\" width=\"50%\" height=\"35\"><a href=\"" $_SERVER['PHP_SELF'] . "?action=logout\">Logout</a></td>"; echo "</tr>"; echo "</table>"; } else { echo "<table class=\"login\" align=\"center\" valign=\"middle\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\" height=\"35\">"; echo "<form action=\"" . $_SERVER['PHP_SELF'] . "\" method=\"POST\">"; echo "<tr>"; echo "<td align=\"left\" width=\"25%\" height=\"35\">Username: </td>"; echo "<td align=\"left\" width=\"25%\" height=\"35\"><input type=\"text\" name=\"uname\" size=\"10\"></td>"; echo "<td align=\"left\" width=\"25%\" height=\"35\">Password: </td>"; echo "<td align=\"left\" width=\"25%\" height=\"35\"><input type=\"password\" name=\"pass\" size=\"10\"></td>"; echo "</tr>"; echo "</form>"; echo "</table>"; } I've stared at this for 20 minutes and can't find it...Thanks Quote Link to comment Share on other sites More sharing options...
Archadian Posted March 3, 2007 Author Share Posted March 3, 2007 besides this if (isset($_COOKIE['user']) { Quote Link to comment Share on other sites More sharing options...
mmarif4u Posted March 3, 2007 Share Posted March 3, 2007 if (isset($_COOKIE['user'])) { Quote Link to comment Share on other sites More sharing options...
Archadian Posted March 3, 2007 Author Share Posted March 3, 2007 please read my post before what you posted... Quote Link to comment Share on other sites More sharing options...
Greaser9780 Posted March 3, 2007 Share Posted March 3, 2007 echo "<td align=\"left\" width=\"50%\" height=\"35\">Welcome " . ucfirst($name) . "! </td>"; echo "<td align=\"left\" width=\"50%\" height=\"35\">Welcome " . $name['ucfirst'] . "! </td>"; Quote Link to comment Share on other sites More sharing options...
Archadian Posted March 3, 2007 Author Share Posted March 3, 2007 ucfirst() is a function that capitalizes the first letter of the string. ucfirst($name) is correct...thanks tho Quote Link to comment Share on other sites More sharing options...
Greaser9780 Posted March 3, 2007 Share Posted March 3, 2007 Is that the whole code? I don't see any <?php and ?> tags at beginning and end. Quote Link to comment Share on other sites More sharing options...
Archadian Posted March 3, 2007 Author Share Posted March 3, 2007 yeah there are <?php ?> tags, this part of the code is stopping the code and giving me a white page in IE, when i /* */ the code the rest of the page works Quote Link to comment Share on other sites More sharing options...
Greaser9780 Posted March 3, 2007 Share Posted March 3, 2007 Did U run it in firefox? You can error check with that browser. Quote Link to comment Share on other sites More sharing options...
Archadian Posted March 3, 2007 Author Share Posted March 3, 2007 no i don't have firefox lol, i tried splitting the code up and both parts of the code make it stop working Quote Link to comment Share on other sites More sharing options...
warewolfe Posted March 3, 2007 Share Posted March 3, 2007 From the script, you've missed the end brace on the first line. You've also got missing concatenations in line 10. I'd advice you look at the error logs. Also you'd save yourself a lot of work if you work more within the html rather than have the php generate the html. Don't echo the whole line, just insert <td> <?php ucfirst($name); ?> </td> Quote Link to comment Share on other sites More sharing options...
Archadian Posted March 3, 2007 Author Share Posted March 3, 2007 concatenations? >.> Im not seeing it lol. No offense i asked for help to find why this is stopping my script from running...the way i code i have my own reason for Its driving me crazy...i've been through the code for the past few hours and still can't figure it out Quote Link to comment Share on other sites More sharing options...
warewolfe Posted March 3, 2007 Share Posted March 3, 2007 change line 10 to echo "<td align=\"left\" width=\"50%\" height=\"35\"><a href=\"".$_SERVER['PHP_SELF'] ."?action=logout\">Logout</a></td>"; Quote Link to comment Share on other sites More sharing options...
Archadian Posted March 3, 2007 Author Share Posted March 3, 2007 yes i was missing the ., can't believe i missed that i looked at that over and over lol here is the code now: if (isset($_COOKIE['user'])) { include('include/dbcon.inc'); if (isset($_COOKIE['user'])) { $uname = $_COOKIE['user']; $sql = mysql_query("SELECT uname FROM users WHERE uname = '$uname'") or die("Could not get the username from the DB."); $name = mysql_fetch_array($sql); echo "<table class=\"logform\" align=\"center\" valign=\"middle\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\" height=\"35\">"; echo "<tr>"; echo "<td align=\"left\" width=\"50%\" height=\"35\">Welcome " . ucfirst($name) . "! </td>"; echo "<td align=\"left\" width=\"50%\" height=\"35\"><a href=\"" . $_SERVER['PHP_SELF'] . "?action=logout\">Logout</a></td>"; echo "</tr>"; echo "</table>"; } else { echo "<table class=\"logform\" align=\"center\" valign=\"middle\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\" height=\"35\">"; echo "<form action=\"" . $_SERVER['PHP_SELF'] . "\" method=\"POST\">"; echo "<tr>"; echo "<td align=\"left\" width=\"25%\" height=\"35\">Username: </td>"; echo "<td align=\"left\" width=\"25%\" height=\"35\"><input type=\"text\" name=\"uname\" size=\"10\"></td>"; echo "<td align=\"left\" width=\"25%\" height=\"35\">Password: </td>"; echo "<td align=\"left\" width=\"25%\" height=\"35\"><input type=\"password\" name=\"pass\" size=\"10\"></td>"; echo "</tr>"; echo "</form>"; echo "</table>"; } its still stopping the script Quote Link to comment Share on other sites More sharing options...
Archadian Posted March 3, 2007 Author Share Posted March 3, 2007 omg it works now...i didn't change anything since the last post...PHP has a mind of its own...thanks everyone who helped And thank you warewolfe for pointing out the missing '.' 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.