php-5.3

Is storing data in PHP $_SESSION insecure?

China☆狼群 提交于 2019-12-12 08:48:58
问题 As per my understanding, PHP processes doesn't behave as application server process. So, after the execution of a script the PHP process retains no user specific data. It instead stores them in the user's cookie. So whatever we store in $_SESSSION goes into cookies. Is this true? If yes then are they stored in clear text or some encoding or encryption is done? 回答1: No, the only thing that goes into the session cookie is the ID of the session - a random alphanumeric string. All the session

xhprof not working wamp 2.2

浪子不回头ぞ 提交于 2019-12-12 04:08:32
问题 I have downloaded the dll file from http://windows.php.net/downloads/pecl/releases/xhprof/0.10.6/ and kept the first 32 bit file at C:\wamp\bin\php\php5.3.13\ext and also include it in my php.ini file (as extension=php_xhprof.dll). But when I call phpinfo() xhprof is now showing. I am not getting any errors in my log. 回答1: There are 2 php.ini file and you may have edited the wrong one. To make sure you edit the correct php.ini file i.e. the one used by Apache use the wampmanager menus like so

Administrator URL '&' changed to '&'

烈酒焚心 提交于 2019-12-12 01:12:18
问题 I'm working on my localhost and on a system where all administrator URL's which contain a & , & is changed to & and that in turn breaks the system. What setting is doing this? What do I need to disable? My localhost is PHP 5.3. I have to mention that other Joomla system's are working perfectly fine and the & in the url are not converted to & . 回答1: There is no setting that can do this in Joomla 2.5 (as far as I know). The only think capable of doing such a thing would have to be a system

Cannot redeclare a function error

不羁岁月 提交于 2019-12-12 00:41:10
问题 I am trying to remove the slashes from magic quotes from an array. So I have two functions, one is to remove the slashes, another is to set the variable. // Strip slashes from an array. function strip_magic_quotes($array) { if (get_magic_quotes_gpc()) { function stripslashes_array($array) { return is_array($array) ? array_map('stripslashes_array', $array) : stripslashes($array); } return stripslashes_array($array); } return $array; } function set_variable($array = array(),$key,$params = array

IE9 Separate cookies for third party request

£可爱£侵袭症+ 提交于 2019-12-12 00:08:31
问题 Even though my P3P headers are correct, IE9 seems to hold a separate list for third party requests. I've added the following P3P header('P3P:CP="NOI DSP COR CURa ADMa DEVa PSAa PSDa OUR BUS IND UNI COM NAV INT", policyref="http://domain/w3c/p3p.xml"') Of course with domain properly set. It's created by the IBM tool. Next to that I've created the p3p xml file and tested it with p3p validation. Once I call a test file stating nothing more then <?php header ('P3P:CP="NOI DSP COR CURa ADMa DEVa

PHP Gearman installation

断了今生、忘了曾经 提交于 2019-12-11 22:20:37
问题 i have trying to sort out gearman extension for php for nothing is going correct. I have tried to install gearman-1.1.2 as per the instructions given in the website. Install gearman Thanks for the great article since the install went on smoothly. But after restarting apache2 and tried to enter php command gives me like this: $ php PHP Warning: PHP Startup: gearman: Unable to initialize module Module compiled with module API=20090626 PHP compiled with module API=20121212 These options need to

Search and list specific directories only?

空扰寡人 提交于 2019-12-11 20:40:32
问题 I want to search and list specific folders only and no matter how deep these folders are kept. For instance, below is how I structure them, local/ app/ master/ models/ views/ slaves/ models/ views/ scr/ models/ index.php And I just want to list the folder of models into an array, local/app/master/models/ local/app/slaves/models/ local/models/ My working code, $directories = array(); $results = array_diff( scandir("local"), array(".", "..") ); foreach ($results as $result) { if (is_dir("local/

DateTime class create a function to add hours onto a deadline taking into account working hours and on hold time

前提是你 提交于 2019-12-11 16:14:23
问题 Basically I am trying to create a basic case logging system and when somebody opens a new case, the case is assigned a priority with a given number of hours. For example priority 1 is 4 hours, 2 is 9 hours, 3 is 36hours and 4 is 63 hours. Now adding hours onto a time stamp is easy but the catch is I need to take into account working hours which are 08:30 to 17:30 Monday to Friday. So if a case is given a 4 hour priority and the deadline for this falls after 17:30 on a week day then the

A short-cut to update a table row in the database?

一曲冷凌霜 提交于 2019-12-11 13:38:51
问题 I wonder whether this idea is a good practice to update a row in a table in the database. I usually update the row like this, $pg_id = set_variable($_POST,'pg_id'); $pg_url = set_variable($_POST,'pg_url'); $pg_title = set_variable($_POST,'pg_title'); $pg_subtitle = set_variable($_POST,'pg_subtitle'); $pg_description = set_variable($_POST,'pg_description'); $pg_introduction = set_variable($_POST,'pg_introduction'); $pg_content_1 = set_variable($_POST,'pg_content_1'); $pg_content_2 = set

if then else to display 2 views on one function called

喜夏-厌秋 提交于 2019-12-11 12:59:50
问题 i have got a little problem with redirect function, I have a controller function named "someview" and I also created a view file of the same name (someview.ctp) The controller function will do some stuff(query data from the model). it can be simply described as follows function someview() { $result=$this->User->getdatafrommodel(); if(null!=$result) { //do something } else { $this->redirect('usernotexist'); } } function usernotexist() { $this->loadSkin(); } I also created a page named