php

FastCGI on IIS7... multiple concurrent requests from same user session?

Caveat: I realize this is potentially a server configuration question, but I thought there might be a programmatic answer, which is why I am posting here... Running PHP on Apache, our users were able to issue multiple concurrent requests (from different tabs in the same browser, for example). Since moving to FastCGI under IIS, this is...

Query returned as Boolean?

Can't figure out whats wrong with this. $replies_sql = "SELECT COUNT(*) AS total FROM forum_posts WHERE forum_posts.thread_id = 1"; I'm trying to calculate the total replies in a specific thread. I am just testing on thread_id 1 at the moment. Error: Warning: mysqli_fetch_assoc() expects paramet...

Synchronize local server and production server

Hello Friends, I am doing a PHP project which is almost completed and uploaded to Production server for Client demo. Since The client is specifying some changes. I am doing that changes in my local server and later upload it to production server. Since some changes will took in more that 1 files its really difficult me to update the Pro...

Dynamic kml google maps

I want to create a google maps app with kml, and i want to create the kml file dynamically depending on the zoom of the user. Something like google earth but in google maps (the zooming part) I tried to use the markermanager and clusterer but i have too many markers and performance on mobile devices is very bad but with kml that is not...

Ensure a PHP script is only ever run as a cron job?

How can I ensure a user can not run a PHP script and that it is only ever run as part of a cron job? ...

PHP closures and implicit global variable scope

Is there a way that one can implicitly declare top-level variables as global for use in closures? For example, if working with code such as this: $a = 0; //A TOP-LEVEL VARIABLE Alpha::create('myAlpha') ->bind(DataSingleton::getInstance() ->query('c') ) ->addBeta('myBeta', function($obj){ $obj->bind(DataSing...

How to Collapse MySQL Rows to Columns Result

There's a query where I want to get the: Username of the user attached to the current opportunity record Sales Stage associated with each opportunity record Dollar amount associated with opportunity record I want to: Take the current IF STATEMENT result, and collapse it Current Query: $sql = "SELECT u.user_name as USER, ...

Invalid cell coordinate phpExcel

Ok I'm dynamically generating the cell coordinates but I get this error, why? Error: Exception: Invalid cell coordinate. in /var/www/test/excel/pe/Classes/PHPExcel/Cell.php on line 490 Call Stack: 0.0003 81132 1. {main}() /var/www/test/excel/createExcelReport.php:0 0.0225 2691000 2. PHPExcel_Worksheet->setCellValue...

How do I use my server as a proxy to download files via PHP?

I need my server to act as a proxy between a 3rd party server (where the file is originally located) and the end user. That is, my server downloads the file from the 3rd party server, and sequentially, the user downloads it from my server. This should result in an incurred bandwidth of twice the file size. How can this process be achieve...

Choosing different versions of Zend Framework to load using Zend_Loader and it's issues

Okay, so, I wanna be able to choose different versions of Zend Framework (and other frameworks) using Zend_Loader. Well, the code isn't tricky at all, but the problem is, there are so many require_once lines in the framework itself that would practically make the autoloader useless. The Zend directory has to be in the include_path whic...

Set server wide enviroment/server variable on IIS 7.5

As a unified way for our applications to detect downtime and server maintenance we'd like to know if there is a way to set a variable that can be set per application pool (or server) and read by PHP and ASP.NET. I know that it's possible to set FastCGI environment variables, but those aren't read by ASP. Any ideas? ...

Really weird behaviour when printing a date with php and drupal

So i'm just trying to print day month and year (not printing actually, i'll compare then with some dates that are in the database, but printing is testing), so my code looks like this: print($now = format_date(time(), "custom", "Ymd")); print(' '); print( substr($now, 0, 4)); //year print(' '); print(substr($now, 4, 6)); /...

Multiple foreach statements in PHP script

Here is my current code: foreach ($swears as $bad_word) $body = str_ireplace($bad_word, "", $body); It's filtering bad words, but I'd like to also filter a ":" to a "-" in the body. How can I have multiple foreach statements in my script? ...

[Doctrine] Query work under Unit tests, not when sent to Doctrine_Pager

I have this relation; Property hasMany Chargerate. Property has column 'default_price'. Chargerate has 'start_date', 'end_date' and 'price' columns. My query is like this: $q = PropertyTable::getInstance()->createQuery('p') ->select('p.*, ROUND(r.price) as cr_price) ->groupBy('p.id') ->leftJoin('p.Chargerate r WITH r.pr...

How to link to database with coordinates to a Google Map

I have a huge database with geo-coordinates like -73.9637,40.7683 + a Google Map which shows some part of our world. Now, how to select all coordinates from my database which fit into the part of the map i can see? (Do i get a range from google? how to work with this range?) ...

SimpleXML: How to find number of children of top-level element?

Hi! How do I find the number of children of the root element in an XML document using PHP and SimpleXML? DLiKS ...

Url rewriting causes Magento admin to become inaccessible

I have magento in a subdirectory in the root and if I set the secure base url and secure base url link to the correct shared ssl url to enable secure pages I have no problem in the FRONTEND. The pages displays as they should. However when I try to access the admin with the secure link below I cannot gain admittance. For instance in the...

Azure php webRole, f# worker role: developping on different machines

Hello, A friend and I would like to do a website to manipulate facebook data. The structure is: a php webrole (contains the webpage, user oauth login, interacts with queues, and interacts with sql azure database) a F# worker role (does statistics and quite heavy data extractions) The process is (assuming a new user): user arrives...

Where can I read about conditionals done with ? and :

Possible Duplicate: Reference - What does this symbol mean in PHP? I've been doing conditionals with if/else or a year or so now. Looking at some new code, I'm seeing a conditional that appears to use ? and : instead of if and else. I'd like to learn more about this but am not sure what to google to find articles explaining ...

sticky form data problem php

Trying out some things with php and html, I'm having issues trying to get all of my form data reposted. I've figured out how to do the text boxes. Still at a loss for the select box, radio and check box. Would I be better off reposting inside the HTML page or letting my include template code take care of it? <html> <head> <meta htt...