php

Best way to get a random word for a captcha script in PHP

I am working on a new captcha script and it is almost completed except I would like to have a list of words for example lets say I have a list of 300 5 letter words that I would like to use for the captcha image text. What would be the best way for performance on a high traffic site to deal with this list for it? Read the words fro...

Bundling PHP MySql with Flex to be given to a client

I made an application using Flex,php,mysql. Now to give it to a client, I am bundling this flex application with xampp. There are few problems with this approach : 1. Whenever the flex application runs, an xampp window also opens up. 2. The Apache port number, which I am giving to the client is fixed. Same for mysql port number. What...

Optimizing Google Calendar PHP Code for speed (Zend_GData)?

Hey everyone, I am using the Zend_GData Package to connect to a Google Calendar and do various things such as add/edit/delete events. However, I find that these are pretty expensive operations, and can sometimes take a visible 4 seconds to complete. I was wondering if there is anything I can do to optimize my code and make it faster? Her...

ajax library that populates multiple fields

I'm trying to speed up the data entry for my awards database. My "people" table currently has five fields: peopleid first middle last display So an entry might be: peopleid 120 first William middle H. last Macy display William H. Macy Is there an AJAX library that you can suggest that would enable someone entering the data...

query two tables in one mysql query

im having trouble getting data from two seperate tables so far i have this <? include('config.php'); $xid = $_GET['xid']; $result = mysql_query("SELECT * FROM `config`") or trigger_error(mysql_error()); while($row = mysql_fetch_array($result)){ foreach($row AS $key => $value) { $row[$key] = stripslashes($value); } $result = mysq...

How to return a string from a function in PHP

I have an array of delimited values that I want to show the user such as: [delimCC] => Array ( [0] => 3; [1] => 4; [2] => 5; ) WHat I need, is: 3;4;5 (a string). How can I take the output of this array and make it a string? Thanks! ...

How to handle multiple actions using a single html form

I hope I can be clear enough in what I need here. What I have is a function that contains some html for an email client app I'm developing. This part of the app uses a common forward, reply and "reply to all" form. Since they are all basically the same, I figured I'd go the lean route and just use a single function to handle this. The on...

How can I prevent submition of registration page if all required fields are not filled in?

I don't know in my site someone register without filling whole required detail.Though I have javascript validation on my registration page also have captcha.what should I do to prevent this type of illegal registration? ...

Unable to call the built in mb_internal_encoding method !?!

I'm trying to install indefero on a CentOS 5.3 VMware 'box' and I ran into a problem. Quite early in the installation I get an error that I've been able to narrow down to this: [root@code /var/www/html]# cat x.php <?php mb_internal_encoding("UTF-8"); ?> [root@code /var/www/html]# php x.php PHP Fatal error: Call to undefined func...

XMPP SASL authentication on Ejabberd with PHP

I'm trying to authenticate with an XMPP server using SASL. /** * Send Authentication, SASL * @return Bool * @param $username String * @param $password String */ function authenticate($username, $password) { $this->username = $username; $this->password = $password; var_dump($username, $passwo...

How to watermark GIF image with 24-bit PNG with transparency in PHP?

Hi! I am creating a script that can put a 24-bit transparent PNG image as a water mark on JPG/GIF/PNG images. So, far i had success with JPEG and PNG. But how can i achieve same with gif files? for GIF files, watermark do appear, but without transparency. Please help. Thanks, Anjan ...

flowplayer with rssfeeds

Hi, I have rssfeed website on which I have put some video/audio podcasts . How can I embedded flowplayer so that it can show small icon for video to play with each link of podcast rssfeed. If any one know this Please help me. Regards, lnj. ...

PHP pass by reference in recursive function not working

I have two functions that I'm using to add or remove slashes from a deeply nested object/array combo. The first "level" of the array is always an object, but some of its properties may be arrays or objects. Here are my two functions: function objSlash( &$obj, $add=true ) { foreach ( $obj as $key=>$field ) { if ( is_object( $field )...

Basic php class problem

Bear with me cos I'm new to oop! Is it possible to assign the result of a function to an attribute? This probably doesn't make sense so here's what I think the code might look like! Class b extends a { public $conn= $this->connect(); public function operation() { ...} } connect() is a function from class a that connects ...

Best method to input and validate custom datetime in PHP form

This is a double question in terms of front end usability and PHP DATE_TIME validation. I am working on a site for a client who would like to add the date he finished a project (so the projects can be listed in that order). He will be the only one using the admin interface, so I would like it to be as simple as possible. I am storing t...

Help with Regex - Wordpress (search-regex)

My first attempt using RE has me stuck. I'm using Regex on a Wordpress website via the Search-Regex Plugin and need to match on a specific " buried within a bunch of html code. HTML example: provide brand-strengthening efforts for the 10-school conference.&#0160; </p> <p> <a href="http://www.learfield.com/oldblog/.a/6a00d8345233fa6...

Ajax library for PHP

What's the best Ajax library for PHP and why do you prefer it? ...

Help with regex

I'm looking for a regex that will recognize # followed by a number in a string and make it clickable. Only if its # and a number like ex: #758 and make i clickable. Not # 758. Youtube has this for example. Would really appreciate if someone could give me some hints since im worthless on regex. ...

How to correctly formulate a 3 table mysql query

I need the best way of performing the following task. If possible, take it all the way down to giving me variables for output so i can better see whats going on, a lot of times you guys assume im smarter than i am. Table 1, holds user information, first and last name, email etc. The primary auto_increment key in table 1 is id. Table 2, ...

How to make php script delete itself (and includes dir)

How do I make script delete itself after it'll finish its work? edit: It's for my installation script, I want it to delete itself for security reasons (so attacker won't be able to overwrite existing site). I forgot to mention that it has its 'includes' directory that i would like to be deleted too... Could someone add how to also del...