php

a log-out hyperlink in PHP ?

Hi, In case somebody knows, how can I make a hyperlink in PHP... <?php echo( '<a href="index.php">Log-out</a>' ); ?> that would not only to navigate to the first page, but also remove cookies? Thanks! ...

Adobe AIR & PHP + MySQL

Hello. I am looking for a possibility to run a PHP + MySQL solution on a desktop. Can Adobe AIR accomplish that for me? Will the setup be able to access the COM port of the computer? ...

Perl equivalent of PHP's preg_callback

Do we have a preg_callback equivalent in Perl ? Lets say I want to match something and replace it with the return value of the function that is called with the matched thing. ...

Would it be simply better to use the system's functions rather than use the language?

There are many scenarios where I've questioned PHP's performance with some of its functions, and whether I should build a complex class to handle specific things using its seemingly slow tools. For example, Complex regular expressions with sed and processing with awk would seemingly be exponential in performance rather than making PHP's...

Needed list of special characters classification with respective characters

I am working on one web application , It's related to machine translation support i.e. which takes source text for translation and translated in to user specified language Currently it's in unit testing phase. Here, i want to check that, whether my machine translation feature is fully working for all the special characters. Because of ...

Open a popup window

Hi, Can i open a new window after execution of some code(ie at some point of time before completion i need to open a new window in zend.Can i do this? Also how can i check the size of a remote file. Thanks in advance......... ...

Changing the status of a field in PHP after a period of time

Hi, For example I made a reservation for a restaurant and it expires in 24 hours. In the reservation table of the db (MySQL), how do I automatically update the status to expired after 24 hours? What approach would you guys suggest? Thanks in advance! ...

From where to send mails in a MVC framework, so that there is no duplication of code?

It's a MVC question. Here is the situation: I am writing an application where I have "groups". You can invite other persons to your groups by typing their email and clicking "invite". There are two ways this functionality can be called: a) web interface and b) API After the mail sending is over I want to report to the user which mails ...

How to make the first char of a string lowercase in PHP?

I cannot use strtolower as it affects all char. Should I use some sort of regular expression ? I'm getting a string which is a product code, I want to use this product code as a search key in a different palce with the first letter made lowercase. ...

how to implement enhanced session handling in PHP

Hi, i'm working with sessions in PHP, and i have different applications on single domain. Problem is, that cookies are domain specific, and so session ids are sent to any page on single domain. (i don't know if there is a way to make cookies work in different way). So Session variables are visible in every page on this domain. I'm trying...

4 Minute Delay Between New User Registration and Receipt of Activation Email

Hello, I am using a PHP/MySQL login script that sends a new user an activation email. When a new user registers, the info is put into MySQL pretty much instantly, but then it takes about 4 minutes for the activation email to arrive in the new user's inbox. It seems like sites like Facebook and Twitter can get out an activation email i...

Calculate actual time from different timezones in php

Hai, I would like to calculate actual time from different timezones. I have two mysql tables 1.Timezone table: This table contians two fields (offset value, country name) values are ( -12:00, Eniwetok, Kwajalein) (-11:00, Midway Island, Samoa).... so on 2.My employee table This table contains the employees details with two field ...

Codeigniter Form Validation - how to unset form values after success?

I realise this request goes against the example provided in the CI documentation (which advises a separate 'success' page view), but I would like to reutilise a given form view after a form has been successfully submitted - displaying a success message then displaying a blank form. I've tried a few ways unsuccessfully to clear the valida...

Prepare and import data into existing database

I maintain a PHP application with SQL Server backend. The DB structure is roughly this: lot === lot_id (pk, identify) lot_code building ======== buildin_id (pk, identity) lot_id (fk) inspection ========== inspection_id (pk, identify) building_id (fk) date inspector result The database already has lots and buildings and I need to ...

Problem with regular expression for some special parttern.

Hi all, I got a problem when I tried to find some characters with following code: $str = "统计类型目前分为0日Q统计,月统q计及287年7统1计三7种,如需63自定义时间段,点1击此hell处进入自o定w义统or计d!页面。其他统计:客服工作量统计 | 本周服务统计EXCEL"; preg_match_all('/[\w\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A]/',$str,$match); //line 5 print_r($match); And I got error as below: Warning: preg_m...

php if array key exists inside multidimentional array

how can i check if logo exists in this array called $attachements print_r is below: Array ( [logo] => /home/richar2/public_html/ioagh/images/stories/jreviews/20100510115659_1_img.gif ) when theres no logo, the array print_r's Array ( ) i tried: if (isset($attachments['logo']) ) {..} but the conditional code runs when ...

Codeigniter not returning me to upload form after image upload.

I'm still very new to codeigniter. The issue i'm having is that the file uploads fine and it writes to the database without issue but it just doesn't return me to the upload form. Instead it stays in the do_upload and doesn't display anything. Even more bizarrely there is some source code behind the scenes that appears to be the message ...

Testing for security vulnerabilities on web applications

A lot of companies use CMS software that updates on the regular, often they are security fixes, implying that the previous version have security vulnerabilities. But most clients never upgrade this, or even the CMS has been modified so that an update would break the site. Are there sites that document these exploits, and instruct how to...

Loading var from PHP script using flash

Hi All, I am trying to get a var from a PHP script running on my web server and from every forum post I have read, what I am doing should be working. I have the following: var lvContent = new LoadVars(); lvContent.load("http://{MY_DOMAIN}/Includes/getID.php"); trace("ID: " + lvContent.pageID); The problem is th...

php array filter

Hi i would like to filter array in php. for example $a = ARRAY('a', 'b', 'c', 'd', 'e'); $b = ARRAY('c', 'd'); $a will be filtered by values in array $b and result is ['a', 'b', 'e'] may I know how to do it in php? Thank you. ...