php

how to make an ajax request after sending data by post?

i meet a problem, when try to make an ajax request after sending data by post. let's assume i have a index.php file. In the form i send data by post to the same file, and after posting i want to make ajax request, but it don't doesn't happen, because it "wants" to ask about resending data, but it doesn't show in popup window. So, how ...

mysql pagination with multiple tables

I have 2 two tables: organisations (id, name) organisationsmeta (id, orgId, metaKey, metaValue) Each organisation can have multiple associated meta rows. I'm using a Left Join right now since there can be organisations without any meta data. How do I construct the query to fetch 10 organisations (with all associated meta data), regard...

How to generate camelized getters and setters in Zend Studio 7 (for Eclipse)?

Example: protected $_labelName = null; Should generate public function getLabelName() { $this->_labelName; } public function setLabelName($labelName) { $this->_labelName = $labelName; return $this; } But it is generates public function get_labelName() { return $this->_labelName; } public function set_labelName($_...

session problem with IE8 in php

Hi, I have a simple code to check counter. session_start(); if(!isset($_SESSION['footerimg']) || empty($_SESSION['footerimg']) ){ $_SESSION['footerimg']='sunset.jpg'; echo $_SESSION['footerimg']; } But all time this is printing "sinsut.jpg" when is page is loading my session is being destroy. This is runni...

Service to allow users to upload large files

I need an app/service I can put on our web server (LAMP) that will allow external (and unauthenticated) users to upload large files (10 MB - 100 MB for now) to our website, instead of trying to email them. If possible, it should be very user-friendly, as it will be used by non-technical users. I don't really want to roll my own, as I'm...

Regex/ code to fix corrupt serialized PHP data.

I have a massive multidimensional array that has been serialised by PHP. It has been stored in MySQL and the data field wasn't large enough... the end has been cut off... I need to extract the data... unserialize wont work... does anyone know of a code that can close all the arrays... recalculate string lengths... it's too much data to d...

RecursiveArrayIterator current array

I am trying to get the whole current array and I don't think I have gone the right way about it as I get an Undefined index error sometimes. $iterator = new RecursiveIteratorIterator(new RecursiveArrayIterator($comments_array), RecursiveIteratorIterator::SELF_FIRST); while ($iterator->valid()) { if ($iterator->hasChildre...

PHP $_POST get data array

I'm trying to do a multiple textbox with the same names. Here is my code. HTML Email 1:<input name="email" type="text"><br> Email 2:<input name="email" type="text"><br> Email 3:<input name="email" type="text"><br> PHP $email = $_POST['email']; echo $email; I wanted to have a results like this: [email protected], [email protected], ...

php mapi extension

I want to install PHP MAPI Extension , am not find find the plugin any where , Please tell me mapi plugin download URL , Thanks ...

Is auto-initialization of multi-dimensional hash array possible in Ruby, as it is in PHP?

I am so used to work in PHP with multi-dimensional arrays, where I can assign and initialize a hash by unset($a); // just to show that there is no variable $a $a['settings']['system']['memory'] = '1 Gb'; $a['settings']['system']['disk space'] = '100 Gb'; Is there a way to do similar thing in Ruby? Or I need to initialize all dimension...

Escaping output safely for both html and input fields

In my web app, users can input text data. This data can be shown to other users, and the original author can also go back and edit their data. I'm looking for the correct way to safely escape this data. I'm only sql sanitizing on the way in, so everything is stored as it reads. Let's say I have "déjà vu" in the database. Or, to be more ...

Cryptography libraries conflict (MCrypt, libgcrypt)

Hello, I'm trying to perform encryption and decryption (Rijndael 256, ecb mode) in two different components: 1. PHP - Server Side (using mcrypt) 2. C + + - Client Side (using gcrypt) I ran into a problem when the client side could not decrypt correctly the encrypted data (made by the server side) so... i checked the: 1. initial vector -...

compare floats in php

I want to compare two floats in php, below is a sample code $a = 0.17; $b = 0.17; if($a == $b ){ echo 'a and b are same'; } else { echo 'a and b are not same'; } In this code it return result of else condition instead of if condition ,even $a and $ b are same. Is there any special way to handle/compare float in php. If yes then ple...

What's your greatest tips when it comes to MVC Framework

Over the past few years I have built several MVC Frameworks and scraped them several MVC Frameworks. Usually I build my frameworks with a startup file which loads the main components (controller/library/input/output/error/configLoader/database model loader) etc. I'm just wondering how you build yours in an attempt for me to discover ne...

Drupal 6: assigning custom Display Output to views_embed_view

Hi friends, $viewName = 'my_view_name'; print views_embed_view($viewName); we have such a cool views_embed_view func. in Drupal to display a view inside another template. But It doesn't get the custom "Display Output" :/ it gets the default. How can I assign my custom Display Output (under Theme: Information) to views_embed_view? A...

PHP check if file locked with flock()?

Will fopen() fail if a file exists, but is currently locked with LOCK_EX? Or do I have to open it, and then try and set a lock, in order to determine if one already exists? I've also read that flock() will; pause [the script] untill you get the lock for indefinite amount of time or till your script times out http://www.php.net...

jquery .post elements created with append

Hi, I have a code with input field, and with clicking on add it adds new input field with new name: /* multiply recepient */ var number = 1; $('a.plus').live('click', function() { number += 1; $('.multiple').append('<p><input type="text" name="recepient_' + number + '"></p>'); }); this works fine. But then I want to post ent...

Running shell script from PHP as different (non root) user

I'm trying to run a shell script owned by a non-privileged user from PHP on an Ubuntu server. Issues with permissions make running it with exec() impractical, as it's www-data that's running it. I've googled a bit and found varius references to suExec (which seems too much of a hassle to get working for such a small problem), setting the...

PHP-Based intranet application Call center

Hi guys, As in title, I am making a PHP-Based intranet application Call center, I've finished the DB design/UI. But now I need to automatically intercept calls and send the caller ID to the PHP webserver so the request is routed to the next free agent while his webpage refreshes with the caller's card(and previous questions maybe). Now,...

Google/YouTube Insight style "Interactive PNGs"?

I have been looking at the YouTube Insight function and want to learn how their chart PNGs are created. If you have a video and look at the statistics, you get a bunch of PNG-images that in many ways can be considered interactive. Look at the image below. As far as I can tell, everything consist of PNG images. I expected to see flash...