Hello,
i've implemented this custom PHP Session Class for storing sessions into a MySQL database:
class Session
{
private $_session;
public $maxTime;
private $database;
public function __construct(mysqli $database)
{
$this->database=$database;
$this->maxTime['access'] = time();
$this->maxTime[...
Hi,
I'm trying to make local development copies for my wordpress blog. I tried first to install wordpress locally (on XAMPP for Windows), install the plugins then import the live data (from a DB backup). The problem is whenever I import the live data I start getting all sorts of errors, even after I change the blog's URL through the dat...
I don't know if a array is really a object on php ... but, what I want is to change the array behavior on a foreach loop.
Something similar to this on java:
for( String it : myArr = new Array_Iterator( array) implements Iterator{
public Array_Iterator( String[] arr){ this.arr = arr}
/* interface implementation */
}){
/* loo...
I'm having to manually write:
if($pattern == 'REGEX_EMAIL') $pattern = REGEX_EMAIL;
if($pattern == 'REGEX_PASSWORD') $pattern = REGEX_PASSWORD;
Is there an other way?
...
I am currently developing a php-application for a charity organization and I am now in the stage of defining the deployment practices.
Our application is using both Zend Framework and Doctrine. The application will be rolled out to different servers, each with a different configuration file. The machines are both Windows and Linux (but ...
Hi All,
Is there a standard way or library to copy and paste from a spreasheet to a web form?
When I select more than one cell from Excel I (obviously) lose the delimiter and all is pasted into one cell of the web form.
Does it have to be done in VB? or could the processing be done once the paste action is started on the web form?
Than...
Hi there,
I looked the site to find a solution for my problem, but couldn't find the answer. Hopefully someone can help me with this:
I have a script that uploads and resizes an image without pagerefresh. I found it on the internet and adjusted it for my use. The script can be found underneath.
My problem:
First the upload.php script...
I have problems installing PHPUnit 3.4.6 via PEAR 1.9.0. After I discover channel pear.phpunit.de and try to use one of following commands:
pear install phpunit/PHPUnit
pear install --alldeps phpunit/PHPUnit
pear install --onlyreqdeps phpunit/PHPUnit
it fails, giving me following error:
No releases available for packa...
Hi all,
PLATFORM:
PHP & mySQL
I am storing the date+time in database in the following format: date("Y-m-d H:i:s"). An example of a value that I have in my DB is : 2010-01-05 07:36:33. In my script, I have set the timezone as date_default_timezone_set("America/Chicago");
THE PROBLEM:
I read about the UNIX_TIMESTAMP somewhere and I w...
how can i check if a file is an mp3 file or image file, other than check each possible extension?
...
Hey
I have a while loop that constructs a url for an SMS api.
This loop will eventually be sending hundreds of messages, thus being hundreds of urls.
How would i go about doing this?
I know you can use header(location: ) to chnage the location of the browser, but this sint going to work, as the php page needs to remain running
Hope ...
I have id names with the second part of table name plus id.
For example
admins_id in omc_admins table,
customers_id in omc_customers table,
products_id in omc_products table,
categories_id in omc_categories table etc.
Now the following function code is supposed to find orphans. For example, when I delete categories, it will ch...
Hello! I need to select a specific item of a combobox in my page when i click in a button.
I am using php and javascript code in my page.
Actually i am calling a javascript function at the "onclick" of the button. But i still dont get the right command to do this.
example:
<select id="TEST">
<option> a</option>
<option> b</option>
<o...
Having trouble with some select statements.
I have 2 tables. sms_log and sms_messages.
sms_log :
id
message_id
user_id
sms_messages:
message_id
admin_id
message
date_sent
date_delivered
I want to get the sms_message data where sms_log.user_id = $id
How do i do it, im a bit stuck. Also, how will i access it through php, exactly t...
Okay... I'm having the following problem - in my facebook application I let people add quotes sending them to my DB with their user_id, post_id and date. Then there's a browse page where people see the posts - so far, so good. But then I add a button that lets my users set the said post as their status. Still all good. However when I hit...
I'm trying to display the new dynamic list by clicking dynamic list. Why do i call them dynamic list? Because the data is from database.
My idea is generating a list of companies, when i click one company, a list of all sites in the company is displayed; And then when i click the one site of one company, a list of all employees in the ...
ive got a really weird problem. i have no clue why its not working. i create an user and get the id and insert a row based on that id in another table. the row gets inserted with that id but the other values however for that row are not inserted!
$user_id = mysqli_insert_id($this->connection);
$query = "INSERT INTO selections
(user...
I'm trying to grasp the idea of transactions fully. Therefore the following question... (ofcourse newbie, so don't laugh :D )
I have set up a (simplified) transaction in PHP (using the PHP SQL driver from microsoft). I want to get the rows I'm going to delete for some extra processing later:
sqlsrv_begin_transaction($conn);
$sql = "SEL...
Okay let me see if I can explain this right. In wordpress we have a box to insert an excerpt. We need to add a second excerpt box. Instead of manually adding a custom field to every post I have placed a function to automatically add a custom field in the form of a Meta box on the admin post page.
Okay so this is the problem that i'm hav...
I have two completely separate queries that were transferred over to procedures. When they were ad-hoc queries, they ran great but now that I have stored them, things have gotten strange.
PHP calls a class method which returns the values of one of the procs. The second method is then called and fails. When I run the run the proc that PH...