php

Why are two separate MySQL statements duplicating each other?

I've got a require file that I use to display random products. On the home page it gets used twice, once in the main content section and then again in the sidebar. The problem I'm having is the second require doesn't overwrite the first sql results, it adds to them? The results I'm actually getting for the 2nd set of results are the 1st...

Am I even connecting to Oracle?

When I attempt this query: $query = "SELECT * FROM user_objects WHERE object_type = 'TABLE'"; ... I get an empty result set. I have error_reporting() set to E_ALL, so I would assume that if it wasn't connecting correctly, I would be getting an error... right? I'm using a class given to me by a higher-up that they use for everything,...

Basics for creating a Wiki-like web application?

Hi folks, I need to implement wiki-like functionality within a website. Problem is that I am not fully aware of what it might require and therefore predict a long set of refactoring till I actually nail a good version. I tried looking for some guidelines, but haven't found much. Any ideas? Help would be wonderful ...

advance open source products in php

I want to know a list of advance open source product's like cms and etc with php ...

troubleshooting a PHP captcha script that fails to render the complete random string...

I'm using a captcha script for a form. Strangely the image will frequently fail to render the first character of the string of random characters. This pattern will last for about 8-12 refreshed pages, before the expected behavior is reestablished. I know the string contains the full set of four characters because I've debugged this wit...

Upload image without losing quality

I use this class to upload and resize images. The problem is that images have bad quality! I need to upload images without losing quality at all! class SimpleImage { var $image; var $image_type; function load($filename) { $image_info = getimagesize($filename); $this->image_type = $image_info[2]; if( $this->i...

How can I avoid 'make install' when building PHP in Unix environment?

I'm attempting to rapidly deploy a PHP application under apache2/PHP on a Unix host. The sysadmin hasn't heard of PHP so I'm looking to build/install myself. Unfortunately root access is two weeks of bureaucracy away so I'm looking for a way to use PHP and its requisite libxml2 without installing. ...

How to implement a proxy site in PHP?

Like this one: https://aniscartujo.com/webproxy/default.aspx?prx=http://google.com ...

zend bootstrap: for each module

Is it good or bad practice to create separate bootstrap for each module. They make the project look a lot less disorganized in my opinion so I'd like to know if it's the norm to have them in each module. ...

Echoing html and $_POST

echo "<p id='xlday'>'$_POST['day']'</p>"; Hi can anyone help me solve this problem, should be a simple one but i'm struggling for some reason! Thanks ...

iPhone Push Notification - Error response problem

Hi all, I've got a problem when checking for a response error after sending a Push Notification. This is my setup: From my PHP server, I'm sending Push Notifications. These notifications are send in the enhanced format, so I can get an error response from the Apple server. For example: Error #7 "Invalid payload size". The way I check ...

Convert all dates in PHP to local time.

The server my PHP script is running on is set to UTC. I can't seem to figure out a way to set all dates to the browser's timezone. All dates displayed are formatted using PHP's date() function. I know that via JavaScript's getTimezoneOffset() function, I can get the browser's current UTC offset (-4, in my case). How can I tell PHP to...

How slow is gzuncompress?

I'm working with a very simple filesystem database in order to benefit from performance. Unfortunately, the trade-off is disk space. I'm thinking about compressing data everytime I write and read from the filesystem database using gzuncompress and gzcompress. How slow are those functions? Can they be used without affecting my system perf...

PHP Session in Kohana 3

Hey! So I'm basically unable to use any kind of session in my Kohana 3 project. A few example of the issue : $session = Session::instance(); $session->set('customer_id', $customer->id); $this->request->redirect('controller/action'); //At the start of the redirected action $session = Session::instance(); $customer_id = $session->get('c...

Getting the pathname of an inherited class in PHP

I'm trying to get the absolute pathname of a PHP class that inherits from a superclass. It seems like it should be simple. I think the code below explains it as succinctly as possible: // myapp/classes/foo/bar/AbstractFoo.php class AbstractFoo { public function getAbsolutePathname() { // this always returns the pathname of ...

One server, multiple domains, sharing PHP MVC

I'd like to produce regional versions of a php powered website, for example: www.mysite-england.co.uk www.mysite-wales.co.uk www.mysite-scotland.co.uk I'd like to setup one LAMP server to serve all the domains with a single php MVC using $_SERVER['HTTP_HOST'] (or similar) as the primary content modifier. Ie if($_SERVER['HTTP_HOST'...

PHP assign value to $this

Basically what I'm trying to achieve is to make the object reference another object of the same class - from inside of a method. It'd be perfect if the following would work: $this = new self; But one cannot reassign $this in php. I of course know, I can return another object from the method and use that, so please do not advise that...

Whats the meaning of 'static' when declaring a function

this is the code from the tutorial book. class user { // return if username is valid format public static function validateUsername($username){ return preg_match('/^[A-Z0-9]{2,20}$/i', $username); } } i wonder, what is the function of static? it's too bad the book i read didn't explain it :( ...

Gigantic arrays

I'm planning to store gigantic arrays into serialized files and read from them in order to display data within them. The idea is to have a simple, document-oriented, filesystem database. Can anyone tell me if this would be a performance issue? Is it going to be slow or very fast? Is it worth, filesystem is always really faster? ...

PHP5 and lib GD: out of the box support?

Does php5 come with the GD graphics library as standard? http://www.libgd.org it mentions a version of php4 on their site - do I assume every version since then has it built in? ...