Skip to content

Tag: php

Secure image upload in php

I am making an image upload function which I can re-use in my code, which has to be 100% secure. Please tell me if you can spot and security holes in my initial code; UPDATE This is how far I’ve gotten with your help and some research, please tell me what you think. I don’t mind much about the spe…

PHP Check if variable is contained in an array

I have a numeric variable $i. This is a while loop, and $i increments after each iteration. How can a conditional statement be made as to not be necessary to write such a long statement if($i == 1 || $i == 2 || $i == 25 […])? Thanks in advance! Answer Use php in_array.

jQuery not working when I echo it from PHP

I need only some js to run during some parts of a php script, for testing purposes I commented out the php so I am not going to show it here. The line I have labeled 1B works fine, the background image displays. The section labeled not working seems to have no effect but when I run it separately in