php

Dynamic Template Sheet?

I have 5 game sections that will use the same template sheet, but they will all pull data from a different table in mysql in the same database. However, I am incorporating this: http://stackoverflow.com/questions/1712973/how-to-include-config-php-efficiently/1713000#1713000 Okay, so here's how I was planning to tackle it. For example, ...

retrieve the hash in the url with php?

someone here in SO told me that the hash (#) in the url could be retrieved by php function parse_url? is this true? my web site got a lot of ajax effects and i want to be able to pass an url with a hash to the index.php so it could display the information based on the hash values. eg. if a user clicks and navigates in my website and he...

PHP Program help

Can any one please tell whats going on in this program? My one main doubt is about the 1st condition from where will we get the method for REQUEST_METHOD i mean the program is gng in the 1st if loop so REQUEST_METHOD == GET but where are we setting it. <html> <head><title>Temperature Conversion</title></head> <body> <?php if ($_SERVER[...

how to work with RegexIterator::REPLACE mode?

What is wrong in my code: $i = new RegexIterator( new ArrayIterator(array( 'test1'=>'test888', 'test2'=>'what?', 'test3'=>'test999')), '/^test(.*)/', RegexIterator::REPLACE); foreach ($i as $name=>$value) echo $name . '=>' . $value . "\n"; The iterator is empty, why? Thanks for your help! ...

PHP SPL Reference Documentation

I'm pretty green at all the new features implemented with the PHP SPL, from this very long list all I've played with was with the RecursiveDirectoryIterator class, I don't even fully understand it I just saw an example and hacked my way through it. I've come to love the PHP documentation, but the lack of documentation on these new and s...

How do I put a download button on a site to get a CSV of a table Query?

How do I put a download button on a site to get a CSV of a table Query? Currently I am using "SELECT * INTO OUTFILE" to make the CSV file on the sever HD and is fine except... I want to create the CSV like I am now, but I want the "OUTFILE" to be saved on the clients computer when they click Download. <?php // Create new file name f...

How to direct link to an attribute set?

I have created attributes; “Shop by Type” and “Shop by Color”. They work great within the layered navigation and extended search. I’ve designed graphics and placed them in the home page and would like to link to the respective attribute’s assigned products. Been searching the webs, but so far have been unsuccessful. If there’s no direc...

Can I include code into a PHP function or method?

I want to make a kind of "generic" function which gets executed and - depending on what to do - includes it's implementation file via include(). So for example, I might have exactly one function and exactly 20 procedure files for that function. The procedure files may look like do_this_procedure.php, do_that_procedure.php, etc. As I'm n...

How does ORM work when using PDO in PHP?

I've heard that PDO can do some ORM. Is it a good idea to stick with that or should I consider some alternatives that use PDO to do ORM? In short, what I want to do: I want to automatically map table fields to instance variables. Getters and Setters are created manually. However, I could also think of making an associative array as ivar...

How to judge whether or not a transaction succeeded or failed?

I'm using MySQL and PHP. Running this transaction: begin; .... commit; How should I judge whether it failed in PHP? ...

PHP based MySQL database managers

I'm looking to some lightweight open source php based MySQL database managing script. I would essentially prefer something that is packed into a single file, and has a decent UI and features. PS: I already know about PHPMiniAdmin, I'm looking for alternatives. ...

PHP : Finding Files on Directory

Hello, Is it possible to find a file on C:/ (windows) using php script? If yes, is there any manual of sample code/workaround. Edit : The webserver are on same PC as C:/ Directory in. Thank you ...

Compile my own PHP extension on windows, but got LNK 2005 error

I am using VC 2008 express, and tried to compile my own PHP extension with that. Any idea about the following error? ------ Rebuild All started: Project: xsplit, Configuration: Debug Win32 ------ Deleting intermediate and output files for project 'xsplit', configuration 'Debug|Win32' Compiling... xsplit.cpp c:\x\php-5.3.1\zend\zend_exec...

How to check whether column value is null or 0 in PHP?

$query = 'select column from table ...'; ... $row = mysql_fetch_assoc($result); //now i have the result //but how to check if it's null or 0? ...

Good DAL library for PHP which has the similar .Net's feature: command.Parameters.AddWithValue("@demographics", demoXml)

Hi, the question is very straightforward: Good DAL library for PHP which has the similar .Net's feature: command.Parameters.AddWithValue("@demographics", demoXml). mysqli extension is good but I want to have the aforementioned feature too. Putting many "?" does not look nice and rather confusing when a table has many fiends (>= 8). Than...

How to access a private member inside a static function in PHP

I have the following class in PHP class MyClass { // How to declare MyMember here? It needs to be private public static function MyFunction() { // How to access MyMember here? } } I am totally confused about which syntax to use $MyMember = 0; and echo $MyMember or private $MyMember = 0; and echo $MyMember or $this->My...

Can I include code into a PHP class?

I want to make a PHP class, lets say Myclass.php. Now inside that class I want to define just the class itself and some instance variables. But all the methods must come from a Myclass_methods.php file. Can I just include that file into the class body? I have good reasons why I want to seperate this. In short, I'll have a backend in whi...

External documentation for PHP, no DocBook

I need a documentation system for a PHP project and I wanted it to be able to integrate external documentation (use cases, project scope etc.) with the documentation generated from code comments. It seems that phpDocumentor has exactly the right feature set, but external documentation must be written in DocBook which is too complex for o...

how can I install pspell in php5/ubuntu ?

I am trying to install pspell for PHP 5 in Ubuntu. I have installed the aspell library which is required to run pspell as shown here I am not sure if there are any settings I need to change, etc. When I try to execute the below mentioned line of code $pspell_link = pspell_new("en"); I get an error Fatal error: Call to undefined func...

Basic ORM strategy in PHP: How could it look like?

Basic ORM strategy in PHP: How could it look like? ...