php

What is the best practice/approach to programatically sharing content between sites in Joomla?

I've got a client site that will have multiple "mini-sites" for individual web shows and one main site for the company that produces them. Each mini-site has it's own color scheme but has all the same menu items and/or content of the other site such as Photos, News, etc. I can't seem to figure out how to ensure programatically that the...

PHP: Separating Business and Presentional logic, is it worth it?

Possible Duplicate: Why should I use templating system in PHP? I was just curious as to how many developers actually do this? Up to this time I haven't and I was just curious to whether it really helps make things look cleaner and easier to follow. I've heard using template engines like Smarty help out, but I've also heard the ...

AJAXify site

Hello, I have legitimate reasons to do what I am trying to explain. I have an existing site say abc.com which has regular pages etc. everything written in php. Now I would like to AJAXify the site i.e. when a user clicks on a link, it should fetch the link using AJAX and replace the page contents. This is the easy part and I can achieve...

Frontcontroller help

RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ /index.php [NC,L] php <?php $pagesDir = "pages"; // Get the request $page = $_SERVER['REQUEST_URI']; // Strip the first slash $page = substr($page, 1); //...

Php put a space in front of capitals in a string (Regex)

I have a number of strings which contain words which are bunched together and I need to seperate them up. For example ThisWasCool - This Was Cool MyHomeIsHere - My Home Is Here Im slowly getting my head around regular expressions and I believe to do this I should use preg_replace. My problem is putting together the expression to find t...

How to exclude searching specified fields using Zend Search (Lucene)

I've built a search index using the PHP Zend Framework Search (based on Lucene). The search is for a buy/sell website. My search index includes the following fields: item-id (UnIndexed) item-title (Text) item-description (UnStored) item-tags (Text) item-price (keyword) seller-id (UnIndexed) seller-name (Text) I want the user to sear...

403 Forbidden on PHP page called with url encoded in a $_GET parameter

Given hello.php: <?php echo "Hello"; ?> rendering the page works fine and returns Hello, however http://myserver.com/hello.php?test=http%3a//whatever.com returns a 403 Forbidden. But oddly enough, making the first letter of http uppercase works fine: http://myserver.com/hello.php?test=Http%3a//whatever.com FYI, percent encoding th...

Which language should I learn between PHP and ASP.NET?

This question has been around my head for the past months but I have been reticent to post it on here due to the subjective nature of the question, but here goes. I'm a software engineering student and have been looking for quite some time to get serious about web development. I've done basic stuff in the past, mostly XHTML/CSS/Javascri...

php.ini config file scan performance

Does enabling the configuration option with-config-file-scan-dir when compiling PHP lead to performance issues? Specifically, does this tell the PHP binary to do a file system scan every time the PHP module is loaded to respond to a request? I imagine it does, and that having multiple ini files causes just a little more disk access o...

UTF8 Filenames in PHP and Different Unicode Encodings

I have a file containing Unicode characters on a server running linux. If I SSH into the server and use tab-completion to navigate to the file/folder containing unicode characters I have no problem accessing the file/folder. The problem arises when I try accessing the file via PHP (the function I was accessing the file system from was st...

PHP Class to export data to QuickBooks import format?

Seeing lots of SOAP/RDS stuff, but just want to dump some MySQL data and/or CSV files to IIF/QIF/OFX format and don't want to reinvent the wheel (laziness ensues). ...

Safe to make this script public? Newbie Question

<?php if (isset($_POST['post'])) { // sanitize variables $title = mysql_real_escape_string(trim($_POST['title'])); $text = mysql_real_escape_string(trim($_POST['text'])); if (strlen($title) > 3) { mysql_query("INSERT INTO msgs (title, text, date) VALUES('$title', '$text', '".time()."')"); header('location: msg.php?id='.my...

How to set the function to make user click the table header to change sorting order

I want to let user click the table header to sort the table, but can just set the ascending order, can not set the descending order in the same table header. following is the function I used, function sortBy(sKey) { document.sortResultsForm.sSortBy.value=sKey; document.sortResultsForm.submit(); } function sortDistrictNamedescen...

Convert PHP to C++ code

I'm looking for a way to convert PHP code to C++. There are a few reasons I want to do so: Main reason: There are bunch of great PHP tools/software that I'd love to use and incorporate into C++ GUI or non-GUI applications To boost performance To avoid dependency on PHP libraries To avoid disclosing source code on shared hosting enviro...

MySQL preventing dual loading

Right guys, I have a MySQL database, using InnoDB on tables, every so often I have to perform a big cron job that does a large batch of queries and inserts. When I run this cron job, for the 5minutes or so that it is running, no other page is able to load. As soon as it is done, the queries are executed and the page loads. The table th...

How to call a PHP method in Rails Application ?

Is there any way to include php file using require and calling a php method in rails application ? I dont want to use phusion passenger as my server . ...

Merging (mixing, not concatenating) audio files dynamically

I just need to be pointed in the right direction - I can research after knowing the best tools. The idea is to have a list of audio tracks (guitars, bass, vocals...etc) which are uploaded by different users. I want a user to be able to select which tracks to listen back to then dynamically generate a new stream/file of the selected ...

Manage Zend_Search_Lucene Index on a load balanced environment

Each server in the cluster has a a search index that is synced from one of the servers every 15 minutes. This was done because appending to an index can't happen on a nfs because of flock; see documentation (or else the index would be on a shared folder that all servers access). The issue that I'm running into is that if an action is t...

Google Maps - Panning and Zooming into areas - markers not appearing when I zoom in or pan - HELP!

Hi guys, I'm implementing some boundary based clustering on the server end of markers to display on my google maps. What I'm doing is that I have a function that is called everytime the map is moves or panned or zoomed which takes the bound of the map and makes an ajax call which in turn the server side script runs a simple sql query to ...

How do I run a process from PHP

I need to start a Unix process by calling a PHP-page through the web. I also need to send some arguments to the PHP-page that gets substituted into the command in a save way. ...