php

Finding a path in a multidimensional array for a certain ID

I have an array that's stored like this: [0] => Array ( [id] => 1 [cat_name] => c1 ) [1] => Array ( [id] => 2 [cat_name] => c2 [copii] => Array ( [0] => Array ( [id] => 5 [cat_name] => c21 ...

php sessions create and destroy on submit?

Given a php form that submits to it’self, via <?php echo $_SERVER[‘PHP_SELF’];?> And the same form with some html and one submit button <label for="submit">Submit</label> <input id="submit" type="submit" value="Submit Info:" /><br /> How do I set it up, such that when the user has finished inputting all the relevant information on t...

Multiple consumer one queue

Is it possible to make multiple consumers to share one single queue in RabbitMQ? I am currently using this php library to work with RabbitMQ, from what I observe, although I have 2 identical instances of a consumer script running, but only one would respond to the message passed... ...

please check validation

Hi frnds,i am inserting day value to database,i want validation like if the day already exist it should say day already exist else it should innsert..please can anyone check the following code... thaanks in advance $dexist=$_POST['ext']; $res=mysql_query("select Day from mess where Day='".$dexist."' "); while($row=mysql_fetch_array($res...

can i post data without using submit button

i am in a situation using two submit buttons in a same page. is there any alternative to post data without using submit button?. help me ...

Display online NSE (National Stock Exchange) data in php web application

I want to display online NSE (National Stock Exchange) data in my php web application. Please help me how to do this. ...

Sugar CRM Soap call not working properly

I have sugar crm instance and i was trying to get some data from it using soap service. Below is the code which i am using for it. When i run the same code , sometimes it is returning correct data, sometimes it not. Can any one tell me what the problem is?? include "nusoap.php"; $client = new soapclient('http://asdf.net/test/urba...

How to prevent access of admin pages by knowing the admin page url?

If someone knows my url of the admin page such as www.example.com/admin.php, then they will easily access the page by directly accesing that url. How to restrict this. Please help ...

help with Zend_Auth_Adapter_DbTable

Hi all, I'm starting with the Zend framework and I wanted to use Zend_Auth_Adapter_DbTable to authenticate my users ... I looked at the docs, which seem quite straight forward, but I'm getting an error. Here's my code snippet : $adapter = new Zend_Auth_Adapter_DbTable($this->_dbAdapter, 'users', 'username', 'password', 'MD5(?)'); ...

PHP - next day 6pm

<?php $start_date = "12/10/2009 11:30"; echo "<br>start_date: $start_date<br>"; $due_date1 = date("m/d/Y H:i", strtotime("+1 day".$start_date)); $due_date2 = date("m/d/Y H:i", strtotime("+2 day 6pm".$start_date)); echo "<br>due_date1: $due_date1<br>"; echo "<br>due_date2: $due_date2<br>"; ?> See my code , I'm trying to get two dat...

Php ternary statement

Hi i was recently looking over a shopping cart paginator class, trying to understand their code so i could build my own paginator when i came across the following line of code. It resembles a ternary statement but is written in a way that i have never seen before. I would google it but i wouldn't know what to google. Could someone please...

php file_exists() return false on some directory on IIS

Environment: php5 windows2003 IIS with fastCGI Code: <?php $p = "i:\\tmp"; if( file_exists($p) ) { print $p . ' exists!'; } else { print $p . ' not exists!'; } ?> ...

Getting last 6 values from an multidimensional array

I have a need to get the last 6 values from an multidimentional array, I was trying to do something like this for($i=0;$i<6;$i++){ $stats = array_shift($stats); } But then after the first array_shift I get the following error PHP Warning: array_shift(): The argument should be an array Are there any functions that could do ...

Using php web site as a portlet in JSR 168/268 portlet container [in Oracle BEA Weblogic server]

Hi Friends, I have an existing PHP website which use considerable amount of jquery and ajax. Now our client need to integrate it as an portlet in a Oracle BEA Weblogic server and their prefered specification is JSR168. I'm completely new to java portlets and so I have few questions regarding portlet. 1. Can we integrate PHP website ( whi...

php associative array and switch

My associative array. $money = array("Nickels" => $_POST["nickels"], "Dimes" => $_POST["dimes"], "Quarters" =>$_POST["quarters"]); My html form set up to handle Quarters, Dimes and Nickels are not shown in this case for brevity. <label><b>Quarters:</b></label> <select name="quarters" > <option value=".25">25c</option> <option value="...

18 digit timestamp?

I am working on a system related to tv recordings. I am parsing the following xml from another system (to which i have no documentation): <Program FileName="2009.11.07-Saturday 07 November 2009.dvr-ms" SubChannel="ABC1" StartTime="633931722046825183" StopTime="633932388000119414" ActualStopTime="633932388016825183" ShareShow="True" /> ...

php class for seo

I recently use the great php class call : Google Analytics PHP API. I manage to get it working to get a lot of info and stats for my 25+ website that have analytic Now i like to get more data like The page rank the google placement (where i am on google #325 or #520) Google Page Rank Google Indexed Pages Traffic Rank Inbound Links DMO...

for Single and Multiple Sizes of an Item

I am using a PHP Compoment, that accepts an ItemID and Return the Product Price. Now I have to Change the component so that the product may have a Standard Size or May Have Multiple Size. For example Watch has Standard (No Size) but Shoes May have Sizes like 5,6,7,.... And Depending on the Sizes the prices are also different. What ...

Server error, why this error message appears when i use .htaccess

when I use .htaccess file inside a folder named admin with the following code AuthName "Alertme" AuthType Basic AuthUserFile /mobs/.htpasswd require valid-user and .htpasswd file with following code rajasekar:66Acdia7gE1to While accessing the file inside folder, it gives server error, The server encountered an internal error and wa...

Calling java program dependent on external library

I am trying to call a java program in php to use it with web interface. Java program is dependent on an external lib: commons-cli-1.2.jar So basically I need to export it before calling the java program; but if I export it first as: shell_exec('export CLASSPATH=$CLASSPATH:~/lib/commons-cli-1.2.jar'); then call the java program as: ...