php5

PHP5 SOAP XML into Array

I currently have a return from a SOAP call. <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"&gt; <soapenv:Body> <ns:getMakeResponse xmlns:ns="http://ws.fds.com"&gt; <ns:return> <ResponseCode>000</ResponseCode> <ResponseDescription>No Errors</ResponseDescription> <MakeRetur...

What's the problem with mysqli in php5?

I used to code in php4 but now I switched to php5 and the following code throws the below exception. Why is that? CODE: $mysqli = new mysqli($CONFIG_DB_HOST,$CONFIG_DB_USERNAME,$CONFIG_DB_PASSWORD,$CONFIG_DB_NAME); $result = $mysqli->query("select * from temp_table where url = '" . $mysqli->real_escape_string($in_url) . "'"); $row = $...

Jquery Caching issue?

I have a php function that called admin_head() which basically includes the css and jquery files. function admin_head() { ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US"> <hea...

Howto create a Calendar in Php?

How can i create a calendar in PHP? Today should be in bold. How could it be coded? ...

PHP: an example where allow_url_include is a good idea?

I just noticed a PHP config parameter called allow_url_include, which allows you to include a PHP file hosted elsewhere as you would a locally. This seems like a bad idea, but "why is this bad" is too easy a question. So, my question: When would this actually be a good option? When it would actually be the best solution to some proble...

Get value from remote page and store as local variable.

I have a page on a remote server that returns a single xml value <?xml version="1.0" ?><Tracker>12345</Tracker> How do I go about getting the value 12345 or whatever is in the tag into a PHP variable? I know I can't do something as simple as: <?php $var = http://www.www.com/file.php; echo $var; //12345 ?> I'm new to the ...

Pagination of Multiple Models in CakePHP 1.2.5

I'm working on a view for a blog that mixes blog posts, comments, and uploaded media items into one large grid layout. I've set up the individual models in CakePHP and the associations, some of which are as follows: Comment BelongsTo Post or Media Post HasMany Media What I'm working with is trying to sort all three models (Comment, M...

Voting eachtime sets to 1 How to solve this?

Each time i vote up or down it just sets an 1. But i want that votes_up=votes_up+1 inkrements eachtime i vote up. this is php code public function voteUp($id) { $this->initDB(); $q="update twitter.tweets set vote_up=vote_up+1 where id=$id"; $this->db->query($q); } the result is Down Votes:1 Up Votes:1 Total Vot...

php htmlentities to decode textarea

Hi, I have a text area and I would like to take the input of the text area and merge it all together. Everything works fine except that it's escaping the quotes. For example test's is outputted as test/'s To fix this I tried htmlenttries such as, <?php $inputtext= $_POST['textinput']; $encodetext = htmlentities($inputtext); ...

PHP - MVC framework?

Hi there, I am just starting out in the PHP world. I have used asp.net mvc and come from a VS 2008 background.. I looked at PHP and it seems that a lot of the code is mixed in with the html... so I was looking for something to manage separation... I found http://kohanaphp.com/home but being a complete beginner in this i am unsure if...

Undefined variable after using require_once

I have created a Page class and all the pages on my website are objects of that Page class. Each Page object has a title attribute which is passed in as an argument to the constructor and so creating a new Page object looks as follows. <?php require_once('library/Page.php'); $page = new Page('About'); $page->header(); This is where...

alert message when database updated

I am creating a Chat application in php. AIM: when a user1 invites user2, user2 want to get a alert or popup message that user1 has invites him. What i have done is - When user1 invites, the message is stored in database. In user side i used to check whether Database is updated or not. If database is update i used to show alert. Thi...

What's the recommended way of running Java from PHP 5.2?

I want to call Java from PHP 5.2, running either on a webserver or from a command line script. From PHP 4, this seems to be simple, and just involves installing the PECL Java extension. Example code from the PHP 4 extension: <?php // get instance of Java class java.lang.System in PHP $system = new Java('java.lang.System'); // d...

Difference between user and system caches using PHP APC.

apc_clear_cache [http://php.net/manual/en/function.apc-clear-cache.php] has an option to send in 'user' which will delete the apc user cache, or else if not present, the system cache. Which is better? I don't understand the difference since there's no way to explicitly store a value in one cache over the other via apc_store/apc_fetch. ...

SHA-512 library for PHP

I am searching for any crypto library that provides SHA-512 hash. Googling around I found some but SHA-512 is absent. Please suggest. ...

get all followers with twitter

How can i get All my followers with one request? If i do $this->twitter->getFollowers(); I just get 100 of my followers; An here is the code for getting followers /** * Returns the authenticating user's followers. * * @return array * @param string[optional] $id The id or screen name of the user for whom to request...

Best way to access global objects (like Database or Log) from classes and scripts?

I've read some related questions (1, 2), but none seemed fully adequate. What's the best way to access globally important objects in each class or .php script? A few examples: DB (database) Cache (memcache wrapper) Logger (custom) CurrentUser (details about the currently logged in user) Some options I've seen include: Relying on ...

How can i tell if a MySQL query returned nothing in PHP?

Question title says it all. I'm using PHP5 and MySQL. EDIT: I'm using mysql_...() functions. ...

Header redirect and Session start() generating errors

I am using following code. I get errors: Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/mc/cpanel/Source/verifylogin.php:11) Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/public_html/mv/cpanel/Sou...

Zend_Log in application.ini

Hi, is there any example how to setup an instance of zend log from application.ini? I have only found an example for logging to an file, but i want to log into an SQLITE database table? Zend Log resource ...