php

require_once with dotted (hidden) files in php on windows not working

my code works fine if I remove the leading dots on file names, but breaks otherwise. [edit] The file starts with a dot (period) character [end edit] require_once('.htMyClass.inc.php'); //fails require_once('htMyClass.inc.php'); //works I wanted to keep the dots for security -- the leading ht is just a hold over from apache. i don't...

basic if/then with PHP

Okay so i set up this thing so that I can print out page that people came from, and then put dummy tags on certain pages. Some pages have commented out "linkto" tags with text in between them. My problem is that some of my pages don't have "linkto" text. When I link to this page from there I want it to grab everything between "title...

Why is the CakePHP authentication component not hashing my password?

I'm using CakePHP 1.2 with Auth and ACL components. In my user register action, the password is coming in unhashed. Specifically, this expression: if ($this->data['User']['password'] != $this->Auth->password($this->data['User']['confirm_password'])) This is evaluating to true, even when I submit identical values for password and...

Is this wrapper for PDO 'good code' ? Are there any potential problems?

I built this class to work with PDO, to make SQL queries 'easier' and less to worry about. Here are my thoughts Should it be more like class DB extends PDO? Is the query method too big? Should it be split into private methods which are called.. is this what is known as loose coupling? Is my way for detecting a SELECT query too ugly f...

What is the best way to persist an object using forms in PHP?

I have a PHP application where I would like to certain objects to persist in the following manner: The object must not exist in the $_SESSION. Separate web browser windows must control separate instances of the object. The end-user must not be able to modify the object by changing the content of the $_REQUEST variable by hand (if this...

What challenges will we face porting a site from asp.net to a LAMP (php) stack?

We have an enterprise application written in asp.net c# (3.5) and SQL server that we want to bundle and release for customers. However, several have expressed concerns that it requires a Microsoft server due to the costs. Yes, I know... Therefore, we are considering porting it to a LAMP stack, with the "P" referring to php. What ch...

What is the best IDE to use with the Symfony framework?

I'm looking for an IDE with use with the Symfony Framework. I have a bit of experience using the NetBeans 6.5 IDE but it does not always seem to complete the class methods, plus it doesn't seem to have any PHP code snippets built in. Here are the features I would ideally like to have, in order of importance, from an IDE: Code complet...

Dynamic javacript slideshow...

I have a javascript slideshow that pre-loads images out of a mySQL database and then displays them one at a time in an image tag in the HTML document. Briefly, it accomplishes this by pre-loading images like many slideshow tutorials show on the web, but instead of using static images (i.e. images/image1.jpg etc.) it uses a dynamic image ...

What is the best way to implement versioning to a MYSQL database?

Hi, I have to produce a versioning system to store multiple versions of my articles in a database to allow the user to roll-back if required. My first thoughts are when the user wants to edit an article really I get the sql to no longer update but you insert their information back into the database. Currently the problem is i have an a...

SQL like statement problems

I am having problems executing a prepared statement via mysqli. First I was getting Command out of sync errors. I am storing the result and closing the connection, and I have stopped getting this error, so hopefully the problem has stopped. However, the error in my sql syntax error, which was working fine while the commands were not in...

Proper rendering of special characters in Flash, parsed from XML and generated with PHP/MySQL

Hi all, Probably a problem many of you have encountered some day earlier, but i'm having problems with rendering of special characters in Flash (as2 and as3). So my question is: What is the proper and fool-proof way to display characters like ', ", ë, ä, etc in a flash textfield? The data is collected from a php generated xml file, ...

How to convert a sentence to an array of words in PHP

Using Php. Need: On String Input: "Some terms with spaces between" OutputArray <String>: {Some, terms, with, spaces, between} ...

SOAP WSDL Associative Arrays

Hi all, How can I define an associative array in a SOAP wsdl file? This is how I define an array element type so far: <wsdl:types> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="webservice.wsdl" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"&gt; <xsd:import namespace="http://schemas.xmlsoap.org/...

How to add ORM to a PHP legacy project?

Hello, guys. Need your advice very much. We'are working on the PHP project, which was in development for 2+ years, and now the team is ready and feel willingness to switch the development on ORM rails. Because it realy fasts the development and allow you to operate by Objects and not think in terms of SQL code and database tables in mos...

fetching data from a prepared statement.

I have a function, which is to return an array of rows containg records from a database, selected based on a LIKE query. I want this query to be a prepared statement for security reasons. Apparently I can not use bound parameters and the query function as I am doing. I am unsure then, of how to keep me query as a prepared statement, and ...

MediaWiki Payment gateway

Hi, I would like to have a subscription sponsored wiki in mediawiki. I want the paid members to have access to certain part of the wiki. How do I achieve that? Is there a plugin/extension or needs a rewrite. In any case how do I implement the payment gateway if I was flagging the paid users in the DB? Any help will be appreciated. ...

FFMPEG - zero file size when sound enabled

I'm having a few problems converting video files from the command line using FFMPEG. I'm using a CentOS server, but unfortunately I don't have shell access. When I suppress sound using the following command, everything works perfectly (except of course, there's no sound!) ffmpeg -i $infile -an test.flv However, when I try to enable s...

Where / What is the Package Explorer in Eclipse PDT

I'm trying to get hidden files to show in Eclipse (namely, a .htaccess file), and the answers point to doing something in the 'Package Explorer'. I'm using Eclipse PDT 2.1 and it's not apparent to me what / where that is. How do I get to this fabled 'Package Explorer' ???? ...

Streaming output to a file and the browser

So, I'm looking for something more efficient than this: <?php ob_start(); include 'test.php'; $content = ob_get_contents(); file_put_contents('test.html', $content); echo $content; ?> The problems with the above: Client doesn't receive anything until the entire page is rendered File might be enormous, so I'd rather not have the wh...

What's the most efficient test of whether a PHP string ends with another string?

The standard PHP way to test whether a string $str ends with a substring $test is: $endsWith = substr( $str, -strlen( $test ) ) == $test Is this the fastest way? ...