How do I block an IP that shared a Link?

How do I block an IP that shared a Link?
0.0 0

#1

basically just like this, where if you "share (the link)you earn more prices)
it’s in ruby so I hardly know ruby, I know PHP,JS.

I really want to learn that for my clients, pretty sure it would kill the Facebook ad’s campaign using that as the sales funnel on the landing page.

So my question is How do I block an IP using PHP?
(did search it on google but somehow I only found https://perishablepress.com/how-to-block-ip-addresses-with-php/ and other thinks to block spammer instead of getting incoming IP for the link that is share and block it if it is use twice)
is there a site where I can learn how to do or explain how IP blocking works on php?
https://github.com/harrystech/prelaunchr


#2

Looks like they store the IP address in the DB

  create_table "ip_addresses", force: :cascade do |t|
    t.string   "address"
    t.integer  "count"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

So you can check the Db if the ip already exists.


#3

There are a number of ways this can be done.

If you want to block the user, not the IP address specifically (I say this because mom and dad using the same computer will have the same IP but different user accounts, you could use a session. Maybe you don’t want to block dad just because mom already visited the site.

If you want to block the IP of an offender, you could get the IP with $_SERVER['REMOTE_ADDR'] and put it in a database. This can really slow down your site because every time you get a visitor you need to check their IP address, make a database query and return results.

If you’re more specific with what you want to do and why, I can help you build a solution in PHP.


#4

this is so GOOD man, you guy’s are good PEOPLE, hope can bring back the positivity, and the love you give.

I’ll figure this one, thanks again…
and Much love be blessed.

Kevin,