php

Same OpenID code working on 1 server not working on another

We implemented OpenID for Google Marketplace on this online hosting and it worked perfectly fine. But its not working on another server which DOES NOT have cPanel unlike the online hosting. Its failing authentication with this message: "Nonce already used or out of range" Does anyone have any idea what could be causing this problem? ...

encryption in php

$key = file_get_contents('http://keyserver.pramberger.at/pks/lookup?op=get&search=userid'); this code gives me public key with the html tag .how to extract the public key block form begin pgp public key block ---to---- end pgp public key block and using this public key i need to encrypt the data .i need to do it in php. ...

WordPress - How to know if a sidebar is empty without loading it?

I'm trying to wrap the sidebar by a DIV, and if the sidebar is empty the DIV should not be displayed But i cannot use codes like if(dynamic_sidebar(1)) { echo '<div>'; dynamic_sidebar(1); echo '</div>'; } as it will load the sidebar before the DIV if it is not empty, any ideas? ...

How to Create an Array an Look if a value is in Array

How do I create an array in smarty from a given string like 22||33||50 and look if the given number is like the numbers above in smarty ? I have a string say {$test->strings} // contains 33||12||80 I want to look if one of the numbers in {$test->strings} is equal to {$test->myday} how can I do that? ...

Find everthing that is not between specific tags

Hi, i'm using preg_match_all('/<?(.*)?>/', $bigString, $matches, PREG_OFFSET_CAPTURE); to find the contents of everything between <? and ?> Now I'd like to find everything that is NOT between <? and ?> I'm trying with preg_match_all('/^(<?(.*)?>)/', $bigString, $nonmatches, PREG_OFFSET_CAPTURE); but that doesn't seem to work... ...

Good practice on implementing elements with the state in Zend Form

About to create a form using Zend Form, all the form elements should have a checkbox before it, and depending on the state of checkbox the element is submitted(if checkbox clicked it will be submitted othervice not) [x] Label [-------------] [x] Label [-------------] and the confusing part is how to deal with it using the zend form. T...

how to separate a string in php

sometext( [key] => value which content number and alphabates ) from above,i want only value part by using explode function for only one time.Is it possible. or any other function is present in php. ...

How to render Zend_Navigation in different section in xml?

How to render Zend_Navigation in different section in xml? Here my xml <configdata> <admin> ..... </admin> <default> ..... </default> </configdata> I'm already testing this but render of menu get same result section admin $navContainerConfig = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation...

Security flaw in this code approach

Hello, Am wondering if there would be any security flaw in this approach. I am writing a piece of code which allows users to upload files and another set to download those files. These files can be anything. User uploads the file (any file including .php files), it is renamed to an md5 hash (extension removed) and stored on server. A ...

change password code error

I've created a code to change a password. Now it seem contain an error. When I fill in the form to change password, and click save the error message: Warning: mysql_real_escape_string() expects parameter 2 to be resource, null given in C:\Program Files\xampp\htdocs\e-Complaint(FYP)\userChangePass.php on line 103 Warning: mysql_r...

Use preg_split to split a string on "," and " and "

I now split the sting op , only like this: $a_string = preg_split('/[,]/', $sting); I also want to split the sting on " and " but i can't find the right regex. ...

User sumbitted top 5 and sort by popularity

Hi, Database setup (MySQL) table: top_fives id, uid, first, second, third, fourth, fifth, creation_date 1, 1, cheese, eggs, ham, bacon, ketchup, 2010-03-17 2, 2, mayonaise, cheese, ketchup, eggs, bacon, 2010-03-17 Users can submit their top 5 of a certain subject. Now I would like a summary of the top fiv...

sort associative array PHP

Here's my array, how do I sort it by saleref? Array ( [xml] => Array ( [sale] => Array ( [0] => Array ( [saleref] => 12345 [saleline] => 1 [product] => producta ...

Spreadsheet_Excel_Writer path problem

Hi, I have tried the following program for writing the contents into Spreadsheet. I downloaded the Spreadsheet_Excel_Writer package also. <?php ini_set('include_path','/xhome/rekha/public_html/PHP_FORUM/PHP/open_office/Spreadsheet_Excel_Writer-0.9.2/Spreadsheet/Excel/Writer.php'); $workbook = new Spreadsheet_Excel_Writer(); $workbook-...

Using * in SELECT Query

I am currently porting an application written in MySQL3 and PHP4 to MySQL5 and PHP5. On analysis I found several SQL queries which uses "select * from tablename" even if only one column(field) is processed in PHP. The table has almost 60 columns and it has a primary key. In most cases, the only column used is id which is the primary ke...

how to convert object into string in php

how to convert object into string in php Actually i am dealing with web service APIs.i want to use output of one API as a input for another API. when i am trying to do this i got error like this:Catchable fatal error: Object of class std could not be converted to string in C:\ ... this is the output of first API::stdClass Object ( [doc...

JavaScript & JQuery Multi Dimensional Array Search using CSV file

I have a CSV file, 2 columns Name & Image, I’m using Javascript / PHP to read and display the list of names in an auto complete search field. //-->This is what’s suppose to happen <--// When the user performs a search, they type something into the text field, the auto complete drops down with all available Names matching there Query, ...

is there any php functino to format time (not date)??

Hello, I have a mysql table field set as time type which stores data in the HH:mm:ss format. So when I list the data, it prints as, for example, 16:30:00. But I want to display hh:mm part only (not the seconds). In case of datetime types, I can do date('H:i', '2010-03-16 16:30:00'). I mean I can retrieve any part. I wonder if there is ...

How to automatically reflect the new Updates (on Database) to User Pages

I am trying to create a new Notice Alert using PHP and Javascript. Suppose that a 100 users are currently logged into to the Online Notice Board Application and any One user posts a new notice. I want an immediate alert signal on all the users screen. I know, that the simplest way of doing it is to constantly Ping the server but I don't...

Is there any way to see the functions that are executed after pushing a link or a button in a web page done with PHP?

Hi, is there any way to see the functions that are called after pushing a link or a button in a web page done with PHP? I user Firefox. Regards Javi ...