php

Php script problem

I have a little problem with my script. When I try to run it I receive "Parse error: syntax error, unexpected T_STRING" as long as I have ' sign in my code. When I change all ' into " then I have the same error. So I have to change all " into '. How can I solve it? Here is my code: <?php PutEnv(TNS_ADMIN='C:\Programy\OracleDevelo...

recursion function in php not working as expected

private function find_children ($parent_id, $children, &$result) { foreach ($children as $c) { if ($c->parent_comment_id == $parent_id) { $result[] = $c; $this->find_children($c->id, $children, $result); } } r...

MYSQL DATE function running insanely slow in LEFT JOIN

When adding the line: LEFT JOIN core_records_sales as sales ON DATE(appointments.date) = DATE(sales.date_sold) To my query, it boosts the time for the script to run from about 8 seconds, to 2-3 minutes. Would there be some data causing this problem or am I not implementing the function correctly? I need to use DATE() because I need ...

PHP check if $_SESSION['text'] is text

How can I check check that $_SESSION['text'] is indeed text and not some malicious .exe? AND, if i do destroy_session(...) but set $a = $_SESSION; does $a become NULL now? ...

Very basic question about submitting data to API using SOAP & PHP

Before I ask my question I want to thank everyone on stack overflow. I'm really amazed at how helpful everyone is and how much I've learned just in the past year or so from asking questions when I'm confused. I'm trying to use the recordSale function on this API for someone my work does business with, it's a way to record sales (hence ...

PHP DOMDocument GetElementsByTagName Not Finding Elements

I have an HTML page containing alot of meta tags and I want to parse them to find certain ones. Here is the code I am using, but it's not picking up any of the tags. $dom = new DOMDocument(); $dom->preserveWhiteSpace = false; $dom->loadHtml($contents); $metaChildren = $dom->getElementsByTagName('meta'); var_dump...

Passing parameters using a Zend Framework redirect without appending to URL

In our application, we have certain scenarios where we'd like to perform a redirect and pass a long string to the next controller/action. I'm familiar with both of these: $this->_redirect('/controller/action?string=thisistheverylongstring); But would like to avoid showing the user the string as part of the URL. Throwing the string in...

can't install memcache php module

Hi, i'm trying to install memcache module from http://pecl.php.net/package/memcache. Im using xampp in ubuntu (lampp) with php 5.3. After download the extension, I run phpize, make and make install, then I add extension=memcache.so in my php.ini but when I restart xampp the following message appears: Warning: PHP Startup: memcache:...

Utilities file in php?

What is the best way to deal with "utility" functions in a OOP PHP framework? Right now, we just have a file with several functions that are needed throughout the system. (For example, a distribute() function which accepts a value and an array, and returns an array with the value distributed in the same proportions and same keys as the...

How can I join in data from a key : value meta table in mysql?

Say I have three tables in my database: CREATE TABLE `users` ( `user_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `username` VARCHAR(16) NOT NULL ); CREATE TABLE `users_meta` ( `meta_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `user_id` INT NOT NULL , `key` VARCHAR(200) NOT NULL , `value` TEXT NOT NULL ); CREATE TABLE `posts` ( `po...

How to remove any html tags with nothing but optional whitespace between them

I need to clean up some VERY ugly html (think < span>< /span> < em>< /em> < em> < /em> < strong>< /strong> ) over and over again... I'm looking for a nice and easy preg_replace to eliminate any html tags that contain optional whitespace between them. Your assistance is greatly appreciated! Oh, and just found this beauty: < p>< strong...

[Dojo / PHP + apc.rfc1867] I can't get xhrPost upon form submission via input button, I'm going insane...

It's rather lengthy, TLDR version below crit wall of text. Setup: Our company had been using prototype for some time, and just recently switched to dojo. I have been converting lots and lots of JS and setting everything back up to normal and then I encountered this issue... The issue: I have a typical form set up with a upload file fi...

Complicated SQL query - how do i do it ?

Hey Everyone I'm currently working on a small feature for a project and wondered how best to achieve the result, i have a table full of reviews with the score being out of 5 and being stored as score in the database, on one page i want to show how many of each score reviews there are, ie number of 5 star reviews, 4 star etc But i don't...

PHP Detecting bot-like behavior

I am attempting to build a system that only shows users a CAPTCHA when bot-like behavior is detected. Here are the behaviors that I am currently looking for when somebody is filling out a contact form... how quickly the form is submitted after the page loads (if its 5 seconds or less, its almost humanely impossible to fill out) how man...

Open Source PHP script for HTTP video streaming?

Open Source PHP script for HTTP video streaming? I need some PHP script or script lib for enabling reading and writing from and to a HTTP stream. I want to write chunks of data... Actually I'm looking for such thing because adobe Flash 10.1 now supports it... So it looks for me lots of such questions will appear soon) BTW: I do not ...

php_uploadprogress wamp refresh information

Hi! Did anyone used php_uploadprogress extension for wamp? When i try to use it with jquery, only the fist is relevant, and all other request show an not-updated information. The configuration is the fallowing: uploadprogress.file.filename__template=C:\wamp\tmp\upload_progress_%s.txt uploadprogress.get_contents=0 uploadprogres...

How to make a Small system to comment on a individuals in a group in PHP?

I am building a team roster application. It takes a team class (this is a quick mockup not the actual class as my question does not pertain to it) class Team { function __construct($teamName, $roster){ $this->setName($teamName); $this->setRoster($roster); } I didn't include the set functions because this class is ...

XSLT -> XHTML: Inline PHP?

Hello all, I'm trying to use XSLT to generate some XHMTL with inline PHP. I've run across a problem with generating inline PHP in attributes. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:html="http://www.w3.org/1999/xhtml" version="1.0"> <xsl:output method="xml" indent="yes" doctype-system="...

Are the PHP preg_functions multibyte safe?

There are no multibyte 'preg' functions available in PHP, so does that mean the default preg_functions are all mb safe? Couldn't find any mention in the php documentation. ...

How can I make my mysql database records visible to search engines ? (part 2)

Part 1: http://stackoverflow.com/questions/1749520/how-can-i-make-my-mysql-database-records-visible-to-search-engines I have tried to figure out how to create a site-map for my classifieds website, however, I dont understand the way it works with php and database websites. I have understood that I need all links on a html page, right? ...