Skip to content

Tag: php

File upload PHP JPG issues

I’m getting confused while working with an file upload HTML form and some PHP to handle the input. In the form i have two file selects for images. When uploading an .png file i can get the file size etc using $_FILES. But when i’m trying to upload an .jpg file, i can’t get more then the file…

How can I prevent javascript code theft?

Actually I’m developing a Chrome extension and a jQuery plugin to upload it and sell it on Codecanyon. When I “Inspect source” of the page and I click on the “Resources” tab, the javascript file looks empty. How does Codecanyon do that? I want to have file theft prevention in my …

loading a view after an ajax call, CodeIgniter

I have an ajax call from javascript to a method in a controller, the method in the controller should be loading a view(like, show a new page on the screen), Although everything seems ok, the new view doesn’t seem to load on the screen. I cannot use header or windows.location because, i am passing an arr…

Best way to INSERT many values in mysqli?

I’m looking for a SQL-injection-secure technique to insert a lot of rows (ca. 2000) at once with PHP and MySQLi. I have an array with all the values that have to be include. Currently I’m doing that: I tried call_user_func_array(), but it caused a stack overflow. What is a faster method to do this…

$_POST is empty after form submit

I am using Twitter Bootstrap to build a web application. I have a form where user should enter his name and last name and click submit. The problem is, that the $_POST comes back empty. I am using WAMP on Windows 8 machine. Thanks in advance Answer Add names to the input types like Now check the $_POST variab…

Loading Doctrine entities in postLoad

I have an entity which implements a postLoad lifecycle event method. This method conditionally updates the entity and attempts to save it. Something along the lines of: However, I’m receiving the following error: It seems I’m unable to save an entity during postLoad. I stumbled across this ticket …

Json Parsing and inserting to mysql

I am using the the Mandrill to post any inbound emails. Here is what is posted by Mandrill when i receive a new email -> http://help.mandrill.com/entries/22092308-What-is-the-format-of-inbound-email-webhooks- Also here is what i get in the $_REQUEST (sorry that its not formatted well): [{“event&#8221…