php

Returning %40 to an @ symbol

dev%40bionic%2Dcomms%2Eco%2Euk I want to turn the above back in to readable text. Can anyone tell me how? Thanks EDIT Forgive my oversight, PHP is the language of choice! ...

What's the best to way to manage a singleton?

I am messing around with different PHP logging frameworks. I am currently trying PEAR::Log. I figured that I would use its singleton function to make sure there was only one instance of the class around. I have a small daemon-like script I wanted to add logging to because it was probably the simplest script in the system to test. Thi...

How to use custom neighborhood/city/state for registration on drupal or elgg?

I'm implementing a social networking site. I hope to use drupal or elgg and am trying out both. I'm stuck on customizing the registration to include a neighborhood in addition to city and state. I want to have drop-down menus customize the local information based on the more global information. So, once you choose the state, the city...

How to wrap long lines without spaces in HTML?

If a user types in a long line without any spaces or white space, it will break formating by going wider than the current element. Something like: HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA............................................................................................................................................. I've tr...

php quoting problem

Hello, I have this PHP code echo '<a href="#" onclick="updateByQuery(\'Layer3\', ' . json_encode($query) . ');">Link 1</a>'; which generates a link like this: <a href="#" onclick="updateByQuery('Layer3', "Ed Hardy");">Link 1</a><li>Link 2</li> Causing the javascript to not be called. How would I make it generate single quotes arou...

jQuery Form Processing With PHP to MYSQL Database Using $.ajax Request

Question: How can I process a form using jQuery and the $.ajax request so that the data is passed to a script which writes it to a database? Problem: I have a simple email signup form that when processed, adds the email along with the current date to a table in a MySQL database. Processing the form without jQuery works as intended, addi...

Sales Quote + Inventory Management for Equipment Rental

Can anyone suggest extensible (open source?) web software for generating sales quotes and managing inventory (and possibly other erp/crm functions) that would work well for an equipment rental business? For example, it would need a UI for scheduling the geographic movement of inventory over time. Integration with shipping would be a plus...

What is the best way to convert an existing php class into Java?

I have been tasked with converting several php classes into java classes, which is quickly becoming a nightmare for me. I understand the basic language structure, it being similar to C. It is all of the function calls and class calls that seem to go nowhere and the fact that a var can be declared in the !middle of an expression! that is ...

Why is the Internet Explorer Autocomplete feature disabled for all html forms on my website?

When Internet Explorers AutoComplete is turned on for Forms the entries for each field in the HTML form should be cached and displayed as a prompt when the user starts entering content into the form the second time around. On my website the AutoComplete feature is never displayed for any forms that exist on that site. But yet other w...

Can you recommend a good php Gantt charting development?

Hi I would like to add a simple Gantt chart to my development, was wondering if you could recommend any that seem good to you. I don’t need anything really flash (I’m not trying to reproduce MS Project) just need to plot a number of projects over a 24/7 timeframe. Would appreciate your comments ...

Which Eclipse distribution is good for web development using Python, PHP, or Perl?

I'd like to try out Eclipse, but I'm a bit baffled with all the different distributions of it. I mainly program in Python doing web development, but I also need to maintain PHP and Perl apps. It looks like EasyEclipse is a bit behind. Should I just grab the base Eclipse and start loading plug-ins? ...

Find a "best fit" equation

It's been a while since I was in college and knew how to calculate a best fit line, but I find myself needing to. Suppose I have a set of points, and I want to find the line that is the best of those points. What is the equation to determine a best fit line? How would I do that with PHP? ...

How do I quickly create a complex select query using Zend_Db?

Let's say have something like: SELECT energy_produced, energy_consumed, timestamp1 AS timestamp FROM ( SELECT max(energy_produced) AS energy_produced, mid(timestamp, 1, 10) AS timestamp1 FROM tbl_energy WHERE site_id = 1366 AND mid(timestamp, 1, 10) >= DATE_SUB(curdate(),INTERVAL 1 day) group by mid(timestamp1, 1, 10)) AS e1 INNER JOIN...

How to find missing data either in array or in mySQL table?

Hello, I have an array filled with values (twitter ids) and I would like to find the missing data between the lowest id and the highest id? Any care to share a simple function or idea on how to do this? Also, I was wondering if I can do the same with mySQL? I have the key indexed. The table contains 250k rows right now, so a temporary t...

PHP+MySQL: searching using wildcards

So, I have the following rows in the DB: 1 | /users/ 2 | /users/admin/ 3 | /users/admin/* 4 | /users/admin/mike/ 5 | /users/admin/steve/docs/ The input URL is /users/admin/steve/, and the goal is to find the URL match from the DB. I want to return #3 as the correct row, since the wildcard "*" specifies that anything can go in plac...

How to make PDF file downloadable in HTML link?

Hi, I am giving link of a pdf file on my web page for download, like below Download Brochure The problem is when user clicks on this link then If the user have installed Adobe Acrobat, then it opens the file in the same browser window in Adobe Reader. If the Adobe Acrobat is not installed then it pop-up to the user for Downloading t...

Smarty benchmark, anyone?

Hey, I am considering Smarty as my web app templating solution, and I am now concerned with its performance against plain PHP. The Smarty site says it should be the same, however, I was not able to find anyone doing real benchmarking to prove the statement right or wrong. Did anyone do some benchmarking of Smarty vs plain PHP? Or may...

How to get time difference in minutes in PHP

How to calculate minute difference between two date-times in PHP? ...

Grabbing A Page from WordPress

In WordPress, how do I hide a Page? How do I then reimplement it as a DIV, let's say, on another Page? Context I'm trying to get some year-end tax write-offs here for my freelance business, and so I'm donating WordPress sites to churches. Now, unfortunately I'm finding that several pastors don't understand computers that well, and ev...

How to keep a php script from timing out because of a long mysql query

I have an update query being run by a cron task that's timing out. The query takes, on average, five minutes to execute when executed in navicat. The code looks roughly like this. It's quite simple: // $db is a mysqli link set_time_limit (0); // should keep the script from timing out $query = "SLOW QUERY"; $result = $db->query($query...