rawky1976 Posted August 14, 2007 Share Posted August 14, 2007 <?php $user = $_GET['userid']; include 'config.php'; include 'opendb.php'; $query = "select * from users WHERE user_id LIKE '$user'"; $result = mysql_db_query("servicemgmt", $query . mysql_error()); $r = mysql_fetch_array($result) $firstname = $r['user_fname']; $lastname = $r['user_lname']; $ext = $r['user_ext']; $bleep = $r['user_bleep']; $exttel = $r['user_extno']; $email = $r['user_email']; echo "<table style="width: 80%">"; echo "<tr><td>First Name</td><td><input type=\"text\" value=\"$firstname\"\n name="firstname" id="firstname" style="width: 160px"/></td><td>Last Name</td><td> <input type=\"text\" value=\"$lastname\">\n name="lastname" id="lastname" style="width: 160px"/></td></tr>"; echo "<tr><td> </td><td> </td><td> </td><td> </td></tr>"; echo "<tr><td>Extension</td><td> <input type=\"text\" value=\"$ext\">\n name="ext" id="ext" style="width: 160px"/></td><td>Bleep No.</td><td> <input type=\"text\" value=\"$bleep\">\n name="bleep" id="bleep" style="width: 160px"/></td></tr>"; echo "<tr><td> </td><td> </td><td> </td><td> </td></tr>"; echo "<tr><td>External Tel.</td><td><input type=\"text\" value=\"$exttel\">\n name="exttel" id="exttel" style="width: 160px"/></td><td> </td><td> </td></tr>"; echo "<tr><td> </td><td> </td><td> </td><td> </td></tr>"; echo "<tr><td>Email</td><td><input type=\"text\" value=\"$email\">\n name="email" id="email" style="width: 200px" /></td><td> </td><td> </td></tr>"; echo "<tr><td> </td><td> </td><td> </td><td> </td></tr>"; echo "<tr><td><input name="updateuser" type="submit" id="updateuser" value="Update User Details" /></td><td> </td><td> </td><td><input name="reset1" type="reset" value="Clear Form" /></td></tr>"; echo "</table>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/64924-page-is-blank-when-loaded-is-it-the-echoed-table/ Share on other sites More sharing options...
akitchin Posted August 14, 2007 Share Posted August 14, 2007 1. please use code tags when posting code. 2. posting plain code and asking to fix it without any background or foreword is a little bit rude. how do you think a doctor would feel if i just walked up to him, said not a damned word, and stuck my arm out to show him my hives? he may help, but he'd probably also charge you money for it. we don't get paid. try explaining the problem, even if it seems trivial. we aren't here to baby you. Quote Link to comment https://forums.phpfreaks.com/topic/64924-page-is-blank-when-loaded-is-it-the-echoed-table/#findComment-323970 Share on other sites More sharing options...
NArc0t1c Posted August 14, 2007 Share Posted August 14, 2007 @akitchin - lmga Try echo statements with single quotes. It should give an php error actually. Quote Link to comment https://forums.phpfreaks.com/topic/64924-page-is-blank-when-loaded-is-it-the-echoed-table/#findComment-323971 Share on other sites More sharing options...
rawky1976 Posted August 14, 2007 Author Share Posted August 14, 2007 Sorry guys! From the previous page is: <a href=\"editSearcheduser.php?userid=$id\"> When clicked this goes to the page in the code which should reload the Add User form but this time with the fields populated. Then you change what you want and submit it back? Quote Link to comment https://forums.phpfreaks.com/topic/64924-page-is-blank-when-loaded-is-it-the-echoed-table/#findComment-323973 Share on other sites More sharing options...
GingerRobot Posted August 14, 2007 Share Posted August 14, 2007 The problem is you have a lot of unescaped double quote. You can't place a double quote inside the string you are echoing wihtout escaping it with a backslash if you are using double quotes so surround the string. The reason why you get a blank page is because you have the display_errors directive set to off. If you were to add: error_reporting(E_ALL); ini_set('display_errors','On'); To to top of your page, you would get some error messages. To fix, go through and escape all of the double quotes inside your string, or use single quotes to surround the attribtues of your html tags/your string. Beaten to it - but thought id post anyways. Might add something with the explanation of display errors. Quote Link to comment https://forums.phpfreaks.com/topic/64924-page-is-blank-when-loaded-is-it-the-echoed-table/#findComment-323974 Share on other sites More sharing options...
akitchin Posted August 14, 2007 Share Posted August 14, 2007 @akitchin - lmga i have no idea what lmga means. all i could find was "Location Managers Guild of America" and "Louisiana Meat Goat Association." Quote Link to comment https://forums.phpfreaks.com/topic/64924-page-is-blank-when-loaded-is-it-the-echoed-table/#findComment-323975 Share on other sites More sharing options...
GingerRobot Posted August 14, 2007 Share Posted August 14, 2007 @akitchin - lmga i have no idea what lmga means. all i could find was "Location Managers Guild of America" and "Louisiana Meat Goat Association." Haha, i wasn't the only one to google. Even urbandictionary.com doesn't have any suggestions. I thought it had gotten to the stage where you could put any 3/4 letter combination in and someone had come up with a meaning Quote Link to comment https://forums.phpfreaks.com/topic/64924-page-is-blank-when-loaded-is-it-the-echoed-table/#findComment-323977 Share on other sites More sharing options...
NArc0t1c Posted August 14, 2007 Share Posted August 14, 2007 @akitchin - lmga i have no idea what lmga means. all i could find was "Location Managers Guild of America" and "Louisiana Meat Goat Association." afr for lol. Quote Link to comment https://forums.phpfreaks.com/topic/64924-page-is-blank-when-loaded-is-it-the-echoed-table/#findComment-323978 Share on other sites More sharing options...
akitchin Posted August 14, 2007 Share Posted August 14, 2007 i guess i'll be forever lost on both AFR and LMGA. PS: your sig link goes to "Quantim_theory," might want to fix that. Quote Link to comment https://forums.phpfreaks.com/topic/64924-page-is-blank-when-loaded-is-it-the-echoed-table/#findComment-323981 Share on other sites More sharing options...
rawky1976 Posted August 14, 2007 Author Share Posted August 14, 2007 I think it might be laughing my goddamn a** (off) with a missing 'o'? What is the \n for inside the echo after it inserts a value into the textbox please? Quote Link to comment https://forums.phpfreaks.com/topic/64924-page-is-blank-when-loaded-is-it-the-echoed-table/#findComment-323983 Share on other sites More sharing options...
akitchin Posted August 14, 2007 Share Posted August 14, 2007 <input type=\"text\" value=\"$exttel\">\n name="exttel" id="exttel" style="width: 160px"/></td><td> </td><td> </td></tr> you're ending every input tag early, right after the value. if you changed it to single quotes, it's because you're now escaping the ending double quote. when HTML sees \" after a starting quote, it assumes you mean that double quote literally as opposed to meaning it as a delimiter. if you're using single quotes, you can remove every backslash used to escape the double quotes. Quote Link to comment https://forums.phpfreaks.com/topic/64924-page-is-blank-when-loaded-is-it-the-echoed-table/#findComment-323988 Share on other sites More sharing options...
NArc0t1c Posted August 14, 2007 Share Posted August 14, 2007 afr short for Afrikaans. lmga directly translated: laugh my ass off(laugh out loud). Will fix the wikipedia link. rawky1976 try this: <?php $user = $_GET['userid']; include 'config.php'; include 'opendb.php'; $query = "select * from users WHERE user_id LIKE '$user'"; $result = mysql_db_query("servicemgmt", $query . mysql_error()); $r = mysql_fetch_array($result); $firstname = $r['user_fname']; $lastname = $r['user_lname']; $ext = $r['user_ext']; $bleep = $r['user_bleep']; $exttel = $r['user_extno']; $email = $r['user_email']; echo '<table style="width: 80%">'; echo '<tr><td>First Name</td><td><input type="text" value="$firstname" name="firstname" id="firstname" style="width: 160px "/></td><td>Last Name</td><td> <input type="text" value="$lastname" name="lastname" id="lastname" style="width: 160px" /></td></tr>'; echo '<tr><td> </td><td> </td><td> </td><td> </td></tr>'; echo '<tr><td>Extension</td><td> <input type="text" value="$ext" name="ext" id="ext" style="width: 160px" /></td><td>Bleep No.</td><td> <input type="text" value="$bleep" name="bleep" id="bleep" style="width: 160px"/></td></tr>'; echo '<tr><td> </td><td> </td><td> </td><td> </td></tr>'; echo '<tr><td>External Tel.</td><td><input type="text" value="$exttel" name="exttel" id="exttel" style="width: 160px"/></td><td> </td><td> </td></tr>'; echo '<tr><td> </td><td> </td><td> </td><td> </td></tr>'; echo '<tr><td>Email</td><td><input type="text" value="$email" name="email" id="email" style="width: 200px" /></td><td> </td><td> </td></tr>'; echo '<tr><td> </td><td> </td><td> </td><td> </td></tr>'; echo '<tr><td><input name="updateuser" type="submit" id="updateuser" value="Update User Details" /></td><td> </td><td> </td><td><input name="reset1" type="reset" value="Clear Form" /></td></tr>'; echo '</table>'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/64924-page-is-blank-when-loaded-is-it-the-echoed-table/#findComment-323993 Share on other sites More sharing options...
willpower Posted August 14, 2007 Share Posted August 14, 2007 for example echo "so he said to her.."get in bed now, I want some action," whilst stripping off!" is wrong as the echo statement looks for the " to start the statment and the next " to stop. Clearly this would result in a very strange output. SO we can do this echo "so he said to her..\"get in bed now, I want some action,\" whilst stripping off!" which 'escapes' the " or we can do this echo 'so he said to her.."get in bed now, I want some action," whilst stripping off!'. Hope that makes sense to you Quote Link to comment https://forums.phpfreaks.com/topic/64924-page-is-blank-when-loaded-is-it-the-echoed-table/#findComment-323996 Share on other sites More sharing options...
akitchin Posted August 14, 2007 Share Posted August 14, 2007 for example echo "so he said to her.."get in bed now, I want some action," whilst stripping off!" is wrong as the echo statement looks for the " to start the statment and the next " to stop. Clearly this would result in a very strange output. SO we can do this echo "so he said to her..\"get in bed now, I want some action,\" whilst stripping off!" which 'escapes' the " or we can do this echo 'so he said to her.."get in bed now, I want some action," whilst stripping off!'. Hope that makes sense to you .. followed by "not tonight honey, 'i have a headache.'" Quote Link to comment https://forums.phpfreaks.com/topic/64924-page-is-blank-when-loaded-is-it-the-echoed-table/#findComment-323998 Share on other sites More sharing options...
GingerRobot Posted August 14, 2007 Share Posted August 14, 2007 NArc0t1c: It'll need to be this: <?php $user = $_GET['userid']; include 'config.php'; include 'opendb.php'; $query = "select * from users WHERE user_id LIKE '$user'"; $result = mysql_db_query("servicemgmt", $query . mysql_error()); $r = mysql_fetch_array($result) $firstname = $r['user_fname']; $lastname = $r['user_lname']; $ext = $r['user_ext']; $bleep = $r['user_bleep']; $exttel = $r['user_extno']; $email = $r['user_email']; echo '<table style="width: 80%">'; echo '<tr><td>First Name</td><td><input type="text" value="'.$firstname.'" name="firstname" id="firstname" style="width: 160px "/></td><td>Last Name</td><td> <input type="text" value="'.$lastname.'" name="lastname" id="lastname" style="width: 160px" /></td></tr>'; echo '<tr><td> </td><td> </td><td> </td><td> </td></tr>'; echo '<tr><td>Extension</td><td> <input type="text" value="'.$ext.'" name="ext" id="ext" style="width: 160px" /></td><td>Bleep No.</td><td> <input type="text" value="'.$bleep.'" name="bleep" id="bleep" style="width: 160px"/></td></tr>'; echo '<tr><td> </td><td> </td><td> </td><td> </td></tr>'; echo '<tr><td>External Tel.</td><td><input type="text" value="'.$exttel.'" name="exttel" id="exttel" style="width: 160px"/></td><td> </td><td> </td></tr>'; echo '<tr><td> </td><td> </td><td> </td><td> </td></tr>'; echo '<tr><td>Email</td><td><input type="text" value="'.$email.'" name="email" id="email" style="width: 200px" /></td><td> </td><td> </td></tr>'; echo '<tr><td> </td><td> </td><td> </td><td> </td></tr>'; echo '<tr><td><input name="updateuser" type="submit" id="updateuser" value="Update User Details" /></td><td> </td><td> </td><td><input name="reset1" type="reset" value="Clear Form" /></td></tr>'; echo '</table>'; ?> Otherwise your variables wont get evaluated. Quote Link to comment https://forums.phpfreaks.com/topic/64924-page-is-blank-when-loaded-is-it-the-echoed-table/#findComment-323999 Share on other sites More sharing options...
NArc0t1c Posted August 14, 2007 Share Posted August 14, 2007 heh, Sorry didn't notice the variables(might seem weird because there is a mysql query). Quote Link to comment https://forums.phpfreaks.com/topic/64924-page-is-blank-when-loaded-is-it-the-echoed-table/#findComment-324002 Share on other sites More sharing options...
rawky1976 Posted August 14, 2007 Author Share Posted August 14, 2007 Now I am confused, I have this which is still blank: <?php error_reporting(E_ALL); ini_set('display_errors','1'); $user = $_GET['userid']; include 'config.php'; include 'opendb.php'; $query = "select * from users WHERE user_id LIKE '$user'"; $result = mysql_db_query("servicemgmt", $query . mysql_error()); $r = mysql_fetch_array($result) $firstname = $r['user_fname']; $lastname = $r['user_lname']; $ext = $r['user_ext']; $bleep = $r['user_bleep']; $exttel = $r['user_extno']; $email = $r['user_email']; //echo "<table style=\"width: 80%\">"; //echo "<tr><td>First Name</td><td><input type=\"text\" value=\"$firstname\"\n name=\"firstname\" id=\"firstname\" style=\"width: 160px\"/></td><td>Last Name</td><td> <input type=\"text\" value=\"$lastname\">\n name=\"lastname\" id=\"lastname\" style=\"width: 160px\"/></td></tr>"; //echo "<tr><td> </td><td> </td><td> </td><td> </td></tr>"; //echo "<tr><td>Extension</td><td> <input type=\"text\" value=\"$ext\">\n name=\"ext\" id=\"ext\" style=\"width: 160px\"/></td><td>Bleep No.</td><td> <input type=\"text\" value=\"$bleep\">\n name=\"bleep\" id=\"bleep\" style=\"width: 160px\"/></td></tr>"; //echo "<tr><td> </td><td> </td><td> </td><td> </td></tr>"; //echo "<tr><td>External Tel.</td><td><input type=\"text\" value=\"$exttel\">\n name=\"exttel\" id=\"exttel\" style=\"width: 160px\"/></td><td> </td><td> </td></tr>"; //echo "<tr><td> </td><td> </td><td> </td><td> </td></tr>"; //echo "<tr><td>Email</td><td><input type=\"text\" value=\"$email\">\n name=\"email\" id=\"email\" style=\"width: 200px\" /></td><td> </td><td> </td></tr>"; //echo "<tr><td> </td><td> </td><td> </td><td> </td></tr>"; //echo "<tr><td><input name=\"updateuser\" type=\"submit\" id=\"updateuser\" value=\"Update User Details\" /></td><td> </td><td> </td><td><input name=\"reset1\" type=\"reset\" value=\"Clear Form\" /></td></tr>"; //echo "</table>"; //echo '<table style="width: 80%">'; //echo '<tr><td>First Name</td><td><input type="text" value="'.$firstname.'" name="firstname" id="firstname" style="width: 160px "/></td><td>Last Name</td><td> <input type="text" value="'.$lastname.'" name="lastname" id="lastname" style="width: 160px" /></td></tr>'; //echo '<tr><td> </td><td> </td><td> </td><td> </td></tr>'; //echo '<tr><td>Extension</td><td> <input type="text" value="'.$ext.'" name="ext" id="ext" style="width: 160px" /></td><td>Bleep No.</td><td> <input type="text" value="'.$bleep.'" name="bleep" id="bleep" style="width: 160px"/></td></tr>'; //echo '<tr><td> </td><td> </td><td> </td><td> </td></tr>'; //echo '<tr><td>External Tel.</td><td><input type="text" value="'.$exttel.'" name="exttel" id="exttel" style="width: 160px"/></td><td> </td><td> </td></tr>'; //echo '<tr><td> </td><td> </td><td> </td><td> </td></tr>'; //echo '<tr><td>Email</td><td><input type="text" value="'.$email.'" name="email" id="email" style="width: 200px" /></td><td> </td><td> </td></tr>'; //echo '<tr><td> </td><td> </td><td> </td><td> </td></tr>'; //echo '<tr><td><input name="updateuser" type="submit" id="updateuser" value="Update User Details" /></td><td> </td><td> </td><td><input name="reset1" type="reset" value="Clear Form" /></td></tr>'; //echo '</table>'; echo '<table style="width: 80%">'; echo '<tr><td>First Name</td><td><input type="text" value="$firstname" name="firstname" id="firstname" style="width: 160px "/></td><td>Last Name</td><td> <input type="text" value="$lastname" name="lastname" id="lastname" style="width: 160px" /></td></tr>'; echo '<tr><td> </td><td> </td><td> </td><td> </td></tr>'; echo '<tr><td>Extension</td><td> <input type="text" value="$ext" name="ext" id="ext" style="width: 160px" /></td><td>Bleep No.</td><td> <input type="text" value="$bleep" name="bleep" id="bleep" style="width: 160px"/></td></tr>'; echo '<tr><td> </td><td> </td><td> </td><td> </td></tr>'; echo '<tr><td>External Tel.</td><td><input type="text" value="$exttel" name="exttel" id="exttel" style="width: 160px"/></td><td> </td><td> </td></tr>'; echo '<tr><td> </td><td> </td><td> </td><td> </td></tr>'; echo '<tr><td>Email</td><td><input type="text" value="$email" name="email" id="email" style="width: 200px" /></td><td> </td><td> </td></tr>'; echo '<tr><td> </td><td> </td><td> </td><td> </td></tr>'; echo '<tr><td><input name="updateuser" type="submit" id="updateuser" value="Update User Details" /></td><td> </td><td> </td><td><input name="reset1" type="reset" value="Clear Form" /></td></tr>'; echo '</table>'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/64924-page-is-blank-when-loaded-is-it-the-echoed-table/#findComment-324023 Share on other sites More sharing options...
akitchin Posted August 14, 2007 Share Posted August 14, 2007 missing something? $r = mysql_fetch_array($result) you didn't put the error reporting lines that Ginger gave you at the top of the file, did you? if you did, you'd have to come back to us a lot less often. Quote Link to comment https://forums.phpfreaks.com/topic/64924-page-is-blank-when-loaded-is-it-the-echoed-table/#findComment-324027 Share on other sites More sharing options...
rawky1976 Posted August 14, 2007 Author Share Posted August 14, 2007 Aren't those the error reporting lines under the opening <php tag? I see a missing ';' !!! Thanks Quote Link to comment https://forums.phpfreaks.com/topic/64924-page-is-blank-when-loaded-is-it-the-echoed-table/#findComment-324029 Share on other sites More sharing options...
akitchin Posted August 14, 2007 Share Posted August 14, 2007 Aren't those the error reporting lines under the opening <php tag? touché. that'll teach me for posting first and reading later. you need to reverse the order, and 'display_errors' should be set to 'On', not '1'. Quote Link to comment https://forums.phpfreaks.com/topic/64924-page-is-blank-when-loaded-is-it-the-echoed-table/#findComment-324031 Share on other sites More sharing options...
rawky1976 Posted August 14, 2007 Author Share Posted August 14, 2007 Still no errors (blank). I'm off to bed (22:48 in the UK) Thanks all, maybe I'll fix it tomorrow...maybe Quote Link to comment https://forums.phpfreaks.com/topic/64924-page-is-blank-when-loaded-is-it-the-echoed-table/#findComment-324034 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.