php

How to read values from MultiCheckbox in Zend

Hi!, i have a problem with this Zend form element, how can i read the elements status of Multicheckbox? $type= new Zend_Form_Element_MultiCheckbox('typer'); $type->setLabel('Type'); $type->addMultiOptions(array( '1' => 'type1', '2' => 'type2' )); Thanks for the support!....

Add widgets in forms

Hello I want to know if it's possible to add widgets to a CRUD form : I want to select an entry in a list or to enter a text in an input if the entry isn't in list. The user choose with a radiobutton if he choose in list or write in the input. It's possible ? If yes, how can I do this ? ...

How to Cache RAND() random images in PHP MYSQL

How to Cache RAND() random images in PHP MYSQL use to be cache for 5 seconds then on refresh its change images reply ...

PHP/SQL: Using only one query, SELECT rows from two tables if data is in both tables, or just SELECT from one table if not.

I have two rating/votes tables. One for user votes and stats and another for external votes. The external votes table always have data because it has a DEAFULT = 0, but the users votes only contains data if any user have voted for that specific ID. So I do something like this: $sql = 'SELECT ratings_stats.votes, ratings_stats.tota...

how can i reference $_SERVER['DOCUMENT_ROOT'] in a .htaccess file?

How can i reference the document root from within an htaccess file? ie: i currently have php_value auto_prepend_file C:/wamp/www/hf_latest_desktop/prepend.php but i would like php_value auto_prepend_file **AUTO_DOC_ROOT**prepend.php where '**AUTO_DOC_ROOT**' the root path ...

<? or <?php --- is there any difference?

Possible Duplicates: Are PHP short tags acceptable to use? What does <?= mean when seen in PHP is there any difference in using <? ?> to signify a php block, or using <?php ?> ? if there is not, why would anyone use <?php ? figure the file extension of .php would give plenty of info about what type of code you are looking ...

Session overlap, 2 users logged in somehow the system sees them as one.

Hello guys, Rarely our system mixes logged in users and I can't figure out why. Here is the scenario: 2 users log in (A and B) normally each one has his own ID, at some point one of the users (A) takes the ID of the other user (B) and contribute to the website as if he is B. Technically that's what is going on: 1- 2 users logs in: ea...

make configurable config.php file.

I'm having problems with changing my configuration file config.php. At the moment, I'm trying to configure the databse details $config['db] through a form residing in the same directory, however, when I include the configuration file the channges do not materialise. Here's what config.php looks like: <?php //main path to resources $res...

How to activate "go to definition" in Eclipse for inherited class property

I have a base class (lets call it A) and I have inheriting Class (lets call it AA). In a different abstract class I have: abstract class DifferentClass{ /** *@var A */ protected MyA; } In a more different class: class MoreDifferent extends DifferentClass{ public function __construct(){ $this->MyA = new AA; } } My prob...

How to Get dependency of a PHP script?

I am using a PHP library PHPExcel in my script. Now the library is very large nearly around 7MB and I dont think I am using all the features of it. I wish to make my script lightweightby delting the files in PHPExcel which I am not using. How to achieve this? ...

Is there a standard for generating well formatted forms?

I'm wondering if there is a standard for forms. I mean, when you write a form in HTML, one usually writes it based on its needs, without taking care of its HTML structure. I ask this because I'm working on a Form generator in PHP. I want to make something easy to use and a generated HTML code easy CSS-customizable. There are some Form ...

Database: Sorting hierarchical data (Modified Preorder Tree Traversal): How to retrieve immediate children

i am using MySQL with PHP & Doctrine 2. my question is assuming i am using Modified Preorder Tree Traversal is there a way i can retrieve only immediate children? ...

phpBB3 - using $_GET

I want to do a modification to my phpBB3 and it requires using $_GET method by grabbing a variable in the URL. But just using $_GET increases the vulnerability to my phpBB3 wouldn't it? Is there a function in phpBB3 that would make it safer or anything? Thanks. ...

PHP closing tag unnecessary ?

Possible Duplicate: why in some scripts they omit the closing php tag ?> As explained in the Code Igniter style guide, it seems that PHP closing tags are optional. It even say you should avoid it for several reasons. Anyone would have some more information about this issue ? Thanks ! ...

Cakephp redirect after session expires

Hello, I'm using CakePHP in one website and I was wondering how can I automagically redirect when the session has expired? ...

PHP: type hint for '$this' and other variables in phpFramework::view files ? (Netbeans)

EDIT: Oops, I found the answer in one of the "similar" questionsw. Somebody please delete this question. (http://stackoverflow.com/questions/1798477/variable-type-hinting-in-netbeans-php) /EDIT In php frameworks, in the views, $this refers to the controller object. But netbeans doesn't know this (I am guessing neither do other IDEs), s...

Strange behavior while modifying array that is being iterated

This is a stupid example, but shows exactly what is my problem. In some situations the array is sucessufully modified and anothers it is not, why? Values are given to foreach by value? And the output is also screwed, some lines seems to have '\r\n' others do not. $arr = file('text.txt'); echo '<pre>'; foreach( $arr as $x => $line)...

Zend Framework Plugin in INI is not run

The plugin declared in my application.ini file is not being triggered. I can install plugins the old way via the Bootstrap file, but I'd prefer to keep it in the INI. It doesn't ever load that file, no exception thrown, nothing. I've tried adding .class to the declaration, but nothing. application.ini [production] phpSettings.display_...

Remembering text resizing across different pages on a web site using PHP SESSIONS.

So after reviewing some tutorials on how to change text size and creating my own using PHP I was wondering how can I have my text size remembered across many different pages on my web site using PHP SESSIONS? Here is the PHP text sizer code below. $size = 100; if(isset($_GET['i']) && is_numeric($_GET['i'])) { $s = $_GET['i']; } i...

Logical thing to do about checking for unique id?

I have a randomly generated link id which is 8 digits long with 50 values per digit, which means 4x10^13 possible combinations (i think). I have about ten-thousands of queries per day. My question is, should I check 4 tables each query for duplicates, or skip it? or make it 10 digits so that it definitely won't be a match? edit: my (p...