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…
Tag: php
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 …
Edit PHP file using another PHP file and add a line on top of it
I have a PHP file that I want to dynamically add lines to it whenever I want. Let’s say I have foo.php which has these inside it: but I want to be able to add a line I specify in another file as a variable to be added on top of it and save the old content as well, to
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…
OAuth2 token, message: ‘{ “error” : “access_denied” }’ returned when I try to update Google Calendar using OAuth (Service Account)
I am using Google Standard Library for PHP for using Calendar Service and I have set up a Service Account type for OAuth 2.0 Authentication through Google API Console. My main objective is to update …
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…
Object-Relational Mapping vs Database Abstraction Layer
I’m using Doctrine which provides both ORM and DBAL. What is difference between them? How should one decide when to use which?
$_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”…