Jump to content

omegatroller

New Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by omegatroller

  1. I have made a website (https://sokk.ga/), and I want to log the users public ip whenever he/she clicks one of the links, and then redirect him/her to the correct url. It's supposed to be a little php "script" between the main page and clicked link. The problem i face is that it shows the php code as plain text in the browser (chrome), no redirect or log. Here's my attempt: <php? date_default_timezone_set("Norway/Oslo"); $ipFile = fopen("../logg/ip.txt"); $ipText = time("Y.m.d" + "-" + "H:i:s") + "-" + $_SERVER['REMOTE_ADDR'] + "\n"; fwrite("$ipText", $ipFile); fclose("../logg/ip.txt"); exit; header("https://sokk.ga/skole/"); ?>
×
×
  • 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.