php

Php Inheritance

Hi, I am using PHP 5.3 stable release and sometimes I encounter very inconsistent behaviours. As far as I know in inheritance all attributes and methods(private, public and protected) in super class are passed child class. class Foo { private $_name = "foo"; } class Bar extends Foo { public function getName() { retur...

What system to use for a key-value cache on a single server

I'm implementing a PHP script which will need some caching capabilities. I'm trying to determine which caching strategy to use for user data assuming that the script is running on a single server. I'm probably looking at about 50k different keys. The data for each key is not very big - in most cases less than 5kb. I have implemented a ...

Integrating Simple Machine Forum with my own website

Hii ... I have setup a simple machine forum, and create my ownwebsite. I want to Integrate Authentication my website with simple machine forum. the authentication handled in SSI.php that a part of simple machine forum function. I host my own webiste and the simple machine forum in different address. supposed I host my website host in w...

Can a prepared statement in MySQL contain PREPARE and EXECUTE?

I wanted to know if prepared statements can be used in the following way: public static function GetCategoryItems($categoryId,$pageNum, &$rnum_pages) { $sql = 'SELECT DISTINCT COUNT(*) AS items_count FROM item I JOIN sub_category SC ON I.sub_category_id = SC.sub_category_id ...

Clean PathInfo URLs and Query Strings on IIS 5.1 and PHP 5

I'm trying to get 'clean' PathInfo style URLs with query string parameters working on PHP 5.3 and IIS 5.1 using FastCGI. I've found that I can use: (1) http://www.example.com/index.php?/path/to/foo/ but not: (2) http://www.example.com/index.php/path/to/foo/ (Note the missing ?) Which isn't a big issue until I want to mix URLs with a ...

disable php automatic addion of ?PHPSESSIONID=xxxx to url

I'm developing a web site which uses wp-cumulus on its home http://www.roytanck.com/2008/03/06/wordpress-plugin-wp-cumulus-flash-based-tag-cloud/ it's a flash component to show a nice cloud tag. in order to use it I issue: <script type="text/javascript"> [...] flashvars.tagcloud = "<tags><a href='/tag.php?tag=Marinetti'>Marinetti</a>...

Is this a good design for doing form validation?

For my framework I've written down this concept to solve the form validation problem. I want it to be as straightforward as possible for the framework user. Every Form (=object) has one or many FormElements (=objects). Every FormElement can have 0-n FormValidators (=objects). Everything easily configured through the backend (simple drag...

PHP: Generate preview image from Video file?

Is there a way in PHP given a video file (.mov, .mp4) to generate a thumbnail image preview? Thanks. ...

question about salt

How much stronger would this be: return sha1($salt.sha1($passwd)); compared to just: return sha1($salt.$passwd); salt is a per-user strong 12 char with random ascii ...

Enabling $_GET in codeigniter

I've been trying to figure out how to enable $_GET in CI. It appears the framework deliberately destroys the $_GET array, and that enabling it requires serious tinkering with the core classes. can anyone say why this is, and how to overcome it? mind you, i'm looking to keep URI parsing and routing the way they are, just simply have the...

php e() and h() functions?

Hi, I and lately I'm seeing h() and e() functions in php... I have googled them, but they are so short that results doesn't give any idea of what they are. I got results like exponential, or math related functions. for example: <td><?php echo h($room['Room']['message']) ?></td> Does any one has an idea? or maybe they are not called...

Acrobat and/or Reader Error ".tmp" when using fdf

I'm populating PDF's via FDF (& php) and for the most part it works fine however some users are getting either a "Acrobat cannot open "Acrxyz.tmp" (or a "Reader cannot open "xyz.tmp", in some cases). I've found info about possible causes surrounding: apache "MOD-Deflate", IE Cache and Volatile memory & "fdf_close" among other things.. ...

How do I set up the following architecture.

Sorry if the title is a little vague, I do not know how else to describe it. I am making my own small framework. Things are going nicely and I am enjoying looking at topics that I usually do not need to check out as 'the magic' does it for me. My framework is PHP based and I want it to run from a single instance. What I mean by this is...

system() mangles the command in php

I'm trying to execute a command through system() in PHP. The command is /usr/bin/unzip, but the function returns with the error code 127. There is nothing else outputted. If I run the very same command directly in a shell it works. The apache error log says 'sh: /unzip: not found'. I have also tried to put the command into a shell scrip...

howto create api service

I have an application which handles some data. Now i want to make the data available throughout a php api (something like zend_gdata for google) so my application's users can handle the data from my application in their own applications on an other host. Is this possible? Can someone hook me up whith some literature or ideas? ...

Does SOLR use up alot of memory on a server?

I have NO EXPERIENCE with SOLR. Does SOLR use more memory than say MySql on a server? I am about to purchase a VPS-package, but they come in different sizes as you can imagine... I contacted the providers today by email, and told them that I was planning on using SOLR which requires java installed. Their response was that it would w...

PHP HTML mail rendering tags in outlook

Hi folks, I've used this example on the PHP site to send an HTML email, but when I recieve a mail sent by the script it renders the tags in the client (Outlook) <?php // multiple recipients $to = '[email protected]' . ', '; // note the comma $to .= '[email protected]'; // subject $subject = 'Birthday Reminders for August'; // message ...

Is it possible to pass a variable to php without the users 'seeing it' ?

I have a link on a page, and I would like to send a variable to a php file like this: href = "php_file.php?qry=$query" the $query variable contains a query which I would like to make to mysql, inside the php file. My problem is, I don't want the users to 'see' what I am passing along. I would like to use $_POST but from what I know,...

PHP on Plesk - Can't see absolute directories

I have PHP installed on a web server administered by Plesk. I am having some PHP include_path problems which I have narrowed down to absolute paths apparently not working. So, if I try to do a directory listing, the following works: echo "<h3>Directory listing of .</h3>"; foreach (new DirectoryIterator('.') as $fileInfo) { if($file...

Simplepie - fetch feeds from database

I want to fetch multiple feeds from the database and in so doing fetch all new content from those feeds it works but there is a problem and I have no idea what's causing it, this is the code: $feed_sql = mysqli_query($link, "SELECT feed from tutorial_feed WHERE approved=1"); $feeds = array(); $i = 0; while($feed_...