I am trying to make a bit of code so when someone visits my website it logs their public ip onto my server for access for something else. I have this code below This gets the users public ip, however when it checks the txt file is it already exists and if it doesnt to write the ip onto it,
how to remove part of values from array in php
I have an array with date & time like below: From each value, the T10:00 should be cut off, so that my new array looks like this: How can i do that? Answer
JS snippet which is coming as an AJAX response not getting executed
I’ve a php page which returns a full-fledge js snippet when we query that page. Let say that page is get_js.php and looks something like this: The ask here is that the value returned by that get_js.php should be executed on client side when we do an ajax call. The echo string above is just an example an…
Symfony automatic filling a field of my form by a value from database [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed last year. Improve this question I am us…
what is the best way to connect multiple application ( android application, website, and windows application ) to the same database? [closed]
i am building a sqlite database that needed to be accessed and modified from an android app, a website, and a microsoft windows software, in theory and as far as i am aware of, the database could be …
How to start a session and set access levels for users using mysql
I already have a login system ready and 100% working, but now I would like to add access levels when logging in and I have no idea how. In my database, in the table of my logins, there is a column …
Run a PHP file every 5 seconds using Shell Script
I want to run a php file every 5 seconds using Shell Script. But sometimes the script gets run every second or sometimes gets stop running. Do I need to use crontab also? Please help. Answer The best thing would be to configure crontab to keep the execution or another program installed as a service. The probl…
html dropdown not working in wordpress website
i have a website in wordpress, thenter link description here there is a section in the footer of the websiite like in the below image: i want to make this section a dropdown , so i added the …
Laravel custom component parameter parsing issue
In my Laravel (7.x) application. I am trying to create a component for links: Component: And getting this issue: However, if I do this, then it works: I am not a fan of declaring the variables just for single use, I like to pass the value directly. Therefore, I prefer the first method. Why is this simple code…
Laravel update model’s one-to-many relation’s items
I have two Eloquent models: Item’s columns are id, userId and name. When I want to update the user (PUT /users/<id>) I also want to update the items in the same request, meaning: Skip existing items Add new items Remove extra items Afterwards both DB and the relation should have up-to-date items. …