Wankness123 Posted February 4, 2012 Share Posted February 4, 2012 Code: <table border='0' style="height:100%;width:570px;border:solid 1px #BBB"> Error: Parse error: parse error, expecting `','' or `';'' in C:\xampp\htdocs\sources\admin\manage-user.php on line 26 Sorry, im a noob when it comes to coding. please help! Quote Link to comment https://forums.phpfreaks.com/topic/256406-quick-help-with-small-piece-of-code/ Share on other sites More sharing options...
noXstyle Posted February 4, 2012 Share Posted February 4, 2012 You don't even have php on that line. If you're certain that the line is correct, close php before outputting html. Quote Link to comment https://forums.phpfreaks.com/topic/256406-quick-help-with-small-piece-of-code/#findComment-1314498 Share on other sites More sharing options...
Wankness123 Posted February 4, 2012 Author Share Posted February 4, 2012 well here is my whole code. <?php /* Copyright (C) 2009 Murad <Murawd> Josh L. <Josho192837> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ // Must rewrite echo " <fieldset> <legend> Manage User </legend> <table border='0' style="height:100%;width:570px;border:solid 1px #BBB"> <tr class="navtitle" style="height:25px"> <th style="width:auto">Mute A User From Posting</th> </tr> <tr> <td align="center" class="tdbox"> Search for the profile name you wish to mute. </td> </tr> <tr> <td align="center"> <form method="post" action=''> <input type="text" name="name" /> <input type="submit" name="search" value="Search" /> </form> </td> </tr> <tr style="height:25px"> <td class="tdbox"> <span style="float:left"> <a href="?cype=admin">Back To Administration Control Panel</a> </span> <span style="float:right"> <a href="?cype=admin&page=unmuteuser">Unmute User</a> </span> </td> </tr> </table> </fieldset> "; ?> Quote Link to comment https://forums.phpfreaks.com/topic/256406-quick-help-with-small-piece-of-code/#findComment-1314500 Share on other sites More sharing options...
digibucc Posted February 4, 2012 Share Posted February 4, 2012 you are echoing with double quotes, and then you use double quotes in your html. that effectively ends the echo and leaves html its trying to parse as php see after style, it turns colors? that's because the double quote right there, it thinks you ended the echo statement. you can just use single quotes but you have to end them to insert variables. that's what i do. or escape your double quotes, with \ so: <?php echo "abcd\"e\"fghijk"; ?> or even: <?php echo " <fieldset> <legend> Manage User </legend> <table border='0' style=\"height:100%;width:570px;border:solid 1px #BBB\">"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/256406-quick-help-with-small-piece-of-code/#findComment-1314501 Share on other sites More sharing options...
Wankness123 Posted February 4, 2012 Author Share Posted February 4, 2012 Like i said im a noob. i have no idea. but would it be like this then? <table border='0' style='height:100%;width:570px;border:solid 1px #BBB'> Quote Link to comment https://forums.phpfreaks.com/topic/256406-quick-help-with-small-piece-of-code/#findComment-1314503 Share on other sites More sharing options...
Pikachu2000 Posted February 4, 2012 Share Posted February 4, 2012 http://www.tizag.com/phpT/strings.php Quote Link to comment https://forums.phpfreaks.com/topic/256406-quick-help-with-small-piece-of-code/#findComment-1314504 Share on other sites More sharing options...
digibucc Posted February 4, 2012 Share Posted February 4, 2012 yes you can do that, but you'll have to change a lot of double quotes, and they are standard for code like that. i would do this: <?php /* Copyright (C) 2009 Murad <Murawd> Josh L. <Josho192837> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ // Must rewrite // single quote, not double after echo echo ' <fieldset> <legend> Manage User </legend> <table border='0' style="height:100%;width:570px;border:solid 1px #BBB"> <tr class="navtitle" style="height:25px"> <th style="width:auto">Mute A User From Posting</th> </tr> <tr> <td align="center" class="tdbox"> Search for the profile name you wish to mute. </td> </tr> <tr> <td align="center"> <form method="post" action=''> <input type="text" name="name" /> <input type="submit" name="search" value="Search" /> </form> </td> </tr> <tr style="height:25px"> <td class="tdbox"> <span style="float:left"> <a href="?cype=admin">Back To Administration Control Panel</a> </span> <span style="float:right"> <a href="?cype=admin&page=unmuteuser">Unmute User</a> </span> </td> </tr> </table> </fieldset> '; // single quote, not double ending the statement ?> just change the doubles at the beginning and en of the echo statement to singles. just note again, if you need variables in there you would end the single so echo 'the variable ='. $variable. ' and the echo continues...'; you put singles around plain text strings, and close them , with a period after to continue the echo. just review that one line you should get it. Quote Link to comment https://forums.phpfreaks.com/topic/256406-quick-help-with-small-piece-of-code/#findComment-1314506 Share on other sites More sharing options...
ignace Posted February 4, 2012 Share Posted February 4, 2012 Don't use PHP to echo out HTML. Use PHP only for PHP specific parts (echo a variable, calculate a value, if/else, ..). <?php /* Copyright (C) 2009 Murad <Murawd> Josh L. <Josho192837> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ // Must rewrite ?> <fieldset> <legend> Manage User </legend> <table border='0' style="height:100%;width:570px;border:solid 1px #BBB"> <tr class="navtitle" style="height:25px"> <th style="width:auto">Mute A User From Posting</th> </tr> <tr> <td align="center" class="tdbox"> Search for the profile name you wish to mute. </td> </tr> <tr> <td align="center"> <form method="post" action=''> <input type="text" name="name" /> <input type="submit" name="search" value="Search" /> </form> </td> </tr> <tr style="height:25px"> <td class="tdbox"> <span style="float:left"> <a href="?cype=admin">Back To Administration Control Panel</a> </span> <span style="float:right"> <a href="?cype=admin&page=unmuteuser">Unmute User</a> </span> </td> </tr> </table> </fieldset> Quote Link to comment https://forums.phpfreaks.com/topic/256406-quick-help-with-small-piece-of-code/#findComment-1314508 Share on other sites More sharing options...
Wankness123 Posted February 4, 2012 Author Share Posted February 4, 2012 I used your code, but i still got the same error? Quote Link to comment https://forums.phpfreaks.com/topic/256406-quick-help-with-small-piece-of-code/#findComment-1314510 Share on other sites More sharing options...
ignace Posted February 4, 2012 Share Posted February 4, 2012 Like i said im a noob. i have no idea. but would it be like this then? <table border='0' style='height:100%;width:570px;border:solid 1px #BBB'> No ALWAYS use double quotes for attribute values. Worst case you could still use this: echo <<<HTML <table border="0" style="height:100%;width:570px;border:solid 1px #BBB"> HTML; Quote Link to comment https://forums.phpfreaks.com/topic/256406-quick-help-with-small-piece-of-code/#findComment-1314511 Share on other sites More sharing options...
ignace Posted February 4, 2012 Share Posted February 4, 2012 I used your code, but i still got the same error? Did you try mine? Quote Link to comment https://forums.phpfreaks.com/topic/256406-quick-help-with-small-piece-of-code/#findComment-1314512 Share on other sites More sharing options...
Wankness123 Posted February 4, 2012 Author Share Posted February 4, 2012 Sorry for double post, but that worked thanks. i have another thing that i need help with. that deals with mysql and php and stuff. so if you could help can you add me msn? Quote Link to comment https://forums.phpfreaks.com/topic/256406-quick-help-with-small-piece-of-code/#findComment-1314513 Share on other sites More sharing options...
ignace Posted February 4, 2012 Share Posted February 4, 2012 Sorry, we don't do that. We'll be glad to help, just post your question on the forum, give everyone a chance to answer. Quote Link to comment https://forums.phpfreaks.com/topic/256406-quick-help-with-small-piece-of-code/#findComment-1314514 Share on other sites More sharing options...
Wankness123 Posted February 4, 2012 Author Share Posted February 4, 2012 okay thanks. Quote Link to comment https://forums.phpfreaks.com/topic/256406-quick-help-with-small-piece-of-code/#findComment-1314515 Share on other sites More sharing options...
digibucc Posted February 4, 2012 Share Posted February 4, 2012 it failed because you ahd single quotes here too <table border='0' changing those to doubles would fix it. however ignace is right, you shouldn't echo it out anyway, my bad for not saying that. Quote Link to comment https://forums.phpfreaks.com/topic/256406-quick-help-with-small-piece-of-code/#findComment-1314516 Share on other sites More sharing options...
ignace Posted February 4, 2012 Share Posted February 4, 2012 You may want to edit ( icon) your post (or ask a mod) and remove your e-mail address otherwise spam bots will be glad to fill your inbox for you! Quote Link to comment https://forums.phpfreaks.com/topic/256406-quick-help-with-small-piece-of-code/#findComment-1314521 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.