php

encryption with php

how can i encrypt things with php using a key? I would prefer not to have to install Mcrypt. I also need the encryption to be pretty strong. ...

Can I get a little help on this php/javascript voting code?

Hi folks, This is a continuation of this question: http://stackoverflow.com/questions/1987811/move-div-based-on-user-voting I first posted the question as an unregistered user, and then later registered, so I couldn't edit or add to my original question... Justin Johnson really helped me out with the code, but I'm still having a proble...

PHP Payment Library

Is there a simple PHP payment library that can handle multiple payment gateways? I don't mind processing the payment at the payment gateway website rather than on my site and don't want to store CC information in my site, but I want the flexibility choosing the gateway without changing the code (or little change). ...

PHP: filename without file extension- best way?

I am trying to pull the filename out of a directory without the extension. I am kludging my way through with the following: foreach ($allowed_files as $filename) { $link_filename = substr(basename($filename), 4, strrpos(basename($filename), '.')); $src_filename = substr($link_filename, 0, strrpos($link_filename) - 4); echo $src_...

Should using cookies be avoided if it's possible?

Is it slower to retrieve a user's cookie and get its value as a PHP variable, than it is to retrieve a session variable? ...

PHP comparison confusion

// today is 03 Jan 2009 $datemonth = (int) date("md"); if($datemonth == 0103){ echo "Match"; } else { echo "Not a match"; } I am receiving Not a match as result. Isn't 0103 equal to 103 when compared as integer? In this situation I can use if($datemonth == 103) for the intended behaviour. But why the logic is failing? A leadin...

joomla's hwdvideoshare module help

hi! i using hwdvideoshare module in joomla and i can't use the Method 1 for Direct Video Conversions. it requires the following things to be done: * The exec() function need to be enabled in PHP. * safe_mode must be set to Off. You can check that at Joomla Help -> System Info -> PHP Information) * php-cli (Command Line Interface to PHP...

How to 'explode' this page output

Hi, I'm trying to parse the output of this page -> http://master.anti3d.com/raw_server_list2.php The documentation of that master server says that every entry is separated in this way Note: LF = LineFeed = 10 Format: serverName[LF]ipAddress:port;users/maxusers;gameCount;version;location[LF] Example: Server Name1 ...

MySQL Query - Comparing rows with outside data

Ok, I have an array outside of the SQL database in the following format: $currStats['USERNAME'][SKILL NUMBER][1-3] Username obviously pertains to a specific user, skill number is the number of the skill and 1-3 is either XP, rank or level. So $currStats['Jimmy93'][0][1] would return the Overall (Skill #0) level of Jimmy93. Now, that ...

CodeIgniter routing problem

Hello , I'm trying to build a short uri service with CI just so i can learn CI faster anyway .. i got stuck at the routing i hid the index.php then added the following route $route['([A-z0-9]{4})'] = "/forward/redirect/$1"; but it just shows my default controller i also tried with htaccess RewriteBase / RewriteCond %{REQUEST_FILE...

How to search an array key by matching a string in it's value

Hi, I'm trying to find the key number in a array matching a string. I tried array_search in this way $key = array_search("foo", $array); echo $array[$key]; but that prints $array[0] Is there another way to do this? Thanks :) ...

How to ensure that one time is always less than another.

I've got two times that need to be stored into a database. The time format is hh:mm:ss with NO DATE. These times can be changed by the users on the system. One is a time on and the other is a time off. The time off should always be greater than the time on within a 24 hour cycle. Here is the part that I'm having trouble with. I don't wa...

After I authenticate a user in API how should I make sure they don't have access for too long

I am working on builing an API and application section on a social network so it will be something like myspace, facebook, hi5, friendster, netlog, and many other's have application section, they all use a REST server method and most of them will issue a api key and secret to each application developed. The person who builds the app wil...

How to Conduct an online coding competition?

I need to design a website for a programming competition event. It will be similar to TOP CODER competitions. User will be given all questions & then user submits the code, that will be running on the server and checks if it gives the correct solution or not. The first one to finish all the questions is the winner. I've no clue about ho...

Code generation tool/framework for PHP

As far as I know, many PHP frameworks use syntactic sugar to provide illusion of real functions. Some provide scaffolding/skeleton generation, which is limited. Syntactic sugar is slow and IDE/editors do not provide intellisense for Syntactic sugar functions/methods and member data. I'm wondering if there any tool/framework to generate P...

Divs according to mysql result in a loop

First off, sorry if the title is confusing! I'm working on a part of a blog that determines how lists of recent posts (sometimes determined by a date) in a category are to be displayed. In the database, each category has a "type" set that determines whether the div it goes in is small or large. I can get the results to display but each ...

reloading page content with <select> php ajax

here is my code... <select id="load"> <option value="page1.php"></option> <option value="page2.php"></option> <option value="page3.php"></option> </select> <div id="content"</div> i want to load these page1.php, page2.php and page3.php via jquery ajax and php in content div... ...

PHP Twitter Search API

Im looking for a way of running a Twitter Search (Automated via CRON) that will search for a list of terms held in a text file. Once it finds those terms I want it to write to results to a text file. Can anyone suggest anything? Simpler the better. Edit Seems I may not have been too clear, I want to be able to Search Twitter, based...

What does this mean in php.ini?

assert.active = On assert.bail = Off How does it work? ...

Get count of missing links in MediaWiki?

How can I get the number of missing links that are in my Wiki? We have a lot of articles about all kinds of things that haven't been written or stubbed yet, but we want to provide a progress bar so the community can see how close we are to being more complete. You can see the wiki here: http://worldeditor.org If you have any tips relat...