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...
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,...
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
...
I want to know a list of advance open source product's like cms and etc with php
...
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...
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...
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.
...
Like this one:
https://aniscartujo.com/webproxy/default.aspx?prx=http://google.com
...
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.
...
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
...
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 ...
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...
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...
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...
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 ...
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'...
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...
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 :(
...
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?
...
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?
...