Jump to content

kicken

Gurus
  • Posts

    3,998
  • Joined

  • Last visited

  • Days Won

    121

kicken last won the day on July 26

kicken had the most liked content!

1 Follower

About kicken

Contact Methods

  • Website URL
    http://aoeex.com/

Profile Information

  • Gender
    Male
  • Location
    Bonita, FL
  • Age
    36

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

kicken's Achievements

Prolific Member

Prolific Member (5/5)

587

Reputation

62

Community Answers

  1. There may be conversion processes for specific cases, but there isn't a general conversion process. The docblock annotations where not any kind of standard/official thing, just a popular idea that people copied. Each specific implementation will have it's own requirements when it comes to converting them to an official PHP attribute implementation or vice-versa.
  2. UPDATE / DELETE queries don't have a result set, as such mysqli_query will just return true/false to indicate whether the query was successful or not. There's nothing to fetch so no reason to use mysqli_fetch_array. By returning the result, I mean those methods could have just been: public function deleteCategory($id) { return mysqli_query($this->conn, "DELETE FROM top_categories WHERE top_cat_id=$id"); } mysqli_query will return true or false. Adding the variable and if branch to check if it's true, just to then return true if it is, is entirely unnecessary.
  3. It's been a long time since I compiled PHP, or anything really, but if it's setup to use pkg-config then I presume what you'd do is use PKG_CONFIG_PATH to point to a location for your special version of curl. Something like PKG_CONFIG_PATH=/path/to/curl ./configure --with-curl The actual path you use may be different, it needs to point to the .pc file with the curl configuration information.
  4. Your file should be named with a .php extension, not .html. You need to load the file via the web server, not by just double-clicking on it to open it in windows. Open your browser and load the url http://localhost/index.php
  5. They execute a SQL Query by calling the mysqli_query function. The variable holds the result of whether that query was executed successfully or not (true/false). The variable and if/else statements are unnecessary, they could have just returned the result of mysqli_query directly instead.
  6. It would help if you indented your code properly. Let's look at that area with some better indentation. public function submitPost($body, $user_to){ $body = strip_tags($body);////Removing HTML TAGS $body = mysqli_real_escape_string($this->con, $body); $check_empty = preg_replace('/\s+/', '', $body);//delte all spaces if ($check_empty != ""){ //Current Date and time $date_added = date("Y-m-d H:i:s"); //get username $added_by = $this->user_obj->getUsername(); //if user have not a profile send to the none if ($user_to == $added_by){ $user_to = "none"; } ////insert query $query = mysqli_query($this->con, "INSERT INTO posts VALUES('','$body','$added_by','$user_to','$date_added','no','no','0')"); $retured_id = mysqli_insert_id($this->con); //insert notification //Update post count for user $num_post = $this->user_obj->getNumPosts(); $num_post++; $update_query = mysqli_query($this->con, "UPDATE users SET num_post = '$num_post' WHERE username = '$added_by'"); } public function loadPostsFriends(){ Notice how that last } just before the function is indented? That's because it matches up with your if ($check_empty statement and not your function. You're missing a } somewhere in that function body.
  7. It would seem you've been making too many requests so their server has decided to stop serving you. Wait a while and see if it starts working later.
  8. The suggestion is to use command-line arguments rather than prompts. Doing that makes your script more versatile as you don't need to be there to answer questions when it's run. For example, you'd set it up so you can run say: ./update_nextcloud --backup-current --version 1.0 Using a library such as Commando makes this relatively simple. If you have http wrappers enabled, which they usually are by default, you don't need curl, you can just copy. copy("https://download.nextcloud.com/server/releases/nextcloud-{$version}.zip", "nextcloud.zip"); Also, Calling shell_exec to run cd is a bit silly, just chdir().
  9. add var_dump($buffer, $ary); after your call to explode, maybe it'll shed some light on the situation? Is this code being called multiple times? Maybe the first time it has the data like you expect, but the second time $buffer is an empty string.
  10. Much better. As a testament to how bad it was before I didn't even notice it actually had some header text explaining what the input was for before. I thought it was just a completely unlabeled input and submit button and wondered how the f* such a bad UI was ever released lol.
  11. You can use a UNION to combine two queries into a single result set. SELECT 'movie' as type, id, title as label FROM movies WHERE title like 'blah%' UNION ALL SELECT 'actor' as type, id, name as label FROM actors WHERE name like 'blah%' Each query must return the same number and type of columns. If necessary, you can use literal values / NULL to fill out columns that might be irrelevant in one query or the other.
  12. Some places will try and do that by checking the referrer and denying access if it doesn't exist or match the right domain. It's not going to stop anyone with even the slightest determination from downloading your file though. IMO, it's not worth the effort to even try and do something like that. Basic rule of the web is if the browser needs access to the file, then by necessity the user can also download a copy of that file.
  13. Yes, it's a phone app. You scan a QR code and it saves a secret key which the phone then uses to generate codes that the server can verify. It's an implementation of Time-based One Time Password which a lot of places use for Two-factor authentication. Unlike a lot of google stuff, this information isn't backed up to a google account so if you didn't take steps to back it up and move it to a new phone then you've lost the secret key and will no longer be able to generate the needed codes.
  14. The code it's asking for would be from Google Authenticator. You would have set this up previously at some point and should have an entry in the Google Authenticator app providing the code. If you no longer have the Google Authenticator setup you'd have to use one of the other methods I guess. I got the same screen when going to the page to change my password. Entering the code from my Google Authenticator worked fine. I agree the UI for this is kind of crap though. Maybe some template work could help, dunno how hard that'd be to do.
×
×
  • 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.