ManiacDan
Staff Alumni-
Posts
2,604 -
Joined
-
Last visited
-
Days Won
10
Everything posted by ManiacDan
-
"Trebuchet MS" is a Microsoft proprietary font, hence the "MS" in the name. Linux doesn't have a trebuchet variant. Linux users are used to this, however.
-
Oh PHP, why don't you work the way you should. isset() should be called Issetandnotnull() if that's the case.
-
Wow, I had no idea the default was GET. I've never actually left METHOD off my forms, but I assumed it would be POST, since that's generally the purpose of forms. Good to know. As for invalid tags, 7 of the top 10 websites in the world aren't compliant with the HTML spec. Nobody cares. "Working" and "matches the RFC" are so far from each other that it's sad.
-
Wait...why would you limit your web page to less than HALF of most new monitor widths? Both my monitors are more than 2000px across. Set the margins to auto and let the site stretch across the whole monitor. That's how this site works.
-
All you have is 4 database columns and zero knowledge of PHP? Ask your professor/TA for help. Yes, creating an object tree and implementing pre-order recursion (possibly followed by in-order recursion) would give you a good knowledge of PHP, that's why it was week 14 in my CompSci 101 course. You need a lot more base for this.
-
Bad news: setting a variable to NULL doesn't set it, it unsets it: php > $a = null; php > if ( isset($a) ) echo "A IS SET\n"; php > $a = ''; php > if ( isset($a) ) echo "A IS SET\n"; A IS SET php > unset($a); php > if ( isset($a) ) echo "A IS SET\n"; php > $a = "abc"; php > if ( isset($a) ) echo "A IS SET\n"; A IS SET php > $a = null; php > if ( isset($a) ) echo "A IS SET\n"; php >
-
The form's METHOD is either POST or GET. The ACTION is where the form goes. Action is allowed to be blank, it will default to the current URL. Method defaults to POST. Take out the enctype, and if that doesn't work add this to the top of your script: print_r($_POST); What is the result? Maybe your webserver is translating post data somehow. -Dan
-
This can easily be done with a pre-order recursive function, passing the multiplier back up from the children to be used when printing the parents. Google for pre-order recursion. Also, what demented professor uses MLM schemes as teaching material? I hope he told you that they're both evil and illegal.
-
oops, forgot the quotes.. Your solution also would have thrown an error if the row wasn't set. The actual solution is probably: if (!isset($row['image_zero']) || empty($row['image_zero'])) That depends on what $row is though. If it's a db query row, it's probably always SET.
-
Both sets of code are incorrect: if (isset($row['image_zero'])) Array keys need to be quoted (like all strings). You're clearly working with error-reporting turned off otherwise you would have seen this error. For all we know, $row isn't even an array. -Dan
-
Using the API
-
Are you asking how to implement your own translation service equivalent to the translation service created by a trillion-dollar company with more than 5,000 years of formal computer science education between its employees? You absolutely cannot write your own version of google translated. Never, ever. Every single person on this message board, working together, couldn't do it in less than a decade. Google translate's algorithm is so incredible that it recently was able to automatically crack a secret document more than 150 years old. As depressing and annoying and the answer may be, it remains: No, you can't do that. You're not smart enough. None of us are. If you want to implement a translation service these are your options: 1) Purchase a dictionary application to do word-for-word translations, which are often incorrect. 2) Write your own word-for-word dictionary application. This isn't incredibly difficult, but how do you do a proper translation of words with multiple meanings? The English word "run" has nearly 400 official definitions. Which Hindi word will you choose to represent it? 3) Run everything through google.
-
Is there any way you can change the input format so the date is in the proper format (YYYY-MM-DD)? If you do, then string sorting will work just fine. If not, you'll have to pre-process this list so that the date is in that proper format (using explode or substr) and then re-create it into a sortable format (either a timestamp or YYYY-MM-DD). -Dan
-
DevShed's reputation system is very similar, but the more times you're "thanked" the more points your "thanks" are worth, so someone like Requinix can dump 5,000 points on someone, but a new user can only give 1. It's a bit unbalanced, actually, and the ability to give "disrespect" in addition to "respect" gets the system abused. I'd like it a lot more if it were policed, but sadly there's no way to police it since it's really kind of a crappy add-on.
-
I would assume he means a reputation system or a separate points system. I'm a mod over at DevShed as well, and we have three separate points systems.
-
JavaScript and PHP are separate languages.
-
Why are you constantly opening and closing PHP tags like this? You're not using MySQL result sets properly. The output you're getting is probably something like "Resource ID #15." This is a very basic error that stems from you not reading ALL of the MySQL manual pages in the PHP manual. Basic usage examples are here.
-
Oh I didn't read properly. ASP core is being loaded, but includes aren't working at the document level. Maybe your document root changed. Check using something like firebug to see where exactly it's trying to fetch the files from. Visit those files directly to see what errors you're getting. It's possible that you "backed out" one directory so where you had "css/site.css" before maybe now you need "aspsite/css/site.css". -Dan
-
That error (which is easily googled) tells you that $data is not what you expect it to be. In your case, it's probably null since I see this block: if (!isset($_GET['id'])) { $query = "SELECT * FROM ncmr WHERE id = '" . $_SESSION['id'] . "'"; } else { $query = "SELECT * FROM ncmr WHERE id = '" . $_GET['id'] . "'"; $data = mysqli_query($dbc, $query); } If $_GET['id'] isn't set, $data never gets populated.
-
Congratulations, you failed to follow very basic instructions on how to debug. See where I said we won't keep guessing? Guess what happens now.
-
do this: echo "<pre>" . print_r($_POST,1) . "</pre>"; That will show you what the actual contents of $_POST are, including any nested arrays. Work from there. We can't keep guessing at what the proper structure of your code is without knowing what's coming into post. -Dan
-
Another indicator of you not wanting to learn (and the reason why I have not and probably will not reply to your most recent question) is because you consistently use the wrong words. You remind me of the people who insist that their screensaver is the thing behind their desktop icons. It is absolutely imperative that you use the right words when you describe something. Your most recent post, as worded, is completely meaningless. Line by line... Posted at a certain value? I assume you mean that if you put a specific value into the form field and submitted it then...wait a minute Nope, not at all what you said or implied. This is called an assignment, not a post. Forms do not contain variables. Variables do not post to the database. You post data to a web server, more specifically to a specific script. You cannot post a value to a variable name. "Setting the text field" has no meaning that I can discern, and at this point in your post I'm already assuming that you know so little about the terminology that I can never know what you actually mean. NONE of the code you've posted (none, zero) has been validation based. It's all conditional display logic. This run-on sentence contains a completely meaningless parenthetical. Set text field HTML? What? No such thing exists. You also assume something has not been posted to PHP, yet you could...include it in the code? All PHP is PHP/HTML wrapped together, in some way. This site you're looking at is a mix of PHP and HTML, though a lot more tightly controlled than your site. I doubt that you've actually made it to the end of this site. The errors you're describing stem from fundamental misunderstandings and a lack of error control (which I'll go ahead and point out for what is now the third time: turn on error_reporting). Debugging a PHP script is easy. Echo the values you're comparing to see if they are what you expect. The IF condition absolutely works properly, the problem is your variables. They are not what you expect. You have not yet followed any instructions about error reporting or printing your variables, so there is nothing more we can do for you. As a lawyer (which doesn't impress us btw) you should be painfully aware of how difficult it is to talk to someone who doesn't know the proper terminology and who wants your professional help without bothering to actually do everything you said or use the proper words. I'll leave you with a hypothetical conversation between you and someone asking you for pro bono advice: Someone: So then they told me I wasn't allowed to talk during the movies, don't they know this is America and I have freedom of speech!? You: Well that's not what freedom of speech protects you from, did you file a complaint with the management? Someone: I don't think that would help, since it was in the mall. Seriously, I just want them arrested for fraud. You: You're not even listening to me. Nothing you just said made sense. Someone: YOU ARE A JERK I'M NOT A LAWYER I JUST WANT HELP
-
1) You're not returning, you're echoing 2) A semicolon is not a colon 3) You are not echoing the variables you're comparing so you can't be certain the conditions are or aren't being met. 4) You're using $_POST and $recordset4 in the same line, maybe you're confused about which is which? 5) You most likely have error_reporting turned off. Turn it on in PHP.ini (and restart the server) to get actual error reports which may help you debug.