php

Sending input to the computer programatically

This is just for fun. I'm playing a game where you type A-z as fast as you can, I can't do it faster than in 5 seconds and I think it may be humanly impossible to do it in 1-2 seconds. However, it may be possible to create a small program in Java or Php which, when started, sends the inputs of letter keys A-z to the computer as fast as ...

Newbie PHP question pagination

How would I do so that the page I'm on wont be clickable? $page = (isset($_GET['page']) && is_numeric($_GET['page']) ? (int) $_GET['page'] : 1); $limit = ($page - 1) * 15; $sql = mysql_query("SELECT * FROM log LIMIT $limit, 15"); $totalres = mysql_result(mysql_query("SELECT COUNT(id) AS tot FROM log"),0); $totalpages = ceil($totalre...

how to eliminate a particular category from query

i have been presented with this code. the code displays the title headings of the latest 10 wordpress posts from the database. what i need to do is to eliminate a particular category from this. can anyone please help? <?php require_once 'news/wp-config.php'; $howMany = 0; $query ="SELECT `ID`, `post_title`,'post_category...

What's faster/better to use MYSQL md5 FUNCTION or run md5 php function ?

i check password of users against the db. what is faster check it in mysql MD5 function ... pwd = MD5('.$pwd.') OR in PHP ... pwd = '.md5($pwd).' or what is The Right Way Between two options ? thanks ...

PHPDoc documentation generator in or out of Eclipse?

I am developing with Eclipse + PDT. I've been adding phpdoc comments into my code, but actually never generated a resulting documentation in Eclipse. How should I do it - is there some functionality in Eclipse, or doc generation should be done externally? ...

PHP: Difference include/eval

If the code is the same, there appears to be a difference between: include 'external.php'; and eval('?> . file_get_contents('external.php') . '<?php); What is the difference? Does anybody know? I am actually pretty sure there is a difference. I just found out. I have got a large piece of ugly generated php in my database*. By cre...

jquery affixing display: block

Hi, I have a message board, and I have some code that loads new messages automatically as they arrive. I have, addtionally, the following code run on all board posts. $(".old_post").hover(function(){ $(".post_right_nav", this).show(); $(this).css({ 'background-color': '#E6E6E6' }); ...

Fetch MySql database from cocoa app - PHP bridging [Solved]

Hello to everybody, I'm trying to download a range of rows from my MySql database, through a cocoa app that I'm developing! To do all more easy, I use a php that receive an index from my app and send back all the rows up to that index. So, my cocoa code is: NSInteger index = 0; NSString *urlString = [NSString stringWithFormat:@"http://...

Detecting whether a form has been submitted with PHP

I'm looking for a clean way to handle forms with PHP that does validation and caching of data, but doesn't require mixing PHP with the form HTML. Basically, I want to be able to write a form in pure HTML and intercept that form on it's way to it's destination, process it and either let the data go happily on it's way, or return to the fo...

How do I detect groups of common strings in filenames

I am have been trying to figure out a way I can detect series of files. For instance: If a given directory has the following files: Birthday001.jpg Birthday002.jpg Birthday003.jpg Picknic1.jpg Picknic2.jpg Afternoon.jpg. I would like to get the condense the listing to something like Birthday ( 3 pictures ) Picknic ( 2 pictures ) ...

Create dynamic xml and send it with php class

Hello, my question is how I can send clean xml from this class. It is simplified, so there is the least off trouble that could have been caused by other things. The problem now is that the error says that the xml declaration should occur at the top off the document. What is the right way to avoid this kind off errors? Is there some php...

SQL in PHP Inserting Two Rows Instead of One

The following code is inserting two records into my database, but I only want it to insert one. Why is it inserting the row twice? <? if (!$con) { die('Could not connect: ' . mysql_error()); } $i=1; while($i<=1) { if (isset($_POST['submit'])) { $sql="INSERT INTO customers (company, salutation, f...

Detecting AdBlocking software?

I was recently visiting a site and noticed that the page had a section that said it noticed that I was using AdBlocking software and could I kindly turn it off to help support a small site like that. I was just wondering how you would do that? Would it be best done client-side or server-side? ...

Find with php specific parameters in XML

Hello i have the follow problem. I have e XML file and i know the value of "uniquename=value2". I want extract the value of URL. <set uniquename="value1"> <items> <item> <units> ... </units> </item> <item> <units> ... <url>http://www.something&lt;/url&gt; ... </unit...

Packaging Algorithm

Good Day! I'm trying to see if there is any way to accomplish this. I've got a set of items, with associated attributes (Weight, Length, Width). I've also got a set of Packaging Types, with associated attributes (Max Weight, Length, Width) I'm looking for an algorithm to determine the LEAST amount of boxes to package the items into. ...

How would I log searches on my PHP/MySQL website?

When someone searches my website using a quick search feature I would like to log this into my database Obviously I want to see what my users are searching for I can create a 'tag cloud' based on these searches I have a table searchterms at the moment with two fields: id and terms, I was wondering if this was the best method of loggi...

plug and play php/mysql user management/login/security system

Can anyone recommend a plug and play php/mysql software that will enable me to manage users, protect pages, prompt for logins, handle lost passwords, store their info such as name/addy/email etc. Anything like that exist? Preferably, id like it to be as easy as including a file in my existing pages to make them a part of the system. ...

Zend_Auth: why authenticate object named adapter and not strategy?

$Zend_auth->authenticate($adapter); Why is it called an adapter and not a strategy? ...

PHP Session Data Not Being Stored

I'm making a login system, but when a user logs in, it doesn't actually store any of the data i want it to in the session. I even checked the session's file, and it was empty. I have session_start(); on all the pages. what else could i be doing wrong. Heres the code for the two main pages. the login code: <? if ($DEBUG == true) { e...

Is the Silverstripe CMS as easy to deploy, maintain, and develop on as it appears?

Although I haven't thought about deploying it on my own site, someone I know sent me a link to a CMS called SilverStripe that I've never heard of before. I read their site, looked at and played around with their demo, and so on. It looks like it's a CMS backed by a custom PHP framework that they call Sapphire. And from what I can gather ...