Jessica
Staff Alumni-
Posts
8,968 -
Joined
-
Last visited
-
Days Won
41
Everything posted by Jessica
-
You cannot DELETE column_name. You DELETE a whole row. It's DELETE FROM table ...
-
Trying to make a row field searchable(state location in this case)
Jessica replied to Jdog's topic in PHP Coding Help
Pay the fee. -
No, it's not something you just do, and no it's not simple. Using a library like the one mentioned will make it much easier. Do it right from the beginning.
-
To remove session variables, use unset. To redirect use header('Location: '.$url); die();
-
You'll have to check if you're at login.php before executing that code.
-
Well that looks better but why did you go from GET to POST? Is it working the way you expect? I would also use NULL instead of "" but that's more a style factor.
-
Do you know what a ternary operation is?
-
Add an isset() to the first part of that ternary, then tell us what you think it will do if it "works".
-
Post your code. Post your errors. We don't do it for you.
-
I mean that there are a lot of things wrong with the way you did it. That's a simple statement. Me telling you to go read the manual means... I think you should go read the manual. For one, foreach can be written as foreach($arr AS $key=>$val){} which is a lot simpler than defining an iterator, and incrementing it after each loop. Did you see that part of the manual? If you wanted to reference the original array instead of $nation you could at least use the built in functionality! All of the things you listed that you tried were wrong. Irrelevant to my post. Requinix had already posted the correct way so there's no point in me re-stating it. I never claimed to know everything, so your comments are also irrelevant. I simply don't care whether people think I'm nice or not on this forum, so I don't bend over backwards to kiss the ass of the person asking me (and everyone else) for help. If you're offended that I think you messed up, get used to it. I didn't insult you, I stated the fact that there were a lot of things wrong with it. Read my signature if you don't understand my posts. It explains why I post what I do. If you don't like it, you can ignore my replies, just like I ignore a few people who I don't like.
-
Never run queries in loops. Use a join.
-
Try again. What. Is. $output. Turn on error reporting.
-
*headdesk* there are so many things wrong with that. Please go read the manual on foreach.
-
foreach ($xml->nation as $nation) { echo "nation:".$nation['name']."<hr>"; foreach ($xml->nation->region as $region) { While you define $nation, you don't use it in your next foreach.
-
Because it's out of date and relying on features that should no longer be used. If you don't realize what's wrong with it, you can't make it more secure. That's not an insult, it's just an assessment. And you DO need to better explain the problem. If people are asking you to explain more, you didn't do enough on your part. You haven't listed any steps you've taken to debug it, or the problem would be obvious. I can see a huge problem just looking at it. Which shows me it's an old script. The quotes around variables that don't need to be strings is also a big giveaway that it's crap. Huge hint: what is $output? Unrelated, but I have absolutely no idea what post of mine you are talking about, but I'm not the one asking for help in this thread, not to mention the quote you've posted has nothing to do with the topic of you not debugging the script at all.
-
Now we're all DYING to help you!!! This script is out of date and insecure.
-
-
He has an if, it's just hard to read the code. He's missing the closing bracket on the else, and a ; at the end of a line. And a bunch of other syntax errors I'm sure. Properly formatted it would look more like: <div id = "Test"> <?php do { echo '<a href="AddToCartTest.php?id='.$row_ItemsList['ID'].'">'.$row_ItemsList['ID']; if(isset($_COOKIE['CartID'])){ $CartIDs = $_COOKIE['CartID']; mysql_query("INSERT INTO 'cart' ('User_ID') VALUES ('$CartID')"); }else{ setcookie('CartID', rand()); //missing ; and extra ( ?? wtf. mysql_query("INSERT INTO cart (User_ID) VALUES ('$CartID')"); } // missing } echo '</a>'; } while ($row_ItemsList = mysql_fetch_assoc($ItemsList)); ?>
-
Maybe your CSS was cached. Maybe you made a typo. Since you haven't actually shown that you did it, it's kind of hard to say. CSS can be tricky and a live link is usually helpful.
-
With an array. Don't waste our time. If you have code and you need actual help with a specific part of it, post it and explain what doesn't do what you want it to do, and what you've tried. This "what if I want to do A but then really I mean B and I won't bother to post my real super secret code" stuff is annoying.
-
Well, did it work?
-
Use an array... And don't LIMIT 1.