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 Link to comment https://forums.phpfreaks.com/topic/40960-solved-help-please/ Share on other sites More sharing options...
Archadian Posted March 3, 2007 Author Share Posted March 3, 2007 besides this if (isset($_COOKIE['user']) { Link to comment https://forums.phpfreaks.com/topic/40960-solved-help-please/#findComment-198352 Share on other sites More sharing options...
mmarif4u Posted March 3, 2007 Share Posted March 3, 2007 if (isset($_COOKIE['user'])) { Link to comment https://forums.phpfreaks.com/topic/40960-solved-help-please/#findComment-198354 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... Link to comment https://forums.phpfreaks.com/topic/40960-solved-help-please/#findComment-198360 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>"; Link to comment https://forums.phpfreaks.com/topic/40960-solved-help-please/#findComment-198362 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 Link to comment https://forums.phpfreaks.com/topic/40960-solved-help-please/#findComment-198364 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. Link to comment https://forums.phpfreaks.com/topic/40960-solved-help-please/#findComment-198365 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 Link to comment https://forums.phpfreaks.com/topic/40960-solved-help-please/#findComment-198368 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. Link to comment https://forums.phpfreaks.com/topic/40960-solved-help-please/#findComment-198371 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 Link to comment https://forums.phpfreaks.com/topic/40960-solved-help-please/#findComment-198373 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> Link to comment https://forums.phpfreaks.com/topic/40960-solved-help-please/#findComment-198376 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 Link to comment https://forums.phpfreaks.com/topic/40960-solved-help-please/#findComment-198382 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>"; Link to comment https://forums.phpfreaks.com/topic/40960-solved-help-please/#findComment-198386 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 Link to comment https://forums.phpfreaks.com/topic/40960-solved-help-please/#findComment-198389 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 '.' Link to comment https://forums.phpfreaks.com/topic/40960-solved-help-please/#findComment-198391 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.