ryantroop 177 Practically a Master Poster

You cannot change a column name on the fly like this.

You're better off making another column and calling it type and flagging it to know what "type" it is.

rproffitt commented: "Oh, SQLfly, You're gonna make your fortune by and by, But if you lose, don't ask no questions why The only game you know is Do or Die" +15
ryantroop 177 Practically a Master Poster

What have you tried?

ryantroop 177 Practically a Master Poster

You're also missing the word "where" before your case. Lastly, comma joins are pretty old and likely will be deprecated at some point...

ryantroop 177 Practically a Master Poster

So.. the problem is your question is very vague. Instead, I will walk you through how to find your answer on your own and hopefully that will help you.

First, you need to understand the basics of how HTML/Form Data work. You can find that here:
https://www.w3schools.com/htmL/html_forms.asp
--Alternatively, if you don't want to do it as a form post and would like to do it as AJAX, you can instead look here:
https://www.w3schools.com/xml/ajax_intro.asp

In either case, you will either wrap your table in a "form" element, and each node of your table will require an input (which holds the value).
If you instead go the AJAX route, you will need to iterate the cells of your table, and create your AJAX parameters through script.
(need help iterating through table cells? try this: https://stackoverflow.com/questions/3065342/how-do-i-iterate-through-table-rows-and-cells-in-javascript)

From there, you send your data off to your server, which requires PHP (which seems to be what you are using to make your table). I will make the assumption that you know the basics based on your code: however, the things you are going to be most interested in with form data / ajax data are:
https://www.w3schools.com/php/php_superglobals.asp
-- Particularly, GET or POST depending on how you decide to send your request (likely a POST, as you want to "save" data, which is the intended use).

From there you will need to use PHP to take the incoming values and use MySQL to save the data …

alan.davies commented: Heh heh, sponsored by w3s are we? +2
ryantroop 177 Practically a Master Poster

You are going to need to learn about AJAX, some server side language to format your JSON to output to the AJAX request, and of course - SQL to write the query that the server side language will process/execute.

A very common free stack is called a LAMP stack, which stands for Linux (the server OS), Apache (the web server), MySQL (database), PHP (server side language / processor) stack. It is common/popular because it's free, and all you need is a host (which, if you look hard enough, you can get for free as well - but if this is sensitive information, or information that you want to keep for future use, you may want to look into a paid hosting solution).

There are other iterations of this: if you are a windows user, there is also a WAMP stack (windows instead of linux) but it tends to cost more.

Of course, there are also other free server side languages to pick from - Ruby on Rails, Python (Flask is common), ASP, NodeJS, etc... but each has their own strengths and weakenesses, as well as learning curves.

And other database options as well: Oracle, TSQL/MSSQL, MongoDB, .... (this list is crazy long, for the most part they are all the "same" but different). As well as the option to go with NoSQL but... meh.

Hope that helps,

Ryan

ryantroop 177 Practically a Master Poster

Yes, that's exactly what I meant.

How are you determining your $per_page_records value?

Edit: actually... since youre using the active='1' in your query, you just wouldn't pull any data if your page values were too high for your limit...

So.. it seems to be a bigger problem than what you are showing in your small bits of code. Somewhere, you are likely forgetting that active='1' flag when pulling the data, or you just have all of them flagged as active, when you think they should have a 0 or 2.

ryantroop 177 Practically a Master Poster

The only "secret" to JS-Less toggles is an input type="checkbox" and use a label to toggle the checkbox's state

from there, you use your css "+" and :checked pseudo selector to modify your visual state

ex:

.myWrapperElement .input[type="checkbox"]
{
  height: 0;
  width: 0;
  overflow: hidden;
  padding: 0;
  margin: 0;
  opacity: 0; //just really really hide the thing
}
input[type="checkbox"] + .myElementThatNeedsStyle
{
  //generic styling
}
input[type="checkbox"]:checked + .myElementThatNeedsStyle
{
  //styling for checked state
}

edit:

if the design itself is your issue, take note that the reason your "toggles" at the bottom break are because you used floats to position them. They are for all rendering purposes, "out of the page flow" and will not look quite right without a relative parent container to contain them. Even then, you will have to do hacky things like put overflow:hidden on the parent to make sure it always encompasses them.

ryantroop 177 Practically a Master Poster

Well.. currently there is a flood of people who put out youtube vids and personal blogs on that sort of stuff... you can write a page that indexes / ranks those tutorials / blogs by allowing users to both post them and vote on their usefulness. You can further categorize by application or makeup company or whatever... Sky's the limit.

Call it something topical like Blush or Accent or something hipstery like that :-P

Since this is for a class, it doesn't really have to be useful to anyone other than you...

ryantroop 177 Practically a Master Poster

.... are you asking what you should reasearch or just some random title?

I mean... no offense here... but you have a problem (you need a title generated).

Solve it (write a title generator).

ryantroop 177 Practically a Master Poster

SO requires a certain amount of "points" to allow replies. It's a community filter. It's annoying. However, as was pointed out with how hostile the internet is in general to everyone, it seems to work for them. It prevents people from tanking their own accounts because it makes it harder to get help when you really need it.

Reddit... it's just noise. If it's not on the front page (or like.. front 3 pages) I don't bother. They have so much churn and reposts that it all gets lost in the noise. It's also not a great place for "help" since it's just a public free for all forum.

I don't use Quora much, most because they have a registration wall to access data in some cases. Honestly, I don't use it enough to know what qualifies as a "public" post vs what you have to be registered for. If I find a Quora response, I tend to overlook it unless I don't have a choice.

DW is a community - SO and Quora are research filters. Reddit is a collection of communities. That's not to say StackExchange doesn't have its own community driving many of the sub Exchanges - but it's not quite as connected and open as say DW is. Within a few months of posting here I knew right away who was likely going to reply to a message, and what quality of an answer I could expect (and that was before I started looking at profiles …

ryantroop 177 Practically a Master Poster

Well.. here's my 2¢

1: Old threads (like.. some are 3+ years old!) being commented on. They need to be locked. A lot of the comments are outdated, spam, or often times not even on point with the rest of the thread. (Granted, this hasn't happened super recently, but there seems to be spurts of it throughout the year).

2: A majority of my time here is spent trying to help others. People just aren't posting things I can help with :-/ (not anyone's fault in particular, just my skill set doesn't cover some things). If there is nothing new for me to address on the first page, I tend to go back to work and that's my break... so.. I guess get more traffic so my breaks can last longer than 20 seconds please? :-D

3: DW doesn't have the name recognition or priority as Stack Overflow, and Im sure that drives a ton of potential traffic away. In general, though, if it's within the first couple spots people will visit just to see what's there. On top of that, SO was designed as a skim-to-find process. Some of the answers here require you to read. I don't mind it. Others who are in a hurry might.

4: The people here are what I find as a huge value over other places. There are 2 things that piss off mods here: Asking for someone to do your homework (which may actually push people away, sadly...) and spam / hate …

ryantroop 177 Practically a Master Poster

So.. first, did you write this?

Are you aware of what "$$" variables do?

(
for those who don't, they make a (scoped?) variable with the "VALUE" as the variable NAME; eg.

$a = "hello";
$$a = "world";

You now have $a = "hello" and $hello = "world"; 
)

I assume, then, that since you are attempting to eval code that is reading the value of the code as a string but is really an array "index" of a hash table that you are making some sort of odd behavior that cannot be resolved.

Which begs the next question - why are you using eval?

You are not being handed a stringified chunk of code that you need to arbitrarily execute on your server (and if you are, that's pretty dangerous). Your else can simply be served with (what I think is) identical behavior as:

else $$rowcf['Variable'] = $rowcf['Value'];

Of course.. YMMV.. I don't often write code that has a side effect of making variables for me. Generally, I find this to be confusing and often damaging behavior in a program. Such as, what if the $rowcf["Variable"] value turns out to be "$_SESSION" and you have now blown away a super global (of course, depending on scope here...)?

From a personal perspective, I would avoid doing what you are doing here and find another solution. However, I don't know your experience level, or if you know exactly why you are doing this. If you do, and you are comfortable …

ryantroop 177 Practically a Master Poster

for PHP and PDF, I have used http://www.fpdf.org/ in the past (pretty sparse and straight forward but gets the job done well).

From that, I found this post on SO which suggested using https://www.setasign.com/products/fpdi/about

Which seems to solve your problem.

hamzamuradkhanh commented: its not my answer +0
JamesCherrill commented: Tried to help. Pity OP didn't appreciate it +15
rproffitt commented: +1 for a good way to tackle the problem. +15
ryantroop 177 Practically a Master Poster

Your local MySQL configuration has port 33061 open? No firewall blocking the connection?

I also doubted the need for the \PDOException but I havent used PDO in quite a while now... that said, the only way you are likely gonna solve this at this point is to echo/vardump after each step and see what you got.

It's possible that if the port or URL is not acceptable/accessible, PHP just hangs and waits and times out.

ryantroop 177 Practically a Master Poster
char caFoo[11]; // 10 characters + null terminator
memset(caFoo, 0, 11); //set all 11 buckets to null for ease of use

start a loop: 
    for (int ilup = 0; ilup < 10; ilup++)
        Generate a random character
            if ilup == 0, make sure it's a cap value, so either keep generating, or modify your generated char from a subset of available chars
            else, caFoo[ilup] = generated char

when this loop is all done, caFoo will have all the characters available to you in the form of a null terminated "string"

you can then std::cout(caFoo); and you can see what is in the buffer.
you can then compare using strcmp(password, caFoo) and if it is equal to 0, then they match, otherwise they don't.

Get into the habit of giving your variables meaningful tips so you know what they are. I used iLup to denote an "int" value, "ca" for character array. There are other standardizations, but pick one and stick with it. When your code gets super long and you have to scan 10,000 lines youll be happier.

ryantroop 177 Practically a Master Poster

How do you expect to compare what the user has entered if you don't keep reference to the password you generated?

I stand by my original comment: start by filling a buffer with your created password, then use that to both output the password as well as compare it to what they input.

ryantroop 177 Practically a Master Poster

I would encourage you to fill a buffer with the user's password first, then display it - and in that local buffer you can do a strcmp.

Just my preferred way of solving your problem.

Otherwise... you have uncompleted code here.. not sure what part of it you need help with since there is no clear thing you want help with (and I'm not sure it works at all the way you intend... so... I don't even know where to begin).

ryantroop 177 Practically a Master Poster

That, sir, is a fantastic question.

My assumption is that the inline cast to a char * is somehow mangling the memory space on the stack, or the assumption of the pointer starts at a negative index to account for the pointer itself...

no idea :-/

That being said.. why not just make a pointer and use it?

rproffitt commented: Good point. Never obfuscate your own code. +15
ryantroop 177 Practically a Master Poster

You can also buy an sms gateway device, or just a phone that allows AT commands. From there it costs however much your local carrier charges per month for access to their network.

Alternatively, every phone number is an email address to their respective carrier. Ex: 555555555@tmomail.net will send an sms to that phone number on the tmobile network. They will not forward, however, by you have to know the network for this method to work.

I short - for commercial or production, there is no good free option at the moment.

ryantroop 177 Practically a Master Poster

So fusion charts requires their data in a specific format. You can choose to parse that data (as they have), or you can write a conversion script to output the format they expect from the data you have.

You gotta do some of this on your own. I get fusionCharts is not the nicest of APIs to work with, but it's not terrible. At the end of the day it's all JSON and javascript primitives (mostly strings cause fusionCharts is just weird like that). As I suggested in another post, use the fiddles to do a bulk of your work (since you start from a working example), and you will start to see patterns in how they want things set up. (also, I noticed you are using AngularJS - in the fiddles you can easily import that to make the data look / work the way you want). Their docs are really only useful, in my opinion, after you play around with the fiddles so you can visualize what they are trying to convey.

I don't use Angular, so if you can rephrase your question about x.IDR and what you are expecting, I can try to help - otherwise, maybe someone with a bit more experience with Angular can chime in.

ryantroop 177 Practically a Master Poster

It's a cool thing to look out for. Thanks for the update :)

ryantroop 177 Practically a Master Poster

Javascript (JS) is a top down JIT. Which means if the DOM element exists before the JS gets called, it will be available for use.

In example 1, your function declaration and call happen before "demo" is available on the DOM (in the body element, however you want to think about it).

In example 2, the element is declared first, and therefore available for JS to use.

In the wild, you will see a lot of websites put code library or include type script at the very bottom of the page for 2 reasons.
1 - you load the HTML and the DOM displays to the user even if there is a network hiccup to the provider (akamai, or whatever)
2 - you are guranteed all elements are rendered and available on the page

That said, the "right" or "javascript" way of doing this is to have a window "onload" handler (window.addEventListener("load", fnYourFunction)) which will fire off all script after the DOM has finished loading and has parsed all elements.

Link for reference: https://developer.mozilla.org/en-US/docs/Web/Events/load

Edit ---

This leads to some of the wonky ways that JS uses DOM elements and references them. For example, in your example #2 you could have just put :

demo.innerHTML = myFunction(4, 3); //dont do this youll make people mad.

because all elements get referenced in the global scope of JS

ryantroop 177 Practically a Master Poster

My first suggestion - stop using a, b, c, and i as variable names. Give them meaning, they will help.

My second suggestion is to consider using a placeholder as a loop helper - just because you are looping though "i" doesn't mean you have to use it for anything other than how many iterations you have gone through.

eg:

int iLup = 0;
int iStep = 1;
int iMax = 200;
int iVal = 1;
for (; iLup < iMax; iLup++)
  {
     if (iStep == 1) //(this can be step "a")
        //concatenate stuff
     else if (iStep == 2) //(this can be step "b")
       //do some math and concat...
     else if (...) //(etc....)

     iStep++;
     if (iStep > 6)
        //do something special here ;)
  }

using std::cout is fine as a buffer... but if you use the method I suggested you are going to have do either do an additional if check to see if iLup == 199 to not append the final comma, or get some magical buffery (yay char arrays!) and build your string into memory before outputting the string. If you do that, rememeber that all "strings" in c/c++ must be null terminated :)

You will probably need to learn about itoa() and strcat_s() and either learn about pointers (to point to the last comma and convert it to null (0)).

Alternatively, you can learn more about the std::string (#include <string>) object and use that instead. Either one should be acceptable for academic work.

ryantroop 177 Practically a Master Poster

The best way I had machine learning explained to me was similar to this:

Lets say you want a computer to identify a color. Lets take "Red", or 255, 0, 0 (or some threshold of).
(NOTE: Of course, what you would write is an algorithm that looks at color and a specific threshold (say... "red") not always "red"... because that would just be silly, right?)

You write an algorithm that looks at pixel data, and returns a 1 or a 0: 1 being "YES! It's RED!" and 0 being "NO!" (or Yes! It's a thing, or no it's not!)

You then "train" your algorithm by giving it lots of variations on the color "RED" to include "Like Red" (again, to some threshold of)
You put this training system into separate computers, all of which take an input (your color) and an output (1 or 0)
You then make a program that takes in your color, sends the color randomly to a random number of these computers, and gives you the weighted average of their deduction of if the value is 1 or 0.

You can, then, make adjustments to how to "train" your machines by either letting them figure out variants on their own (by programming that in by giving it the ability to make assumptions, or some memory/database) or by manually saying "You got it right!" or "You got it wrong!" and giving it guided teaching (which it stores those responses instead of making its own …

Vignesh29 commented: Great info. +0
zeekie22 commented: Really good answer! +0
ryantroop 177 Practically a Master Poster

define "biometric process"

If you are talking about processing a thumbprint or facial recognition, then it's the job of the hardware to give you a usable data representation that you can process in any language. It's likely that the hardware makes certain assumptions and turns physical/analog data into a hash, and then you actually process said hash. If not, and you are getting raw data, then sure - nothing stops php from working on a byte stream.

As pointed out here: https://stackoverflow.com/a/6678359

the PHP string is equivalent to a Java byte array.

rproffitt commented: Good starting question. +15
ryantroop 177 Practically a Master Poster

--> No ram installed yet

Found your problem.

It's likely the BIOS prevents boot/access without RAM installed (otherwise, what's the point, right?)

ryantroop 177 Practically a Master Poster

also, for your file input on the html you may want to look into the accept attribute:

<form action="/action_page.php">
  <input type="file" name="pic" accept="image/*">
  <input type="submit">
</form>

https://www.w3schools.com/tags/att_input_accept.asp

Again, this is meant as a helpful filter, and will not prevent them from changing the type. It also does not limit file size.

ryantroop 177 Practically a Master Poster

If you want to stop it client side (to prevent the form from submitting at all), you can look at the input data's type (which should give you the mime type) and you are looking for "image/" if the mime-type doesn't match, return false from the form (otherwise it will still submit).

If you want to do this server side, this page can be of help -- https://www.saotn.org/validate-mime-types-with-php-fileinfo/
Either look at the file name with a regex (bad), look at the file data directly for the mime type (better), or if you have fileinfo extension, use that for mime type comparison.

please note, client side "validation" is meant to make things easier UX/UI wise for your user - it is always good to validate both client and server side, with a minimum being the server side (otherwise, people can just send trash data at you).

Hope that helps,

Ryan

ryantroop 177 Practically a Master Poster

between lines 49 - 52 you are redeclaring $headers. You need to concat that stuff :) (like what you did on line 50)

ryantroop 177 Practically a Master Poster

You need to escape your slashes in string literals.

'C:\Users\mchalla\PycharmProjects\837_unzip\venv\SampleUnzipFiles\DelimitedFiles'

should be

'C:\\Users\\mchalla\\PycharmProjects\\837_unzip\\venv\\SampleUnzipFiles\\DelimitedFiles'

or, you know.. be consistent and just flag it also as a raw string :-P
r'C:\Users\mchalla\PycharmProjects\837_unzip\venv\SampleUnzipFiles\DelimitedFiles'

The error you are getting is from \U telling Python that the next series of values represents a unicode value (in your case "sers" which, FAIK, converts to the ascii values and then tries to high-bit/low-bit them and errors out).

//More info!
from: https://docs.python.org/3/reference/lexical_analysis.html

Escape sequences only recognized in string literals are:

Escape Sequence Meaning Notes
\N{name} Character named name in the Unicode database (4)
\uxxxx Character with 16-bit hex value xxxx (5)
\Uxxxxxxxx Character with 32-bit hex value xxxxxxxx (6)

so I wasn't far off... it didnt high-bit/low-bit it just straight up tried to convert them to a 32 bit value and puked on itself because it was out of bounds.

ryantroop 177 Practically a Master Poster

TL;DR: Focus first on where your code is stalling requests. Fix them. If you can't possibly change your code, then invest in hardware. Set it up yourself or by someone you trust / hire / contract (and after they do it, learn as much as you can to support it in case they leave or do something wrong, or you ever need to scale again).

Anything is possible. However, once you set up an infrastucture and investment, do you really want some random person who you paid a minimum bid being the one responsible for controlling your network? IMO that's asking for trouble - especially if your site does become very sucessful and you have to scale and are then faced with trying to find someone who had the same frame of mind and expertise as the person who set it up, as well as taking on all security risks associated with random implementations.

A single VPS/Dedicated Server should not be limited to 150 - 200 concurrent requests / sec. The "theoretical" hard limit is ~65,000 requests on TCP (which is what HTTP requests are based on) and seeing how those should be open and closed as fast as possible, you should be able to handle the kind of traffic you are seeing. If you arent, there is likely a code bottleneck somewhere - and when you find it and alleviate it, you can then look at how to best start scaling upward and outward. (NOTE / DISCLAIMER: Im not …

ryantroop 177 Practically a Master Poster

So...

I see your check for existence SQL, and your actual insert... I don't, however, see your attempt to save the file data to the database. Am I misunderstanding your question? The reason it wouldn't be in your database is because you're not even trying to put it in there :-/

Are the images available in the directory you make with $target_file = $target_dir . basename($_FILES["image"]["name"]);

Also, in general, you don't want to put the image data in the database - that's slow, especially for large image files - you should do as you are (move the image to a directory), and in the database keep the path to the image for use later.

ryantroop 177 Practically a Master Poster

First: Have you tried it? Does it do what you expect?

Second: If you're gonna short circuit a process ( if (num === 0) .... ) then do it before the work starts. Why wait until after you try to do work to stop work that is almost done?

Really, there is nothing wrong with your solution - but there are other ways to do what you are trying to do. For starters - you can optimize by starting i = num, and then count backwards with i-- instead of i++. This way you can save a process on the subtraction from num.

Also, your attachment for the onlick is not very "javascript" like. Most people would do oBtn.addEventListener("click", fnPointer); But for your simple case, what you did was fine.

Good job and keep up the good work!

Ryan

ryantroop 177 Practically a Master Poster

JP, uhh... maybe open your own thread on this.. been dead for over 4 years.

The short answer is wat anas.man suggested; Use that, get multiple images in the file input, post to your server and var_dump($_POST) and see what's in there.

ryantroop 177 Practically a Master Poster

So lets be clear - no one is going to do the work for you without compensation - that said, I will try to give you some ideas on how to solve your problem as a "programmer" would.

1 - Identify what you need
    -- Table for Personnel
        -- Either a related table for datetime information for activity or a column in this table for when the user was inserted (mySQL now() function)
    -- a PHP script or mysql stored proceedure that will check if TODAY is >= 6 months from the user's join date (or, just the proc to add them or check eligability or.... so many ways to do this, it depends on the business logic)
    -- a Table for classes/courses
    -- a Table for registered users mapped to courses
    -- Im sure you will need more administrative stuff too...

--------- in short -> this area is where you assess HOW you can solve a problem given your best understanding of data and the problem you are trying to solve.

2 - Start with what you know.
    -- if you know PHP, start there and build the pages to look and function the way you want/expect, and try to keep in mind what your data will look like.
    -- if you know SQL, start with your table structures and data management.
    -- if you only know HTML and CSS, make it pretty, and use them as templates when you get into PHP
    -- .. if you haven't gotten …
ryantroop 177 Practically a Master Poster

is that 150 per second?

If not, then you have something seriously weird happening that is taking a long time to complete. Are these persistent connections (like sockets)?

You also have to consider your hardware and bandwidth (or if there are caps from your provider).

So many things to consider that all come with a cost/benefit analysis...

If you are using a service like GoDaddy, they put hard limits on their VMs, even "dedicated" vm servers. Other services may as well.

Ultimately, if you are going to have this sort of sustained traffic, you may want to see if an AWS or Azure cluster would be more worth your time. That way you get load balancing and global scalability in one (it just comes with a cost that you will have to determine if it's worth it).

If you own the hardware and are serving it yourself, thats where you want to look into load balancers in front of series of web servers, or Akamai or similar to basically do what AWS/Azure would do for you. Otherwise, it might be just as simple as paying a little extra to bump your bandwidth pipe to handle the data.

It all comes down to your particular need and how much you want to invest...

ryantroop 177 Practically a Master Poster

This is what load balancers and cache servers are for.

While I have not set anything up myself, it is my unerstsanding that you have a few options from using a service like Akamai to having a load balancer as your handling server and then pass requests to servers that are not currently under load.

Whatever it is, you're gonna have to invest in infrastructure.

Congrats on the success, and good luck! :)

ryantroop 177 Practically a Master Poster

Well.. lets begin..

First, arrays in most languages (and it looks like you're using PHP, and PHP is one of them) start at 0. So first, $b = 0;

Second, <= 6 is not what you think it's doing. Since we start at 0 (i.e., $count[0]), when you get up to 6 you are doing $count[6], which is out of bounds of your array. So, $b < 6;

After that.. I dunno. Looks fine to me. Im not sure what you mean it 'goes on forever' but I assume you get something you don't expect, and I will also assume that it has a lot to do with the errors in your code.

TL;DR;
for ($b = 0; $b < 6;$b++) { ... }

ryantroop 177 Practically a Master Poster

If you are doing some sort of script that outputs values for an insert, eg...

insert table
(
    a,
    b
) --start script -->
values
(
    1,
    2
),
(
    3,
    4
)....

then your options are likely limited.

Even if that was the case, or you have another setup in mind, if I were to tackle this, I would probably insert into a temp table, then do an insert where I join against my target table excluding the value combinations I don't want.

Otherwise, I may not be understanding what you are trying to do :-/

ryantroop 177 Practically a Master Poster

instead of doing the redirect, do a var_dump on $_SESSION and see whats in there. Then, do the same on index.php as well. Something obviously isnt being set, or carrying over - it may be that headers have been sent before your session begins (but that would cause an error).

It is also possible that isset is giving a false positive:
http://php.net/manual/en/function.isset.php

Since you set the value to "something", even "", it will return a valid value, since it is not NULL. Since you are using empty() earlier in your script, why not apply it here too?

ryantroop 177 Practically a Master Poster

scope is fine, but intent is not clear in my opinion :-/

If you plan to use a variable outside of a loop, it should be declared outside even if null. That way, in the future, some fool who has to read it will understand what you meant to do, and not think "oh, well this is obviously in the wrong place...."

Just my 2c.

ryantroop 177 Practically a Master Poster

https://jsfiddle.net/j5Lrqmxd/

you should be able to modify this to meet your need.

In short, use display: inline-block and vertical-align: middle

ryantroop 177 Practically a Master Poster

I know this was marked fixed already, but if you have the option to skip JS timing all together, you might as well just use CSS and let the hardware / browser do the heavy lifting for you. The transition for opacity is pretty good, and the timing is very easily customizable... You can even attach event handlers to fire when the transition is complete to remove the element (as per your display none, or you can remove it from the DOM completely).

Just an alternative..

Ryan

ryantroop 177 Practically a Master Poster

The explode function does not return a value by reference.

Set the output of the explode to a variable, then pass the variable into the end() function.

ryantroop 177 Practically a Master Poster

Well... the most straight forward way is

let first arr = $aArr;
let second arr = $aArr2;

$aArr[0][1]['user_nicename'] = $aArr2[0][0]['user_nicename'];

However, this is assuming the same data every time... what I can't devise is what your data structure looks like, or how they relate - and if they are all part of the same database, why not just get it from the SQL instead of merging after the fact?

The only way you can really do this is by iterating over everything, finding specific keys (which I don't understand at all how these two arrays match up), and then merging them as the above example shows when finding a matching pair.

ryantroop 177 Practically a Master Poster

Goggle
document.createElement

and

Element.appendChild

You can dynamically build pretty much whatever you want in script.

ryantroop 177 Practically a Master Poster

You arent far off... however, you leave some interesting questions.. such as why use a decimal for a ClientNumber? Doesn't matter, though..

DECLARE 
 @Template_Account decimal(10,0) = 8,
 @Field1 nvarchar(max),
 @Field2 nvarchar(max),
 @Save1 bit,
 @Checkin1 bit,
 @Sandbox1 nvarchar(max)

 SELECT
      @Field1 = Field1,
      @Field2 = Field2,
      @Save1 = Save1,
      @Checkin1 = Checkin1,
      @Sandbox1 = Sandbox1
  from
    cltClients WITH (NOLOCK)
  WHERE 
      ClientNumber = @Template_Account

INSERT INTO cltClients (Field1, Field2, Save1, Checkin1, Sandbox1)
VALUES(@Field1,@Field2,@Save1,@Checkin1,@Sandbox1);

So what I dont understand... why are we insterting the same data into the same table? I get this is pseudo-code... but :-/ I R Confused...

ryantroop 177 Practically a Master Poster

Well... for one, you can not use 3rd party code that has errors.

If that's not an option, you can look to ensure that you are implementing their code appropriately, and including appropriately as to not cause XSS errors.

If that's not an option / isnt' the problem, then start contributing to the projects that have errors and figure out where you can improve their code to reduce or remove those errors.

If that's not an option, then contact them and tell them they have a problem or see if they have a bug sheet that you can search/add to.

Lastly, no. There is nothing you can do.

rproffitt commented: gigo, bibo and maybe a 3rd F.L.A. Losing count of bad sites that don't care. +11
ryantroop 177 Practically a Master Poster

Doing a pure client side (javascript only) captcha will not enhance security. Since all of your code would be visible to the client, even minified, someone could simply bypass it by forcing the output check to "true" or whatever you decide, and move on with their day. No matter how much you obscure it, at the end of the day the method that looks for pass or fail will be directly compromised in the console.

If you are doing this for "fun" or just to see if you can, then start researching canvas elements and see if there is some sort of OCR for javascript. This is a good starting point it seems: https://github.com/antimatter15/ocrad.js/

ryantroop 177 Practically a Master Poster

No, correct syntax is
$query = "INSERT INTO SURVEY (surveyid,q1,q2,q3) VALUES (?,?,?,?), (?,?,?,), (?,?,?,)";