php5

codeigniter: Where to define members in a model?

Hello, I would like to know what is the best practice to define class members in a CodeIgniter model? Thank you. ...

PHP script works fine until I send it a parameter from HTTPService in Flash Builder 4?

I'm using a PHP script to read an RSS feed in my Flex 4 app. The script works when I put the URL of the feed in the actual script, but I can't get it to work when I try to send the URL as a parameter from a HTTPService in Flex. Can anyone tell me what I'm doing wrong? Here is the HTTPService from Flex 4 that I'm using: <mx:HTTPService ...

I want to add a Page on my Website for Embedding the Youtube Videos just by Submitting the Embedding code in my site in php ?

I want to add a Page on my Website for Embedding the Youtube Videos just by Submitting the Embedding code in my site in php . is there in free script for it. Can anyone provide me the code for Please help Me! Rupali ...

how can we call one class's method through another class's object in php

I want to know that is there any method in PHP by which i can call one class's method from another class object. let me clear here is one class class A() { public function showData(){ //here is method of class A } } // here is another class class B(){ public function getData(){ //some method in ...

PHP code cannot see query string param on return in Facebook oAuth flow

I am doing some integration with Facebook Open Graph using their oAuth flow and having issues with parsing query string parameters they return. On my callback URL, they pass back an "access_token" parameter with a hash (#). so the callback would be: http://mydomain.com/callback.php#access_token=foobar123 where foobar123 is my access ...

What to keep in mind when creating your own custom web services API?

I have created a website which allows users to sign up for, and use, an online service. To help promote the website we will be have resellers who will be offering their own branded services through us. The initial plan is to allow resellers to place registration, login, and lost password forms on their own website and use an API created ...

How to process XML sernt via POST?

I'm receiving XML sent via POST. Naturally I need to parse this XML to get at the goodies it holds for me. However, when I receive the XML is seems that PHP is parsing it like a query string. For example, this xml: <?xml version="1.0" encoding="utf-8"?> <ForgotPassword> <version>1.0</version> <authentication> <login>my...

What's holding up my PHP script?

We've got a PHP crawler running on our web server. When the crawler is running, there are no cpu, memory or network bandwidth spikes. Everything is normal. But our website (also PHP), hosted on the same server, stops responding. Basically the crawler blocks any other php script from running. What could be the problem? EDIT: ** fsockop...

Read a file from line X to line Y ?

Hello, Is there a way to read a file in PHP5 from line X to line Y into a string, without reading the entire file. I would like to return huge files (10,000+ lines) using ajax requests. Each request will provide the client with additional lines. And due to the fact that the file can reach large sizes, I would like to avoid reading it w...

file_get_contents() returns "failed to open stream" when hitting HTTPS

file_get_contents() is returning "failed to open stream" when I call it on an HTTPS URL. Warning: file_get_contents(https://google.com) [function.file-get-contents]: failed to open stream: No error in E:\\htdocs\callback3.php on line 5 Same call will work with a non-SSL URL. At first, I thought it was a security issue with my webhost...

FCKeditor extension in mediaWiki is Throwing Error

Hi, I'm trying to add FCKeditor extension in mediaWiki and I followed all the instructions that are written in their documentation http://www.mediawiki.org/wiki/Extension:FCKeditor_(Official) but it throws me this error. Strict Standards: Declaration of FCKeditorParser::makeImage() should be compatible with that of FCKeditorParserWr...

PHP when display_errors set to 0 500 in AJAX response

Hello All, I have a wired problem. When I set display_errors to 0 on production enviroment then AJAX request to some PHP script returns apache server error 500 and nothing works. When I set it to 1 then response is 200 and everything seems to be fine. Question is what is the connection between display_errors and server error number. I ...

Get root node of XML doc using simplexml

Using simplexml_load_string() how do I get "ForgotPassword" from the following XML? <?xml version="1.0" encoding="utf-8"?> <ForgotPassword> <version>1.0</version> <authentication> <login>username</login> <apikey>login</apikey> </authentication> <parameters> <emailAddress>[email protected]</emai...

Do you guys know of any good File based caching for PHP?

The data to be cached is going to be HTML files and are to be retained anywhere from 3 days to a week. My understanding is that memcached would not be a good solution here since if the server goes down, we lose everything. Thank You ...

Limit the number of cron jobs runnging a PHP script

I have a daily cron job that grabs 10 users at a time and does a bunch of stuff with them. There are 1000's of users that are part of that process every day. I don't want the cron jobs to overlap as they are heavy on server load. They call stuff from various APIs so I have timeouts and slow data fetching to contend with. I've tried usi...

Can PHP Perform Magic Instantiation?

Despite PHP being a pretty poor language and ad-hoc set of libraries ... of which the mix of functions and objects, random argument orders and generally ill-thought out semantics mean constant WTF moments.... ... I will admit, it is quite fun to program in and is fairly ubiquitous. (waiting for Server-side JavaScript to flesh out though...

Is there any way to achieve multiple inheritance in php?

Lets say I have a parent class class parent { } ..... This parent has three sub class class child1 { } class child2 { } class child3 { } and these child classes have further smaller parts like class child1subpar1 { } class child1subpar2 { public function foo() { echo "hi"; } } class child2subpar1 { }...

How to the php setting from php code?

I want to change the php setting but from ".php" page not php.ini. The settings I want to change is upload_max_filesize, post_max_size and memory_limit ...

How to the change php setting from php file?

I want to change the php setting but from ".php" page not php.ini. The settings I want to change is upload_max_filesize, post_max_size and memory_limit ...

php strpos special characters

I'm using PHP Version 5.1.6 I have a string (session file) and need to extract a value from it, so i'm searching for a needle in the string but it returns false, I reduced the code to this: $string = ';SERVER_NAME|s:17:"stackoverflow.com";REMOTE_ADDR|s:13:"69.59.196.211";'; $start = strpos($string, ';SERVER_NAME|s:"'); echo $start; // ...