Skip to content

Tag: php

PHP – make session expire after X minutes

i am using the following technique… From the login.php the form posts to the page check.php where i do this and on loggedin.php page the first thing i do is but once logged in when i directly type the url localhostmyProjectloggedin.php it displays the page…which makes perfect sense because the ses…

php mkdir() chmod and permissions

i was using this basic script: i create this directory and then upload photos to it. I’ve been doing this for a good 4-5 months now and suddenly i start getting ‘FORBIDDEN’ errors when I attempt to view the contents of the folder via web browser The directory is being created the same and th…

PHP – Debugging Curl

I’d like to see what the post fields in the request are before I send it. (For debugging purposes). The PHP library (class) I am using is already made (not by me), so I am trying to understand it. As far as I can tell, it uses curl_setopt() to set different options like headers and such and then it uses

How do I debug a webhook POST?

A webhook is sending me a POST, and I want to do some debugging on it. Currently I’m looping over the array and then sending a mail() to myself instead of printing (because how could I see what’s …

Adding days to $Date in PHP

I have a date returned as part of a mySQL query in the form 2010-09-17 I would like to set the variables $Date2 to $Date5 as follows: $Date2 = $Date + 1 $Date3 = $Date + 2 etc.. so that it returns 2010-09-18, 2010-09-19 etc… I have tried but this gives me the date BEFORE $Date. What is the correct

How to handle user input of invalid UTF-8 characters

I’m looking for a general strategy/advice on how to handle invalid UTF-8 input from users. Even though my web application uses UTF-8, somehow some users enter invalid characters. This causes errors in PHP’s json_encode() and overall seems like a bad idea to have around. W3C I18N FAQ: Multilingual …