0
I’m having a hard time creating a logic and/or code.
I have a Landing page that I need in a simple way, preferably without using database, run a script once yes and another no.
For example:
- User 1 register: executaScript()
- User 2 sign up: does not execute the script
- User 3 register: executaScript()
- User 4 register: does not execute the script
- User 5 register: executaScript()
- User 6 register: does not execute the script
- User 7 register: executaScript()
- User 8 sign up: does not execute the script
...
I even believe it can be done using a simple database to control with true or false, but I’ve been bumping into logic for some time. Anyone can help?
Can be done in PHP or Vanilla Javascript.
I thought of the same solution.
– bio
Users are registered in a database, but during this registration a pixel is fired to count conversion in the campaign. Then this pixel needs to be fired once yes and once no, regardless of who is registering or when.
– Danilo P. da Silva
So, if there is an auto-increment primary key, you can use the
mysqli_insert_id()
, this will be the user id. This will not work if you use Mysql Transaction because it may have gaps.– Inkeliz