How do I test if memcache or memcached (for PHP) is installed on my Apache webserver?
Memcache is a caching daemon designed especially for
dynamic web applications to decrease database load by
storing objects in memory.
...
Is there a way to set something as global in a class and have all methods of that class to have access to it? Currently if I use global $session; I have to add it into every method that uses it even if all the methods are in the same class.
If I try to add it directly into the class then I get a php error saying it is expecting a funct...
Hi
I have image upload form, user attaches aimage file, and selects image size to resize the uploaded image file(200kb, 500kb, 1mb, 5mb, Original). Then my script needs to resize image file size based on user's optional size, but im not sure how to implement this feature,
For example, user uploads image with one 1mb size, and if user ...
I'm taking the contents of a 1.2mb webpage into a longtext field, server has gone away though everytime!
...
I’m trying to learn and fully understand mvc pattern and learn php at the same time. I decided to built basic mvc framework that I could use on various projects later on. Having read lots of posts in here regarding mvc and coupling between models/views/controllers I’m a bit lost.. At the moment my understanding is that in web applicatio...
<?php
$a = 'ec';
$b = 'ho';
$c = $a.$b;
echo('Huh?');
$c('Hello, PHP!');
?>
yields
Huh?
Fatal error: Call to undefined function echo() in <...>/php.php on line 11
Why?
...
For some reason, JavaScript/PHP wont delete my data from MySQL! Here is the rundown of the problem.
I have an array that displays all my MySQL entries in a nice format, with a button to delete the entry for each one individually. It looks like this:
<?php
include("login.php");
//connection to the database
$dbhandle ...
In PHP, how do I get the current time, in UTC, without hard coding knowledge of where my hosting provider is?
For example, I tried the following:
time() + strtotime('January 1, 2000')-strtotime('January 1, 2000 UTC')
and find that it reports a time that is one hour ahead of actual UTC time. I tried this on two different hosting prov...
i want to include all tables from a database "shop" to mydatabase "newhshop". i export that "shop" database, and now it is named as shop.sql. is there any way to execute whole query from that file instead of importing directly to database "newshop".
...
I used to use the function below for an array or IP's but now I have changes the IP array from this:
$bannedIPs = array('127.0.0.0','72.189.218.85'); // Banned IPs array
ipban($bannedIPs);
function ipban($bannedIPs) {
if (in_array($_SERVER['REMOTE_ADDR'], $bannedIPs)) {
include ("site_banip.php");
session_destroy();
...
For example, we have index controller:
class IndexController{ ...
How to make e.g.
class Index_Controller{ ...
work?
...
I'm trying to create a custom form in Drupal 6 and everything seems to work okay with the code below including when submitted a new entry is created in the database however all the $form_state values are empty. What am I missing?
<?php
function rate_form($form_state) {
$form = array();
$form['rate']['name'] = array(
'#type' => '...
It should be something like this:
function callcenter($func,$value,$position)
{
}
Where $func is the function to be called,
$value is the parameter for $func,
and $position stands for index of $value,
for example,
callcenter('func',1,2) should actually call func(null,1)
callcenter('func',1,3) should actually call func(null,null,...
I'm writing a script which reads and manipulates a KML (xml) document. Below is a snippet of the document I'm reading:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by Feature Manipulation Engine 2009 (Build 5658) -->
<kml xmlns="http://earth.google.com/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
...
I am having a really unsual problem I have never had before, I have a signup page/form and a processing page that for submits to, on the processing page I set any errors that are in the user data like empty fields and set them to a session var array
$_SESSION['signup_errors'] = $signup_errors;
$signup_errors is an array that I set t...
I am trying to implement the functionality that is done by most web applications on the web that have a login screen and a "Remember me" checkbox on the side that if checked will allow open entry to the user next time they visit the web page...As in, it does not ask the user for username and password anymore it just logs them in.
I want...
Hi,
I would like to know how is it possible, or what knowledge do I need to acquire to create a small Adobe AIR application, probably like a employee directory search that will search and show a list of employee names, from a application based on php/mysql?
Thanks.
...
Hi, I'm at a loss with an annoying issue to do with exporting a report. Basically, a button is pressed and a report is generated server side using the following javascript:-
__callExportController(true, { op: 'build', type: exportType }, function(data) {
var outputURL = './reportinc/export_controller.php?op=output&filename=';
va...
Just wondering if someone could suggest a PHP library that would allow me to read the data of an RSS feed and write it to a MySQL database. Also, if possible, provide a link to documentation about how to do this?
Thanks
...
how can i use exec() method to import a .sql file in php?
what is its output?
...