php

TouchJSON not working to retrieve data on iPhone.

Hi, I am trying to use TouchJSON to retrieve data from a php page with json output. I have followed the same steps as an example project I downloaded from and it still isn't working. When I select the section containing the data from my main menu the app crashes. I am including my view controller implementation file. Thanks, enbr. http:/...

Browser not displaying XML with CSS properly when XML has a PHP extension.

I'm using a PHP file to output an XML Document. I'm using a CSS file to format that XML Document. My browser (Safari) won't show the formatting unless I feed it a file with an xml extension. I thought the header took precedence over the extension. parser.php (after php processing) <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-st...

Facebook error "Missing redirect_uri parameter."

Kohana_Exception [ 0 ]: Error fetching remote https://graph.facebook.com/oauth/access_token?client_id=&amp;client_secret=&amp;code=&amp;redirect_uri=http%3A%2F%2F%2Flogin%3Fmethod%3Dfboauth%26redirect_uri%3Dhttp%253A%252F%252F%252F [ status 400 ] {"error":{"type":"OAuthException","message":"Missing redirect_uri parameter."}} Even though...

PHP doesn't like creating an array of objects..

Hey, I am writing a customer management system in PHP, for use offline (i.e. on the clients computer). I have considered using Java or C# but have come to the conclusion that it is easier to let the browser do all the layout for me, and just have the company install wamp on their computers. Through this interface they will also be able...

Desktop software development (possibly using web technology) and cryptographic checks

OK, go easy on me as it's my first question here. ;) I am experienced in Web Application development, but I need to design 2 different desktop applications at work. I need advice on what languages to use (I use PHP for Web Applications, I have little other experience), any frameworks that may help me accomplish this easier and any IDEs ...

'true' in Get variables

In PHP, when you have something in the URL like "var=true" in the URL, does the 'true' and 'false' in the URL get translated to boolean variables, or do they equal the text 'true' or 'false'? For instance, would, with the url having "var=false" in it: if ($_GET['var'] == false) { ... } work? Or would the variable always be true since ...

Codeigniter not finding the controller

This is my basic file structure /system - /application - /config - - -routes.php - /controllers - - -about.php - - -home.php - - /admin - - - -dashboard.php - - - -login.php - - - -news.php And in routes: $route['admin'] = 'admin/dashboard'; //This should be the default. $route['admin/(:any)'] = 'admin/$1'; Browsing to http:...

Build environments for PHP extensions?

Looking for development frameworks for creating custom PHP Extensions. PHP4Delphi looks promising. And there's the usual Visual Studio route. Are there any others? ...

Parsing phpdoc comments using PHPDocumentor

I'm looking to convert PHPDocumentor output to a format I can traverse through in PHP (Ideally, I want an array of all the functions with their comments). Is there any way to do this? ...

In PHP,array concept

I have two arrays...I want to find the common element in the array.I want to find the unique values in array1 and unique values in array2.... Example: Array1:"red,blue,green,violet" Array2:"yellow,orange,violet,blue Now i want to know how will i retrive uniq_Arr1=>red,green uniq_Arr2=>yellow,orange common_Arr=>violet,blue That i...

Why Regular Expression in CakePHP ( must CakePHP )

Why does this code run differently in CakePHP vs. a normal PHP file? <?php $data = " One Two Three Four"; $data = trim($data); $data = preg_replace("/\n{2,}/", "\n", $data); $data = explode("\n",$data); var_dump($data); ?> When I run this code in a normal PHP file, I get array 0 => string 'One' (length=3) 1 => string 'Two...

What's the difference between if and elseif?

This should be a simple question. I have a simple if/else statement: <?php // TOP PICTURE DEFINITIONS if ( is_page('english') ) { $toppic = 'page1.png'; } if ( is_page('aboutus') ) { $toppic = 'page1.png'; } if ( is_page('newspaper') ) { $toppic = 'page1.png'; } else { ...

How to connect two different DB tables using Cakephp?

convert following query into cakephpquery. "SELECT * FROM user1.user_favourites,esl.esl_lyrics WHERE esl_lyrics.id=user_favourites.fav_recordID AND user_favourites.fav_userID=".$user_id." AND user_favourites.fav_widgetID=$wid_id"; Models files are esl.php and userFavourite.php DB are user1 and esl. DB tables are user_favo...

php: send email when ftp-upload was a success?

hey guys, i wonder what i'm doing wrong? I'm working on a ftp-upload with php. if files are uploaded successfully i want to get a confirmation email. just a simple email. if my connection to the FTP Server was a success i'm calling the sendmail() function! it's not working! function sendmail() { $EmailFrom = "do-not...

php how to make URL link on view

i did one chat application , in the my chat pings area am displaying my pings, if i enter url that is displaying as TEXT but instead i want to display as URL , How to display url are Link the view, Advise... Example , x says:hi Good Morning, y says:Hi GM, x says:Chk this www.happylife.in ,(instead text i want to show www.happylife....

jConfirm form submit returns incorrect value to php

hi im using jConfirm to return form submission to php my html looks like this: <form id="formdelete" name="formdelete" method="post" action="/home.php"> <input type="hidden" name="remove_user" id="remove_user" value="3"> <input type="submit" value="" border="0" name="image" src="" id="removeuser" class="ui-removes" onclick="DeleteUser(...

PHP: How to loop through a dynamic number of classes

I'm wanting to detect all objects(classes) defined in a php file (example: flavors.php). The number of objects will be defined dynamically, so I need to process the available objects with a function at runtime until the objects are exhausted. After the objects are exhausted the program stops. I have full control over the code, so if the...

PclZip extract into new folder if folder already exists

i am using PclZip to extract zip file, my problem is how can i extract the zip file into different folder by creating a new folder if the folder is already exits.. Thanks for any help! ...

PHP, MySQL and "sleeping" connections

Hi Everyone, I am running a web service powered by PHP/MySQL and recently noticed a strange issue. When I run "show full processlist;" SQL command via SSH terminal, I notice several "sleeping" connections: | Id | User | Host | db | Command | Time | State | Info | +-----------+---------+-----------+...

PHP unexpected result of float to int type cast

I'trying to convert a float to an int value in php: var_dump((int)(39.3 * 100.0)); //Returns 3929 but should be 3930! var_dump((int)(39.2 * 100.0)); //Returns 3920 I can use ceil to make it work but can somebody explain this to me? var_dump((int)ceil(39.3 * 100.0)); //Returns 3930 ...