php5

PHP fread problem

hi guys, ive ran into an issue while creating a PHP telnet script at work to gather network data. as the amount of data returned from the 'Action: Status' command could be of any size... im concerned about using a static number with fread() on line 13. I have also tried using fgets() instead but it only grabs the first line of data (t...

find by column name cakePHP

Hello I have been trying to understand how to get data from model by the name of field. I am using cakePHP, and I need to retreive a column's data from a table. The syntax is > "select name from permissions" So I tried to find out on book.cakephp.org, so I got the field function, but that only gives me the first value, while I have mo...

How do i know timezones - PHP

How can i know the current time at different places example:- Local time in America & london wud differ 1) So if a user from USA visit my website, I should be able to show him his local time 2) If a user from London visit my website, his/her local time should be populated how can i solve the above issue ?? Thanx for the help... ...

Can I save credit card secret code in the database ?

I need to save the credit card numbers and secret codes of users in the database in plain text ( consensus behind obviously ) for automatic operation made from the server. Is there some problems ? What do I need to be aware of? ...

PHP - File_get_content error

Hey, I have tried hosting it on a VPS/web Host and some VPS it works my script and some it gives this error: Warning: file_get_contents(http://xip.xxxxx.org/xxxx/../aaaada23.php?user=rawr&host=127.0.0.1&port=3074&time=10&ip=127.0.0.1&power=1) [function.file-get-contents]: failed to open stream: A connection...

How Can I access the first result?

$tmp = mysql_query("SELECT commercial FROM Channels WHERE name='".mysql_real_escape_string($_POST['name'])."'"); while( $row = mysql_fetch_assoc($tmp)) { echo $row['commercial']; } I only want to access the first element. not in a while loop Please Help ...

get all class constants

Is there a way to do get all the constants in a php class. Tried get_class_vars( get_called_class() ) class Status { const PUBLISHED = "published"; const DRAFT = "draft"; public static function get_types() { return array(self::PUBLISHED, self::DRAFT); } } Thanks ...

Rename "web" folder in Symfony 1.4

I want to rename the "web" folder to "html" in symfony 1.4, unfortunately searching for documentation on this has lead me nowhere except for how this would be accomplished in 1.0, which does not seem to be working. ...

Zend Framework - How do to preDispatch for all controllers?

I cant load this plugin how can i load this? I have IndexController.php and I have OthersController.php. For all those controllers, to have 1 single preDispatch method i wrote a plugin as following. Can you please guide me kindly, how i can now attach this with all other controllers??? @file: application/controllers/GlobalControllerPlu...

Characters with accents keep appearing as "�"

I'm using a simple php script to scour an RSS feed, store the scoured data to a temporary cache flat file, then display it along the side of my website. However all the characters with accents appear as "�" What is causing this and how can I fix it? Thank you! ...

"SMTP Error: Could not authenticate" in PHPMailer

Hi Everybody, I'm Using PHPMailer in a Simple Script For Send Email's Through Gmail, And I'm Getting an "Unknown Error" (At least For me!): SMTP Error: Could not authenticate. Error: SMTP Error: Could not authenticate. SMTP server error: 5.7.1 Username and Password not accepted. Learn more at 535 5.7.1 http://mail.goo...

Why isn't my query outputting the expected results?

CREATE TABLE IF NOT EXISTS `Channels` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(30) NOT NULL, `commercial` tinyint(1) NOT NULL DEFAULT '0', `usrid` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; INSERT INTO `Channels` (`id`, `name`, `commercial`, `u...

Testing Response Time of PHP

Hi all, For my research purposes, I have modified the php sinterpreter and I want to test the response time of the new modified interpreter. So I am looking for a script that would help me achieve my objective. I could simply request for a page which records start time and the end time but I want to measure the average time taken...

Drupal function db_query() stores overflow value for INTs that are not too large

I have this code inside of a exit hook in a custom module: $diff = round(((microtime(true)-$script_start_time)*1000)); watchdog('thaty', $diff); if(variable_get('thingy', 0) == 1) { $data = array( 'q'=>$_GET['q'], 'memory'=>memory_get_peak_usage(), 'execution_time'=>$diff ); d...

mod_php vs cgi vs fast-cgi

Hi all, I have been trying to understand the exact meaning/purpose of loading php as an apache module vs the rest. When php is installed as an apache module, what exactly happens? For example, does reading the php-ini file happen every time the php request comes or when the php module is loaded alone? ...

beforFilter in codeIgniter

What is the best way to do and equivalent to CakePHP's beforeFilter() in codeIgniter ...

don't replace some occurences using str_replace

i have a string like this "{text}...{text}...{text}...text..." i need to replace the "text" value in the string but only the ones that are not in currly or square brackets ...

How to use a php script to grab rss feed content

I want to grab the RSS feed content from a site and display it in my website with different filtering options. Can anyone put a php script which can grab the content from there and show ...

PHP - Logging into many MSN's

Hi, In PHP what method or way would you use to login into many different MSN accounts? I researched and its SOCKETS/fopen related stuff. I could load up the MSN accounts via MYSQL. Post your method and thanks. ...

How to connect PHP with Oracle-xe server when both reside on the same pc

Hay I ve installed oracle-xe 10g sever version on ubuntu desktop 10.10 32 bit. for installation i ve followed the these steps: [https://help.ubuntu.com/community/Oracle10g] Now im working with my dbms. its just working fine. for php setup i've followed this: [http://netbeans.org/kb/docs/php/configure-php-environment-ubuntu.html] now ...