php5

Creating a var from data created by another class

Hi Guys, I am having problems creating a variable with data from another class. Here is what I am doing... Please let me know you think. <?PHP class Customers extends Controller { private $foo = $this->session->userdata('foo'); } Thanks, Peter ...

Fatal error: Class 'ZipArchive' not found

I tried to unzip a zip file in my server using this code but doesn't work in my server <?php $zip = new ZipArchive; $res = $zip->open('Dolphin.zip'); if ($res === TRUE) { $zip->extractTo('dolphin/'); $zip->close(); echo 'ok'; } else { echo 'failed'; } ?> but im getting th...

Google Maps - maintain current position and zoom when reloading dynamic map pointers

I have been searching high and low for a solution to this problem. I fetch dynamic positions of markers and show the map positioned and zoomed baased on the City that has been selected in my application. If I then scroll or zooom the Google map and then request an update of the markers position (by fetching the xml) I loose the new posit...

open id or single sign on like stackoverflow

Hello friends, I m very impressed with the idea of stackoverflow, the way they provide the options to login to the users is very easy for any user. And if I have to do the same thing in my website then how its going to be. what will be the coding structure and coding snippets for the same in php , mysql and javascript (ajax). http:...

How can I select like this using mysql query?

Hi I have two different tables containing lot of images. I need to display 50 random images from both tables. How can I do like that. How can I select random images using MySQL? or if I select 100 images from both tables. How can I choose 50 random images from that array using php? any body knows the solution please help me. ...

Replace all special characters from a string using PHP

Hi, I am using jQuery editor with PHP it works fine for plane text (text with out special characters) but if I try to post text which contain special characters then it does not store these special characters in to db table.. and when I tried to replace any special character with HTML codes it works fine. But it is too difficult to repla...

php5-fpm doesn't work with php-apc on ubuntu 10.10

Packages php5-fpm and php-apc installed from ubuntu 10.10 official repo. APC configuration: /etc/php5/conf.d/apc.ini extension=apc.so apc.enabled=1 apc.shm_size=128M Afret php5-fpm restart: Fatal error: Call to undefined function apc_exists() in /var/www/.../application/models/user_model.php on line 271 phpinfo(); says apc module ...

PHP Frontcontroller

I dont't want to use any framework, but I need a Frontcontroller, Where I can get HELP Thanks. ...

Having actions/pages without requiring a login

Hello, I am building an application using cakePHP. Do we have a method where we can allow public users access to certain pages without logging in. There would be a few pages such as about us regarding the whole organisation or a contact us page. Is there a method to avoid login access, something similar to how we have ways to add compone...

convert python request to PHP-cURL equivalent

I am sending a POST request to a URL. It works correctly in python but in php-curl, I always get a bad request error (i.e. my POST data is not as expected by the server) Python code: (works correctly. 200 OK) import httplib, urllib, json def SendRequest(param1): url = "api.xyz.com" body = {"version": "1.0", "data":[{"param1":p...

$_POST is empty in php

I have gone through all the responses in this post print_r($_POST); ===> returns empty array print_r($_SERVER); Array ( [HTTP_HOST] => localhost [HTTP_ACCEPT] => */* **[HTTP__CONTENT_TYPE]** => application/json; charset=UTF-8" [CONTENT_LENGTH] => 942 **[CONTENT_TYPE]** => application/x-www-form-urlenc...

dynamic function arguments

I'm passing all my calls to a main mapping function and then it should dynamically call other function based on a string (until this part, things are easy) the problem is that I want to pass arguments to the second function and these parameters may vary. The following is given (should not be changed): function test1($x){ echo $x; ...

Install APC on PHP For Windows 7 x64

When I try to start Apache with [PHP_APC] extension = php_apc.dll [apc] apc.shm_segments=1 apc.optimization=0 apc.shm_size=128 apc.ttl=7200 apc.user_ttl=7200 apc.num_files_hint=1024 apc.mmap_file_mask=/tmp/apc.XXXXXX apc.enable_cli=1 in php.ini, it fails. I have the php_apc.dll in the ext directory. Using Apache 2.2.17 and PHP ...

How many ways does PHP have to open a URL with POST data?

I'm writing a PHP error collection widget that collects errors from an application and then by making a POST request to a URL, reports them. How many different ways to do this are there, and how would you detect whether they are available? On different servers extensions may not be installed and security options may be turned off so I'd...

Hosting data/image heavy site on dedicated, and images on shared hosting account.

Hi I have never done this before, so I am throwing this out there for opinions. Thanks in advance. I have built a database/image rich application thats only going to increase in size. I am on a budget, but do have a rather good 3Ghz XEON server with 400 GB space. My idea which I am looking for oppions on is to: 1) Run the application...

PHP convert Win-1251 to UTF-8

I'm fetching the contents of a Windows-1251 encoded web site using file_get_html and want to serve it as UTF-8. I set the headers to UTF-8 using: header('Content-type: text/html; charset=UTF-8'); Then i output the data using iconv("cp1252","UTF-8",'"desc":"'.$desc); The output is no longer strange questions marks, but it's still not C...

splitting an array after an SQL query

Hi im totally stuck, could someone help me out? I have done a straight forward MySQL query from a database to return all products. I have used the productGroupDesc to tell me which company and category they belong to. A typical entry looks like Company - Category So what im trying to do is categorise the products by first finding wh...

how to refresh two After Insert process

Hi , After insert successfully i want to refresh the two page which i opened , Example : i have Order view display , in this am displaying the order added items , And another is the pop up window , i want to refresh this window , ...

Preg match question

Hello, I'm sure someone already asked this question, but after searching for more than 1 hour on google, I decided to ask my question here. I want to itterate over an array excisting of different strings/texts. These texts contain strings with both ##valuetoreplace## and #valuetoreplace# I want to make to preg_matches: $pattern = '...

Trouble in installing the openinviter

How to fix the installation error in openinviter? While installing openinviter i get the following error "Unable to write stats. /var/www/open/openinviter_stats.sqlite is not writable" Screenshots of the error: 1. http://bit.ly/9gK8Nr ...