php

PHP Auction Expiry Tracking

What is the best way to send e-mails or perform functions on a small, non-real money auction script? This script is a learning exercise for me and I was wondering what the best way would be to process actions when the auction has expired. A cron job every minute seems - to me - a method which can easily be surpassed. ...

php:create report

Hi, I want to create report using php. This is file : Some text, 10/07/2010 04:32 Some text, 10/07/2010 04:32 Some text, 12/07/2010 04:32 Some text, 13/07/2010 04:32 Through UI we are entering Start and end date. I have to create report based on that date. How can i do that ...

Retrieve the key value from a arrayObject

This is my array: ArrayObject::__set_state( array( 'data' => array ( 'key1' => '573779', 'key2' => 'REF12345', 'key3' => '2010-07-12', 'key4' => '0000-00-00', 'key5' => '2010-07-12', 'key6' => '21654', 'key7' => '0', 'key8...

How can I do this with .htaccess

Hello. I was writing a PHP (Kohana) app and I saw that the controller index pages could be seen with & without /index. http://plugb.com/ & http://plugb.com/index In order to avoid duplicated content, I did this: $clean_url = str_replace('index','',$this->request->uri); if($clean_url !== $this->request->uri) { $this->request->redire...

mysql phpmyadmin user password for database

i am using phpmyadmin; i created a database; now i want to locate the username and password for this new database i created. note, i am not sys admin, i am only the developer, but i do have access to create db on mysql in phpmyadmin. does my sys admin needs to tell me the username and password to access this db, or i can telnet and get i...

the dreaded UTF-8 BOM

I read your answer to reformat php files used by includes and it did remove the problem. My question is we are working on a web site that needs to display different laguages, will this be a problem? Thanks Conrad ...

PHP and Excel rounding off

I have an excel sheet that has number in cell that are formatted as #,##0.00.. Now, when I try to calculate those values using php round() function as round($number,2) , sometimes, the values are not exactly same, difference comes in the 2nd decimal place. What can be the problem? Has anyone experienced the same? ...

Problem with ereg deprecated

Can some please help me to rewrite these code: if (eregi($asked,$accepted)) { $this->plot_type = $which_pt; return true; } else { $this->DrawError('$which_pt not an acceptable plot type'); return false; } Any help will be highly appreciated, I have tried all the fix I got through Google but none has been able to fix it. Thanks. ...

Best practices for externalizing strings in PHP

I've been surprised by how little I've found on externalizing strings in PHP. Does everyone use gettext, or is there some other framework or tool that I'm not aware of? ...

Recommend a lightweight ORM / Active Record Library

I do not mind which pattern is used. I am just looking for something that is: 1) Lightweight 2) Under active development 3) Well documented 4) Supports MySQL Can anyone recommend anything? ...

Break out out forloop but within switch statement php

When I normally want to break out of a foreach loop before all of the iterations have completed I simply use a break; statement. e.g. foreach($nodelist as $node) { if($metCriteria) { break; } } But my next example has a switch statement in it. And if one of the conditions are met then I need to break from the foreach loop...

How to join RSS feeds into one? (from php)

How to join RSS feeds into one? (from php) what libs can help us with it? ...

Localhost extensions check

Hi. I have to install big CMS on my localhost, but it requires mcrypt, and pdo_mysql. Before I've tried to install them, I've tried to access site, but I only got blank page. I'm running apache on windows, so I heard that I have to keep dll's in php extension folder. I've downloaded from dlldll.com (it's not ad) files php_pdo_mysql.dll,...

Please recommend a smart, elegant way to write these repetitive 'if' statements in php

Hi PHP users, I just know i'm doing this in really bad way: $url = wp_get_referer(); $path_parts = pathinfo($url); $mycat = $path_parts['filename']; if ( $mycat == "animation" ) { $_SESSION["theCategory"] = $mycat;?> <a href="<?php bloginfo('home')?>/c...

3array bring output in table php

Hi, I have three arrays: $arr_student_name = array('bharani','vasanth','kumar'); $arr_student_dept = array('CSE','ECE','EEE'); $arr_student_year = array('2','3','4'); I want output something like this, Name Dept Year Bharani CSE 2 vasanth ECE 3 kumar EEE 4 How to build the output somthing like above? Ea...

What to learn - ASP or PHP?

From what I've read (I've probably misread, that would be so typical...) PHP and ASP have almost the same features and are pretty equal when it comes to difficulty level. I would like to learn one of them to start with - then I can always learn both... My question is: PHP or ASP? Why (example) PHP instead of ASP? What features does (a...

Is PHP socket a viable option for making PHP jQuery based chat?

Hello all, I am developing a chat module for drupal. I plan to provide multiple backends for chat message processing. I initially started with AJAX and have now included long polling technique in it. Then I came across ape(ajax push engine) and it looks promising. But it will require server side installation of ape for the chat module t...

How do I skip a process or function if it doesn't give a result within fixed time??

In PHP I have seen that if a certain process or function isn't completed then the entire application which includes that function get delayed due to that. Say there is a search function which returns lots of result which includes more than 20 functions. An "x" function is taking too much time, hence the result page is getting delayed du...

Issues posting XML over SSL using PHP

I having trouble posting XML to a payment gateway using PHP. The gateway (PSiGate) gives this sandbox url to POST XML to: https://dev.psigate.com:8645/Messenger/AMMessenger Here the code: if (isset($_POST) && $_GET['task'] == 'new') { $dealer = new Dealer($USER->getDealerId()); $contact = $dealer->getContact(); // new PSiG...

how to avoid bot attacks on form

i have these forms: https://www.mychabad.org/templates/articlecco.asp?aid=1188756&amp;jewish=General-Contributions.htm&amp;lang=en&amp;site=chabaduc.org https://www.mychabad.org/templates/articlecco.asp?AID=1189379 https://www.mychabad.org/templates/articlecco.asp?aid=1189287&amp;jewish=Shabbat-Holiday-Sponsorships.htm&amp;lang=en&amp...