Jump to content
#StayAtHome ×


  • Content Count

  • Joined

  • Last visited

Community Reputation

1 Neutral

About cutielou22

  • Rank
    Regular Member
  • Birthday 07/22/1993

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location
  • Interests
    Programming, music, games, tv.

Recent Profile Visitors

1,909 profile views
  1. I never had this problem before though. I don't know what started it. Not sure what I changed to effect it.
  2. Your form inputs do need the name="name" and name="email" added for your $_POSTS. Also, this is just to educate me. Why did you add a "@" in front of the mail()? I looked it up and I couldn't find anything telling me what this means. Thanks!
  3. Okay . . . . but do you know why I am getting this error or what I can do to fix it (besides switching my entire site to ajax)? It also sometimes throws in a 406 Not Acceptable The server cannot send data in a format requested.
  4. For example, if they just won a game and received a trophy for it. It takes them to a page to update the database with the trophy they just won and perhaps their score. It then redirects immediately back to the game in a die(header(Location: link.com/here.php?note=You+won+a+trophy.+<img src=trophylink.png>)).
  5. I want it show something like "You found this *item here*." and have it show a picture with it - without the page messing with my layout. Is that bad or something?
  6. Here is a example link: https://site.com/this_here/page.php?note=W+srchttp:>e+have+some+text+here. That shows up fine like it is supposed to, but when I want a image to show up with in it - in html - it makes the whole page wonky. Example Problem: https://site.com/this_here/page.php?note=We+have+some+text+here.+<img src=imagelink.png> I have it on any page that is now set to show an image link that. I used to not have problems with this and now I do. The 'note' text comes from a $_GET and is not decoded or anything - which you shouldn't do I know. I tested by taking out one "<" thinking that was the problem. And that made it so the page wasnt wonky but then you know just the text appeared. I also tested leaving in both "<>" from the img tag and taking out the "=". That also makes it so the page isnt wonky anymore. Does just the same as taking out a "<>". This seems like a really weird error to me, but maybe there is something I should or shouldn't be doing that I am not thinking of.
  7. cutielou22


    It is working now. No errors. Kept the global $mysqli; And I got rid of the owner part - like you said no where that is stated. Thank you so much guys! Sorry if I was a pain the butt. I really wasn't trying to be. Thanks again.
  8. cutielou22


    I added global $mysqli; to the function directly under the "include_once "addon.inc.php";" Now no errors come up, but still nothing happens.
  9. cutielou22


    Okay. Gotcha. I added the below. error_reporting(E_ALL); // Report all errors Now 2 errors come up. So you guys are right. But what would cause the $mysqli error? Just a duplicate like said above? Even though I inserted my database connection directly in the function and renamed it and that didn't work either. Glad I am kind of getting somewhere though. Notice: Undefined variable: mysqli in /home3/solpetsc/public_html/funcs.inc.php on line 525Fatal error: Call to a member function prepare() on a non-object in /home3/solpetsc/public_html/funcs.inc.php on line 525
  10. cutielou22


    Taking out the part after the "AND " still creates the same "Fatal error: Call to a member function prepare() on a non-object in /home3/solpetsc/public_html/funcs.inc.php on line 522" error.
  11. cutielou22


    Here is the whole error: Fatal error: Call to a member function prepare() on a non-object in /home3/solpetsc/public_html/funcs.inc.php on line 522 It's this whole function: I did no edits so you can see my tests. I would post the page I am using the function on where it is not working. But it is not working on any of them. Also the error is showing up now without the below - or die code. I did used to get a error about the " AND `owner` = ?" part. Not sure how I was getting that error - cannot reproduce it now to get EXACTLY what it said, but it was talking about a nonobject and the " AND `owner` = ?" part. Switching the petid and owner order still caused the "AND . . . " problem. function gain_experience($gain_this_much, $grab_pet_id){ include_once "addon.inc.php"; //include "addon.inc.php"; //if(!$mysqli->query("UPDATE `userpets` SET `experience` = experience + $gain_this_much WHERE `owner` = '$userid' AND `petid` = '$grab_pet_id'") or die(mysqli_error($mysqli))){ $exper = $mysqli->prepare("UPDATE `userpets` SET `experience` = `experience` + ? WHERE `petid` = ? AND `owner` = ?"); //or die($mysqli->error . mysqli_error($mysqli)); $exper->bind_param('iss', $gain_this_much, $grab_pet_id, $userid); $exper->execute(); $exper->store_result(); //var_dump($mysqli); $exper->fetch(); $exper->close(); //die("Error description: " . mysqli_error($mysqli)); //} //////////////////// CHECK IF NEED LEVEL UPGRADE //////////////////// $stmt = $mysqli->prepare("SELECT level, experience FROM `userpets` WHERE owner = ? AND petid = ? LIMIT 1"); $stmt->bind_param('ss', $userid, $grab_pet_id); $stmt->execute(); $stmt->store_result(); $stmt->bind_result($current_level, $new_experience); $stmt->fetch(); $stmt->close(); $current_levelm = $current_level - 1; $current_levelp = $current_level + 1; $check_experience = $current_level * 100; if (($new_experience >= $check_experience) && ($current_level > $current_levelm) && ($current_level < $current_levelp)) { $stmt3 = $mysqli->prepare("UPDATE `userpets` SET level=level+1 WHERE owner = ? AND petid = ?"); $stmt3->bind_param('ss', $userid, $grab_pet_id); $stmt3->execute(); $stmt3->store_result(); $stmt3->fetch(); $stmt3->close(); } //return 1; }
  12. cutielou22


    Even going in and adding the connection directly to the page instead of the include gives same error.
  13. cutielou22


    Yes I have. On another page but I have it in a php include. Not sure if this helps, but it is something I noticed and tested. If I use include() it gives no errors, but if I use require_one() or include_once() that's when it shows the error. (for the file with the connection)
  14. cutielou22


    $exper = $mysqli->prepare("UPDATE `userpets` SET `experience` = experience + ? WHERE `petid` = ? AND `owner` = ?") or die($mysqli->error . mysqli_error($mysqli)); $exper->bind_param('iss', $gain_this_much, $grab_pet_id, $userid); $exper->execute(); $exper->store_result(); //var_dump($mysqli); $exper->fetch(); $exper->close(); The code below gives me the error : "Fatal error: Call to a member function prepare() on a non-object . . . . " However there is no non-object. I use the EXACT SAME code on another page and no error. Updates correctly on other page also just not on this one page where it gives this error. Anyways to fix this? ALL ideas are welcome. I have tried query also. No luck. Does anyone know why this happens? I had this happen before , but I don't remember what I did to fix it. I know it was simple. Thanks in advance.
  15. I just fixed it! I knew it was going to be a tiny problem. Thank you guys for helping me. How I Fixed It: I been putting the $battleid in my url so I can see it. I just assumed as long as it was showing it would be the right one. Then just a little bit ago I did another test and noticed that the $battleid should be higher than that. So I have the correct one showing on another page - so I checked to see if it matched or if this may be the error I am looking for! It was the error I was looking for. The problem was I was grabbing the wrong $battleid (which did not need to be updated so it wasn't - makes sense right?!). Man, I feel stupid and so relieved at the same time. So ALWAYS do a double triple check for your SELECT mysql. x) Thanks guys for your time though. I really do appreciate it.
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.