Skip to content

Tag: php

PHP Session Id changes between pages

I have a problem where i am losing the PHP session between 2 pages. The session_start() is included in a file called session-inc.php into every page requiring a session to be set. This works for all pages on the site except one particular page, member-profile.php. When this page is visited a new session with …

PHP: filter_var sanitization secure enough?

I have a PHP script with the following line: Is this safe enough? How would you improve this code? Answer It is safe for that case, but for a more general approach, I’d rather use mysql_real_escape_string in conjunction with type casting: In the worst case, that will result in a 0 and will escape all ma…

regular expressions – same for all languages?

is the regexp the same between languages? for example. if i want to use it in javascript, would i have to search for regexp for javascript specifically. cause i got some cheat sheets. it just says regular expression. i wonder if i could use this on all languages, php, javascript and so on. Answer The basics a…

Images not showing up with https

Suddenly, my images are not showing up on my site when accessing https pages. No change in my code. My host did have to recompile their ftp service with SSL support after my request (so I could ftpes my site). Can’t thing of anything else that would affect my SSL cert. Same thing happens on FF and IE an…