Jump to content

kicken

Gurus
  • Content Count

    3,844
  • Joined

  • Last visited

  • Days Won

    110

kicken last won the day on September 8

kicken had the most liked content!

Community Reputation

559 Excellent

1 Follower

About kicken

  • Rank
    Wiser? Not exactly.

Contact Methods

  • Website URL
    http://aoeex.com/

Profile Information

  • Gender
    Male
  • Location
    Bonita, FL
  • Age
    33

Recent Profile Visitors

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

  1. Your starting array is in a strange format. You have your outer array with 3 sub-array lists. Each element in that sub-list is then a single-item array with an index matching it's parent index. I'd probably see if that can be cleaned up and better organized first if possible. The code would end up cleaner and easier to understand if you could remove one or two of those levels. It seems like you could probably just form one single list instead of the nested setup you have now. For example: array ( 0 => array ( 'dataAula' => '2020-09-21', 'tempos' =&g
  2. Yes, I did this year ago also just like you. As I said though, this is something that has never been officially supported in any way, nor has it ever been reliable. I understand what you want. You want your loading gif to appear immediately and then your script continue and outputting updates as it goes. Whether that will work or not depends on a lot of things outside of PHP's control so it's not something you can rely on. The proper way to do something like that is to load a simple page first, then use javascript to update it over time. This will probably require re-working your
  3. You're attempting to do something that's always been a fundamentally flawed idea. That fact that it may have worked before comes down mostly to luck/implementation details and not because if was ever an officially supported feature. ob_flush/flush does still make PHP send it's output. The problem (then and now) is that there might be other buffers in the chain that PHP has no way to control such as you web-server's buffer, a caching proxy server buffer, the browser's buffer, etc. If you want some kind of a loading animation for your page, you need to output a page that's just your
  4. The delimiters don't matter really, though by using # you could skip escaping the / in the expression. Normally I'd probably use something other than / as well in a situation like this just to avoid that escape, but I was to lazy to change them on the website. You need the start and end of string anchors though if you want to enforce the value strictly. Without them it just looks for the pattern somewhere in the string, not that the string is exactly that pattern. So your regex would also match if: $_POST['ay'] = 'I want to attend in the (2020/21) academic year';
  5. If you want the entire string to be in that format, you need to use the start (^) and end ($) anchors and put your pattern in between. Your regex currently also only looks for digits and /, but they can be in any order. If you want to enforce that strict format you need to look 4 digits followed by a slash followed by 2 more digits. Given the above, you end up with a regex such as /^\(\d{4}\/\d{2}\)$/
  6. When you're trying to re-create a flow, the best thing to do generally is to use either the browsers developer tools or something like fiddler to monitor what exactly the requests being made are, then figure out how to re-create those requests. Sometimes it's as simple as loading a URL, other times it's more complicated and involves parsing the previous pages source for various details. The process is something you general have to figure out on a case-by-case basis so it'll be difficult for anyone to really guide you without at lot of details.
  7. Trying to run your other script with shell_exec just introduces unnecessary complexity to the problem. Since your script is just another PHP script (and a simple one at that) then you can just include() it to run it. if (isset($_POST['clearflags'])){ include 'clearflags.php'; } You shouldn't be messing with the shell functions unless you need to run some external non-php program or some other php application that's intended to be run standalone from the command like (ie, composer).
  8. Perhaps if you check the manual, you can find the function you need.
  9. Undefined index (as specified in your title) refers specifically to array indexes, not variables in general so code like you posted wouldn't really help any. The common scenario where you encounter this is with the input arrays $_POST, $_GET, etc as what they contain depends on the request. Since you can't be certain whether a given key exists in those arrays, you should always be checking for it and providing a sensible fall-back value if it doesn't. With PHP 7 this has been made easy by using the null coalesce operator. In older versions you'd have to use isset() to check. Ther
  10. When I started out with PHP I'd always use a simple PHP array in a file and include that file, as demonstrated above. This is very simple and easy to use. One thing that can be both a benefit and a detriment of this is that the configuration is PHP code. One the plus side, you can use the code to do some fancy stuff. On the down side, allowing code to run in the configuration could cause problems. Typos for example could cause the whole application to break. As with most people, I eventually moved toward JSON for my configuration files. The format works well for simple data and is
  11. I don't think it is possible. I can't see how the code would possibly work in production either if it's trying to declare a class twice. Only thing I can think of is the problem was fixed but that fix didn't make it into the version you have. One way to try and deal with it while still being able to track you changes reasonably well would be to create a branch that has all the changes needed just to get the application working. Then create a new branch from that to do your debugging on. When done you can diff the two branches.
  12. I showed you everything you need to know to figure out it out my first post. I showed you how you can replace t3_home with a variable called key. I showed you how you can construct a variable named key from some strings and another variable containing a number. Put those together and you have your answer for how to add your x variable into that command. You can then extrapolate from that and figure out how to make your home part into a variable also.
  13. The query just asks the database for information matching your criteria. After you run the query you need to fetch the data to make use of it. If nothing matches your criteria, you'll know because your attempt to fetch the data will return false instead of usable data.
  14. So make it a variable also and concatenate it as well just like was done with the 3.
  15. Javascript allows an object's properties to be accessed using array notation as well, so you can use either document.freeone.t3_home or document.freeone['t3_home'] to access the t3_home property. Array notation allows the use of variables as the index value, so you can do something like this: var key = 't3_home'; document.freeone[key].value = 'close'; Now all you have to do is construct the appropriate value for the key variable, which can be done using simple concatenation. var x = 3; var key = 't'+x+'_home';
×
×
  • 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.