php

Ecommerce tool for selling services

I am looking for a good ecommerce CMS. I need to be able to sell services and products, it must be open source that it can be customized wherever needed. I am very familiar with PHP and Mysql, and somewhat familiar with python and ruby, so a PHP solution would be preffered. ...

Correct way to trigger a file download (in PHP)?

Quick (and hopefully easy) question: I need to trigger a download of a PDF file that's generated by a PHP file. I can do this: <a href="download.php">Download</a> but should I be doing this another way? Javascript maybe? The above works but the window shows "Loading..." until the download starts. I'd like to provide some feedback ...

How to keep my non-breaking spaces with HTML Tidy (PHP)?

I've just noticed that tidy_repair_string() is removing my non-breaking spaces from empty elements causing my table to collapse. Basically I've put in: <td>&nbsp;</td> and HTML Tidy is stripping them out to: <td> </td> which may or may not be some Unicode break but either way it's collapsing. The only &nbsp; related option I'v...

How to correct Zend_Uri_Exception (YouTube API with PHP Zend Gdata)

I am using Zend Gdata to interface with the YouTube API from a PHP script. I actually had this working fine, and suddenly I am getting a fatal error about a 'Zend_Uri_Exception' with message 'Invalid URI supplied'. How can I correct the exception? CODE: require_once 'Zend/Loader.php'; Zend_Loader::loadClass('Zend_Gdata_YouTube'); $yt ...

Moduler php application development

Hi, We are a small team of developers planing to develop a php application. (let's say a CRM system) Our one main gold is to make it plugin enable application where developers at clients place can write plugings add new features to the system, with out changing the application core. this changes may including, 1) add new features: mor...

Pure PHP rrdtool

hello all, does anyone know a pure-php implementation of rrdtool? I googled this question, but only found answers about interfacing PHP & rrd... ...

Validate sprintf format from input field with regex

I have an input field where both regular text and sprintf tags can be entered. Example: some text here. %1$s done %2$d times How do I validate the sprintf parts so its not possible them wrong like %$1s ? The text is utf8 and as far as i know regex only match latin1 characters. www.regular-expressions.info doesnt list /u anywhere, which...

Guide for securing an ajax php webapp

Hello, I have a small AJAX application, written in PHP that I did not secure from the start. I would like some recommendations on how to now secure the app, things to implement and check for. I have not found any exhaustive guides on google, and hope that some can be recommended. It is a small application that connects to and displays ...

Making the Cursor Disappear

I am constructing an Editor for a little Webapp. My concept is to have a Bar where I put all the functions. It changes concerning to the content. Now i got the following problem. As you can see in the picture when i click on the button it happens that the button will be on a new button just after beeing clicked. My question is: Is there ...

Please critique my first attempt at MVC in PHP

Well I'm not a huge framework guy but I've been liking what I've been hearing about the whole MVC movement so I thought I'd try to create a simple application in my language of choice (PHP) So I guess the question is: where did I go wrong? I know there is a lot of debate as to how fat the controller/model should be so hopefully we can ...

Pulling IMG Into PHP File

I have a PHP file and an image in the same directory. How could I get the PHP file to set it's headers as jpeg and "pull" the image into it. So if I went to file.php it would show the image. If I rewrite file.php to file_created.jpg and it needs to work. ...

Trouble with LoadVars.sendAndLoad in Actionscript 2 across different computers

Hi guys, I'm writing a very simple flash app (AS 2) to sign users up to an email newsletter; the way it works is that it uses LoadVars to hit a (same-domain) PHP script via POST with the user's email address. The PHP script then passes the info through to another domain (the newsletter mailer URL) via curl to sign up the user. So far, ...

Character set woes

I have a small ajax application built with php. Using phpMyAdmin I have set a mysql database to utf-8, and have imported a textfile containing utf-8 data into it. This worked fine on a windows machine with easyphp, after adding character-set-server=utf8 and default-character-set=utf8 to the my.cnf file. I have now tried to move this t...

Troubleshooting PHP Login connection

I have encountered a problem that I have not come accross yet when setting up a log in page using php. The page has a error message that relates to line 1 ( require_once('../Connections/Login.php) that states [function.require-once]: failed to open stream: No such file or directory Fatal Error: require_once() [function.require]: ...

PHP If Date Is >13 Days Ago

I'm pulling a row from a database and there is a date field (y-m-d). I need to create an if statement so that I can do something IF that date is longer then 13 days ago. I've already found out how to display all results which are longer then 13 days ago if it is any help. SELECT * FROM links WHERE (TO_DAYS(NOW()) - TO_DAYS(date))>13 A...

PHP Mail Encodes Subject Line

When I try to send a HTML encoded email from PHP, if the subject line contains special chars like "Here's the information you requested", PHP encodes it to read "Here&#039;s the information you requested." How do I fix this? ...

which is the best practice when creating functions/methods in PHP, do you use arrays or individual variables?

is it considered 'bad practice' to create an fucntion like so: // $arr_member_fields['first_name'] = $_POST['first_name']; // $arr_member_fields['last_name'] = $_POST['first_name']; // $arr_member_fields['email'] = $_POST['email']; // $arr_member_fields['dob'] = $_POST['dob']; // $arr_member_fields['gender'] = $_POST['g...

PHP best design practices

Ok, have a bunch of questions that I have been thinking about the past few days. Currently I have a site that is just a bunch of PHP files with MySQL statements mixed in with PHP, HTML and CSS, basically a huge mess. I have been tasked with cleaning up the site and have made for myself, the following requirements: The site needs to be ...

What are some of Drupal's shortcomings?

Drupal is very much a "Do Everything" CMS. There are modules that allow you to add almost any functionality, which is great. However, it feels like a lot of the features (v5 and v6) seem scattered around and unintuitive for the user. As a developer, I'm left with the feeling of having patched a site together using bubble gum and string. ...

How to easily and simply, schedule a cron job in PHP -- Rails has BackgroundRB.. Thanks for your help!

How to easily and simply, schedule a cron job in PHP -- Rails has BackgroundRB.. Thanks for your help! ...