php

Web page -user custom style

How can I give the user the ability to change the style of a webpage, of course I have to make several CSS files , but how can I make the code that permits the change upon the user's choice ...

PHP calling multiple videos to convert at once via mencoder.How can I limit it?

Hello all, I am new here. I recently installed my video script to a new server but I am seeing that it will start to convert 1 video (via mencoder) then before finishing it, it will try and convery another, and another, so it will be trying to convert 4+ videos at the same time causing the server to shut down. The script developer said:...

Creating a testing environment with php cli

I would use php in console mode and create an environment to test directly my functions. In fact i would not be force to use a web browser and create a new file each time i want to test a function. I want to get in input the function in the console and then it return the result. So can someone if it is possible and how do i do? ...

Meaning of :: Operator in C# and PhP

In my work I have come across syntax like global:: (C#) or G:Loading($value) in Php, what do they mean? ...

PHP function to build query string from array

Hi, I'm looking for the name of the PHP function to build a query string from an array of key value pairs. Please note, I am looking for the built in PHP function to do this, not a homebrew one (thats all a google search seems to return). There is one I just can't remeber it's name or find it on php.net. IIRC it's name isn't that intuit...

Textmate Regex Find Replace Help

Hi, I've got a project I'm working on converting some legacy perl cgi forms to PHP. A lot of this requires finding / replacing information. In one such case, I have lines like this in the perl script: <INPUT type="radio" name="trade" value="1" $checked{trade}->{1}> which needs to read: <INPUT type="radio" name="trade" value="1" ...

Secure hash and salt for PHP passwords

It is currently said that MD5 is partially unsafe. Taking this into consideration, I'd like to know which mechanism to use for password protection. Is “double hashing” a password less secure than just hashing it once? Suggests that hashing multiple times may be a good idea. How to implement password protection for individual files? Sug...

Did isset work differently in older versions

Hey! I got some legacy code that has this: <?PHP if(isset($_GET['pagina'])=="homepage") { ?> HtmlCode1 <?php } else { ?> HtmlCode2 <?php } ?> I don't know exactly why but this seems to be working. The htmlcode1 is loaded when I have ?pagina=homepage and the htmlcode2 is loaded when the pagina var doesn't exist or is something...

PHP: __toString() and json_encode() not playing well together

I've run into an odd problem and I'm not sure how to fix it. I have several classes that are all PHP implementations of JSON objects. Here' an illustration of the issue class A { protected $a; public function __construct() { $this->a = array( new B, new B ); } public function __toString() { return j...

PHP Login system using Cookies and Salted Hashes

Hello, I am developing a PHP-based login system. Each user has an ID(a number) and a password, which is stored as a salted hash. I am able to figure out if a login is sucessful or not, but now I need to store that information somewhere(so that the user is not permanently logged out). In the past, I've played with $_SESSION variables. H...

PHP Readonly Properties?

In using PHP's DOM classes (DOMNode, DOMEElement, etc) I have noticed that they possess truly readonly properties. For example, I can read the $nodeName property of a DOMNode, but I cannot write to it (if I do PHP throws a fatal error). How can I create readonly properties of my own in PHP? ...

Mixing multiple values for the same key and file uploads using cURL and PHP

I’ve run into a limitation in the cURL bindings for PHP. It appears there is no easy way to send the same multiple values for the same key for postfields. Most of the workarounds I have come across for this have involved creating the URL encoded post fields by hand tag=foo&tag=bar&tag=baz) instead of using the associative array version o...

How to version control, deploy and develop php and mySQL

I'm working in a project where we develop php on Zend using a mySQL database and the project is about to get to a point where it will be necessary to use version control not only for the actual code but also for the database. Also we are getting a good production server (and the actual production server will be a test server). So i w...

PHP - Javascript Controls

I'm currently developing (another) Open Source CMS in PHP and I'd like to use javascript controls especially for the admin panel. The question is, are there any open-source, freely distributable controls (for creating javascript Editable Grids, Trees, tabs etc ) that have an interface for PHP ? I've experimented with ExtJs in the past b...

How rotate a pdf document using php?

How can I rotate a pdf document using php and linux? ...

How to mimic struts validation using javascript/html/css.

For the past few years I've focused on back-end development so my javascript & css skills are lacking. I'm volunteering as a webmaster for a site and would like to spruce up the form validation (currently there is none). My problem: Basically I have one form with a few name fields, an email address and a phone number. When the form is ...

PHP - Find URL of script that included current document

I have a template I made that sets variables that rarely change, call my headers, calls my banner and sidebar, loads a variable which shows the individual pages, then calls the footer. In one of my headers, I want the URL of the page in the user's address bar. Is there a way to do this? Currently: <?php $title = "MySite - Contacts"; in...

How to use mod_rewrite with Zend Framework?

I've just deployed a new site using Zend Framework. Due to the popularity of my tutorials I'd like to redirect any request for a tutorial to the relevant page on the new site. So far this is what I've got: URL before Rewrite: http://neranjara.org/tutorials/?tid=56 URL after Rewrite: http://neranjara.org/article/id/56 The .htaccess fil...

Benefits of using a constructor?

Hi Guys, In my quest in trying to learn more about OOP in PHP. I have come across the constructor function a good few times and simply can't ignore it anymore. In my understanding, the constructor is called upon the moment I create an object, is this correct? But why would I need to create this constructor if I can use "normal" functio...

Best way to get data from "clean" and "dirty" URLs

I'm writing an application that gets data from URLs, but I want to make it an option whether or not the user uses "clean" urls (ex: http://example.com/hello/world) or "dirty" urls (ex: http://example.com/?action=hello&amp;sub=world). What would be the best way to get variables form both URL schemes? ...