Dustin Rohel Posted July 28, 2023 Posted July 28, 2023 (edited) I have tried making a fight by mixing some of the userlist from mccodes and the attack in grpg, very first time trying somthing like this. Please let me know if i did a bad thing or not. People here dont think im actually trying, but i am thanks. I've been editing and trying by TRIAL AND ERROR as someone on MWG told me to do, this person is also not like others that call me dumb and make fun of me for learning slowly, so.... if you wanna say im not trying, then Piss off cuz i have been, i ask questions so i can learn, thanks for making me feel dumb again people... You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Edited August 1, 2023 by Dustin Rohel PEOPLE JUDGING 1 1 Quote
Magictallguy Posted July 28, 2023 Posted July 28, 2023 A couple of syntax issues (parsing) and a small miscount for table headings/rows, but you're on the right path 🙂 2 Quote
Dustin Rohel Posted July 28, 2023 Author Posted July 28, 2023 12 hours ago, Magictallguy said: A couple of syntax issues (parsing) and a small miscount for table headings/rows, but you're on the right path 🙂 Thanks, i'm gunna look up what syntax (parsing) is. Also, what happend to the text i posted, its now able to be copied? Any pointers on how i can fix this? Quote
KyleMassacre Posted July 29, 2023 Posted July 29, 2023 2 hours ago, Dustin Rohel said: Any pointers on how i can fix this? What do you mean exactly? Quote
KyleMassacre Posted July 29, 2023 Posted July 29, 2023 What MTG was trying to say about your parse error is that you are using a double quote to start a string and using another double quote in that same string. You need to mix and match your quotes. Whatever quote type you use to start a string, that same quote type will end the string. I am on my phone so I can’t do code tags (or I don’t know how), but take a look at the following: echo “<td class=“contentHead”>Something</td>”; That will throw an error. Your “contentHead” should be wrapped in a single quote instead of a double quote. 1 Quote
Dustin Rohel Posted July 29, 2023 Author Posted July 29, 2023 4 minutes ago, KyleMassacre said: What MTG was trying to say about your parse error is that you are using a double quote to start a string and using another double quote in that same string. You need to mix and match your quotes. Whatever quote type you use to start a string, that same quote type will end the string. I am on my phone so I can’t do code tags (or I don’t know how), but take a look at the following: echo “<td class=“contentHead”>Something</td>”; That will throw an error. Your “contentHead” should be wrapped in a single quote instead of a double quote. So i should take echo “<td class=“contentHead”>Something</td>”; that out of the file, i need to look up what a string is now. 1 Quote
Canjucks Posted July 29, 2023 Posted July 29, 2023 8 minutes ago, Dustin Rohel said: So i should take echo “<td class=“contentHead”>Something</td>”; that out of the file, i need to look up what a string is now. Look at the code specifically where you use echo. Some of it uses " and other parts ' you need to pick one. Quote
Dustin Rohel Posted July 29, 2023 Author Posted July 29, 2023 ok, thank you. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Still don't work 1 Quote
KyleMassacre Posted July 29, 2023 Posted July 29, 2023 You still have some of the same error in there. In your very last echo you have same quote type. Quote
Dustin Rohel Posted July 29, 2023 Author Posted July 29, 2023 This here? what is it? (Quote)? 1 Quote
corruptcity || skalman Posted July 29, 2023 Posted July 29, 2023 I think @KyleMassacre was referring to this You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Magictallguy Posted July 29, 2023 Posted July 29, 2023 Your second attempt is much closer! 😄 I've edited your post to wrap your code in code tags, with PHP selected as the language. Not only does this make the post look a little cleaner, it's less abuse on my scrollwheel 😛 Now it has "syntax highlighting", which changes the colour of the text, visually breaking things up a little in an attempt to make it easier to follow. Lets take the first line after the opening PHP tag -- this bit: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. It uses 3 colours: White to denote a function (or variable (see further down your code)), off-yellow to show special characters, and green to show a string. Syntactically, this is correct. Assuming there is a file named "globals.php" in the same directory (folder) as whatever file's running this, it will parse (see this StackOverflow answer for multiple explanations on what "parsing" is). So, strings are green. Noted. See the example snippet @corruptcity || skalman just posted? Notice how variables are green and some of the strings are white? Eek! Something's wrong here! The colours have flipped - perhaps a string has been closed before it should've been. It's easy to mix up " (quotation mark) and '' (double apostrophe) 😉 Example snippets from your code: 7 hours ago, Dustin Rohel said: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. That's absolutely correct! The function (I use the term loosely as echo is not a function but a language construct.) is white and the string is green. That should run fine. 7 hours ago, Dustin Rohel said: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. It starts fine, but wait! The string becomes white, yellow and blue. Somewhere here's one of your problems. 😉 You're also going to run into an additional "gotcha!" too with this one; variables within strings encased in ' (apostrophe) won't parse and will print as plain text. You'll need to break it out of the string and concatenate it instead. At the risk of a temporary topic change; I strongly recommend using an IDE, preferably tailored the languages you intend to write. Personally, I use solutions from the JetBrains Toolbox as I have full access to everything the toolbox provides at (thankfully) no cost to me. However, it is payware under the usual circumstances. Notepad++ (albeit not actually an IDE, but can become one) is great for quick 30-second edits and VSCode is a highly-extensive free alternative to the JetBrains products I use. Final note: Keep at it. You're getting there 🙂 1 Quote
AdamHull Posted July 29, 2023 Posted July 29, 2023 (edited) There is multiple issues within the echo's the above being one of them If you are using a echo starting with a " or ' you can then not use these within HTML either as this will also cause a syntax error Within the snippet @corruptcity || skalman showed you take a close look at the beginning of the echo as you have a issue and then your 'style' within your span Edited July 29, 2023 by AdamHull Quote
Magictallguy Posted July 29, 2023 Posted July 29, 2023 9 minutes ago, AdamHull said: If you are using a echo starting with a " or ' you can then not use these within HTML either as this will also cause a syntax error I bloody love this plugin for PhpStorm ❤️ Quote
Dustin Rohel Posted July 30, 2023 Author Posted July 30, 2023 15 hours ago, Magictallguy said: Your second attempt is much closer! 😄 I've edited your post to wrap your code in code tags, with PHP selected as the language. Not only does this make the post look a little cleaner, it's less abuse on my scrollwheel 😛 Now it has "syntax highlighting", which changes the colour of the text, visually breaking things up a little in an attempt to make it easier to follow. Lets take the first line after the opening PHP tag -- this bit: require_once('globals.php'); You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. It uses 3 colours: White to denote a function (or variable (see further down your code)), off-yellow to show special characters, and green to show a string. Syntactically, this is correct. Assuming there is a file named "globals.php" in the same directory (folder) as whatever file's running this, it will parse (see this StackOverflow answer for multiple explanations on what "parsing" is). So, strings are green. Noted. See the example snippet @corruptcity || skalman just posted? Notice how variables are green and some of the strings are white? Eek! Something's wrong here! The colours have flipped - perhaps a string has been closed before it should've been. It's easy to mix up " (quotation mark) and '' (double apostrophe) 😉 Example snippets from your code: That's absolutely correct! The function (I use the term loosely as echo is not a function but a language construct.) is white and the string is green. That should run fine. It starts fine, but wait! The string becomes white, yellow and blue. Somewhere here's one of your problems. 😉 You're also going to run into an additional "gotcha!" too with this one; variables within strings encased in ' (apostrophe) won't parse and will print as plain text. You'll need to break it out of the string and concatenate it instead. At the risk of a temporary topic change; I strongly recommend using an IDE, preferably tailored the languages you intend to write. Personally, I use solutions from the JetBrains Toolbox as I have full access to everything the toolbox provides at (thankfully) no cost to me. However, it is payware under the usual circumstances. Notepad++ (albeit not actually an IDE, but can become one) is great for quick 30-second edits and VSCode is a highly-extensive free alternative to the JetBrains products I use. Final note: Keep at it. You're getting there 🙂 Thanks! I've been using my note pad to edit 15 hours ago, corruptcity || skalman said: I think @KyleMassacre was referring to this echo '' <tr> <td>' . $r['userid'] . '</td> <td><a href="viewuser.php?u=' . $r['userid'] . '">' . $r['gangPREF'] . ' ' . $r['username'] . '</a></td> <td>' . $r['level'] . '</td> <td>' . (($r['laston'] >= $_SERVER['REQUEST_TIME'] - 15 * 60) ? '<span style='color: green; font-weight:bold;'>Online</span>' : '<span style='color: red; font-weight:bold;'>Offline</span>') . ' </td> </tr> '; You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. I don't know what I'm looking for Quote
SRB Posted August 1, 2023 Posted August 1, 2023 On 7/30/2023 at 2:17 AM, Dustin Rohel said: Thanks! I've been using my note pad to edit I don't know what I'm looking for You also don't come across as trying much yourself either, so I'll be the one to say it - if you are never going to put one foot forward and look at researching stuff yourself, but just ask on forums constantly, you'll never learn. At some point, you need to take the driving seat of your own knowledge, so let's drive. You don't know what you're looking for? Sweet, so what do you THINK you're looking for? What have you taken from anyone's suggestions here? Quote
Dustin Rohel Posted August 1, 2023 Author Posted August 1, 2023 did nobody learn from asking questions? that means the internet too. Why do people just try to put others down? 1 Quote
Veramys Posted August 1, 2023 Posted August 1, 2023 2 hours ago, Dustin Rohel said: did nobody learn from asking questions? that means the internet too. Why do people just try to put others down? I don't think SRB is trying to put you down. But rather try to help you see that instead of having all the answers handed to you, without you actually learning anything, you should try to do some research and learn and then ask questions when you get stuck. If you're always asking others to do stuff for you, then you're not going to learn. You'll just make a small attempt and then get others to fix stuff instead of learning to see where your errors are yourself. 1 Quote
Magictallguy Posted August 1, 2023 Posted August 1, 2023 5 hours ago, Dustin Rohel said: did nobody learn from asking questions? About that.. On 7/29/2023 at 2:33 AM, KyleMassacre said: What do you mean exactly? On 7/29/2023 at 11:10 AM, Magictallguy said: See the example snippet @corruptcity || skalman just posted? On 7/29/2023 at 11:10 AM, Magictallguy said: Notice how variables are green and some of the strings are white? 7 hours ago, SRB said: You don't know what you're looking for? 7 hours ago, SRB said: so what do you THINK you're looking for? 7 hours ago, SRB said: What have you taken from anyone's suggestions here? It's an interesting choice to throw your toys out of the pram about asking questions while on a forum absolutely full of them. Advise re-reading this topic. The answers are here 😉 1 Quote
MNG Posted August 1, 2023 Posted August 1, 2023 5 hours ago, Dustin Rohel said: did nobody learn from asking questions? that means the internet too. Why do people just try to put others down? I mean yeah but most people google the error and figure it from there instead of flooding a forum. Another thing is you come off rude to those that try to help. For example your new edit title…. If you don’t want any criticism, why df are you posting it? Are you teaching us something? I been watching your threads for a hot sec and notice you think this community owe you something. You put 0 to no effort in. I realize that off your domain issue the answer was literally a direct google with MULTIPLE options. All these developers that are trying to guide you should get respect and if you’re nice enough they might give you their contact for further guidance down the road but all your doing is burning bridges and being toxic about things cause you can’t LISTEN. 1 Quote
KyleMassacre Posted August 1, 2023 Posted August 1, 2023 I think what anybody reading this now or in the future needs to understand is that this is a forum written in text. Things can be taken out of context because it’s difficult to parse what people are really trying to convey since there is not a lot of tone in text. Everyone here is trying to help but we want you to learn but it’s difficult to teach when your homework is done for you. The answers to your initial problem have been solved and we can work on the next problem if one does arise but we won’t know until you fix what was suggested. Servers only throw one error at a time if the error stops code execution since it can’t move past that and generally syntax errors stop code execution. Also, laying into people that are here trying to help will not get you the help you need or want and may steer people away from a post when they see your name as the OP because we may just think that you’re not going to take the help we offer unless we write the script for you especially if it’s one of the easiest things to fix such as a syntax error because you are missing a punctuation mark somewhere in your code or you used the incorrect punctuation mark. 1 Quote
newttster Posted August 1, 2023 Posted August 1, 2023 Dustin ... you said you were using Notepad. Are you using regular Notepad or Notepad++? Quote
SRB Posted August 1, 2023 Posted August 1, 2023 8 hours ago, Dustin Rohel said: did nobody learn from asking questions? that means the internet too. Why do people just try to put others down? A lot of people learned from asking questions on these forums - myself included. Some of us also, me included, then went on to grow up and do software development roles as a living, so yes, people sure so learn a lot from asking questions. 6 hours ago, Veramys said: I don't think SRB is trying to put you down. But rather try to help you see that instead of having all the answers handed to you, without you actually learning anything, you should try to do some research and learn and then ask questions when you get stuck. If you're always asking others to do stuff for you, then you're not going to learn. You'll just make a small attempt and then get others to fix stuff instead of learning to see where your errors are yourself. This summed it up exactly. It wasn't an attack on you or anything, but the simple fact is that you won't ever be successful in the field if you never learn to research yourself. Most developers aren't super intelligent like some people like to believe - we just have an understanding of the syntax and can roughly name most functions. If anyone ever tells you, even after writing PHP for 15+ years, that they know which order all array functions are in - they are lying, and they refer to the manual/documentation. If you can't accept that comment without being annoyed, this probably isn't the right hobby for you because once you put something public, on forums to Git Hub, people will be reviewing it and judging it, regardless of your thread title. Quote
Dustin Rohel Posted August 1, 2023 Author Posted August 1, 2023 2 hours ago, SRB said: A lot of people learned from asking questions on these forums - myself included. Some of us also, me included, then went on to grow up and do software development roles as a living, so yes, people sure so learn a lot from asking questions. This summed it up exactly. It wasn't an attack on you or anything, but the simple fact is that you won't ever be successful in the field if you never learn to research yourself. Most developers aren't super intelligent like some people like to believe - we just have an understanding of the syntax and can roughly name most functions. If anyone ever tells you, even after writing PHP for 15+ years, that they know which order all array functions are in - they are lying, and they refer to the manual/documentation. If you can't accept that comment without being annoyed, this probably isn't the right hobby for you because once you put something public, on forums to Git Hub, people will be reviewing it and judging it, regardless of your thread title. I feel like im being hated on about learning, iv'e stated i have a learning disability and am a slow learner and people still making comments about me not trying, I AM TRYING, i ask lots of questions to find answers and learn, so please.... if you don't like my questions- don't comment on them. Thanks! 4 hours ago, newttster said: Dustin ... you said you were using Notepad. Are you using regular Notepad or Notepad++? I'm using Regular Notepad. Quote
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.