Internet Explorer: HTML entities in URL

I have got the following PHP code: echo "<input type='image' src='myImage.png' onClick='javascript:location.href = \"index.php?p=1&copy=true\"' />"; If I klick on the image, Chrome redirects to index.php?p=1&copy=true. But if I klick...
more »

2017-03-19 23:03 (2) Answers

PHP Certificate Authentication

I've been asked to create a data exchange between two servers. The client is hot on security and wants a high security handshake to confirm the identity before proceeding. Their advisor suggested a private / public key certificate to authenticate the...
more »

2017-03-19 23:03 (0) Answers

Get innerHTML from DOM in PHP?

I have a few divs <div class="appname">Name 1</div> <div class="appname">Name 2</div> <div class="appname">Name 3</div> I use DOM and getElementsByClassName('appname') to parse it using PHP. I want to print out ...
more »

2017-03-19 19:03 (0) Answers

PDO: Different results with SQLite BETWEEN

I have a SQLite table with dates in unix timestamp format, which I query via PHP PDO. I'd like to mark the rows according to a date range, in my case whether the date falls in the winter semester or the summer semester of the year. The start and end...
more »

2017-03-19 19:03 (1) Answers

sql join takes a long time to load

Hello fellow programmers. I have an issue with load times when using a join in my SQL query. The two tables that are being joined have roughly 5000 rows each. Any way I can cut the load time on this? Any help would be greatly appreciated! SELECT app...
more »

2017-03-19 19:03 (1) Answers

PHP strtotime wrong only on sundays

Currently I am using the following to get the date of monday and friday of this and next week. $curWeekStart = date('d.m', strtotime('monday this week')); $curWeekEnd = date('d.m', strtotime('friday this week')); $nextWeekStart = date('d.m', strtot...
more »

2017-03-19 18:03 (1) Answers

PHPMailer fails when try to send 2 mails

I'm trying to send 2 different mails at once. 1 email is only text, the other mail with is with an attachment. I tried on 2 different ways to handle this. My first attempt was to have 2 files. One to send a mail to the customer. The other page to se...
more »

2017-03-19 16:03 (0) Answers

cake php 2.9 login method not working

i am new to cake php 2.9 , i have a small issue in login function my codes in view and login controller are as follows public function login() { if($this->request->is('post')) { if($this->Auth->login()) { ...
more »

2017-03-19 15:03 (1) Answers

Comparing date values using if statement in php

I want to compare 2 date values and if it meets the conditions, let it display a particular value. I used the code below, but it's not working. It looks like I am not getting the date comparison well. What i want to achieve is this. If date1 is more...
more »

2017-03-19 14:03 (1) Answers

Facebook sdk with local host-PHP

URL Blocked: This redirect failed because the redirect URI is not whitelisted in the app’s Client OAuth Settings. Make sure Client and Web OAuth Login are on and add all your app domains as Valid OAuth Redirect URIs." I tried writing local hos...
more »

2017-03-19 14:03 (0) Answers

Is this solution enough to block SQL Injections

I made my simple PHP search script, but I'm not sure if this solution is enough to avoid sql injections. The only input I have there is search query input. The thing is, when someone submits my form, javascript have to push % character to the beginn...
more »

2017-03-19 13:03 (2) Answers

preg_replace integer and security

when I want to secure $_GET parameter I usually use: $var = htmlspecialchars(stripslashes(strip_tags(trim($_GET['var']))), ENT_QUOTES); but if the $_GET parameter is only integer (only 0-9 characters) should I use: $var = htmlspecialchars(stripsl...
more »

2017-03-19 10:03 (1) Answers

Error inserting records in Mysql table

I am having errors inserting records into the "shipping_order" table. Nothing is inserted and no error is returned. $randomNumber = $order_id = null; $randomNumber = mt_rand(100, 1000); $order_id = $user_id.$randomNumber; $insert = "INSERT INTO sh...
more »

2017-03-19 09:03 (0) Answers

PHP Mail not delivering to Office 365 emails

This email processor hosted at Godaddy works except for a particular domain name (yyy.com) where the email is hosted at Office 365. When I change the email to me@gmail.com or me@mydomain.com, it works except for this particular domain xxx@yyy.com I...
more »

2017-03-19 08:03 (0) Answers

Multiple image upload

Please see my code below, i'm not getting any errors and this code was working previously, i did change a few things since then but I can't seem to find the issue. many many thanks for any help. As it is, the code doesn't check the format of the f...
more »

2017-03-19 08:03 (0) Answers

How to sanitize checkboxes?

I have googled this, and also searched for an answer here on Stackoverflow. But nothing has really been a clear answer on how to sanitize a checkbox value. I understand that if my input is: <input type="checkbox" value="submit_doors"> That ...
more »

2017-03-19 02:03 (0) Answers

PHP Function two loops from two tables

I've got 2 tables one holds questions and one holds answers. I was wondering if I can grab and echo them through a function. So basically loop through the questions and echo question + answers. Questions +------+-------------------------------+ | q_...
more »

2017-03-19 01:03 (2) Answers