php

Multiple References in Doctrine Fixtures

I have following models: class User extends Doctrine_Record { public function setTableDefinition() { $this->hasColumn ( 'username', 'string', 20 ); $this->hasColumn ( 'password', 'string', 40 ); $this->hasColumn ( 'salt', 'string', 40 ); $this->hasColumn ( 'email', 'string', 80 ); } public fu...

how to return value through php function when called through the anchor tag in html

Look at my code below <a href="https://secure.gate2shop.com/ppp/purchase.do?merchant_id=234555454545433&amp;merchant_site_id=54443¤cy=USD&amp;total_amount=39.99&amp;item_name_1=IncidentSupportTier1&amp;item_amount_1=39.99&amp;item_quantity_1=1&amp;checksum=**call php function to get the checksum value**&time_stamp=2010-06-14.14:34:33&ve...

Yii $loginUrl='/' problem (not redirecting to the login page)

I've noticed that if your site is located at the root of the domain, like www.example.com instead of www.example.com/website/ then if you set your $loginUrl='/' in the config of Yii, the redirection will not work, because the url is stripped to an empty string while processing. To overcome that I've added public function init() { pa...

invoking swi-prolog from php

I am trying to invoke swi-prolog from within a php script like : exec("start plwin.exe -f C:\\path\\load.pl -g run_from_file.", $os1); print_r($os1); I can see that prolog window gets opened and complies the file, but immediately exits displaying an exit status as 1. I am sure that it is not executing the predicate I want to to execut...

Generating dynamic css using php and javascript

I want to generate tooltip based on a dynamically changing background image in css. This is my my_css.php file. <?php header('content-type: text/css'); $i = $_GET['index']; if($i == 0) $bg_image_path = "../bg_red.jpg"; elseif ($i == 1) $bg_image_path = "../bg_yellow.jpg"; elseif ($i == 2) ...

PHP function to handle most database queries has a problem with results. I am getting the right number of rows but they are all the same

Here is my little function. It does not handle the results correctly. I do get all the rows that I want, but all the rows of the $results array contain the exact same values. So i make 2 arrays, a temporary array to hold the values after each fetch, and another array to hold all the temporary arrays. First i take the temp array and map...

Slick PHP based image manager for managing user profile images

Hi, I'm just throwing this out there as I'm plodding my way through creating a Member Photo album on a site i'm working on, where they can login and upload their photos to a personal gallery. I want this to be nice and lightweight, but still slick and "modern" with a modal based interface for the user. I'm surprised though that there is ...

What/Where are the Naming Rules for Controller actions in a Zend_Application App

I've created a Zend_Application using the zf tool that's bundled with Zend Framework (1.96, if that matters) What at the rules for formatting action names and how those action names get translated into into URL paths, and where in the Framework codebase does this happen? I ask because I tried to create an action like public function c...

Good search services for a PHP (CodeIgniter) based job board?

Does anyone know any good 3rd party license based or open source search services (like Yahoo BOSS) that index and search through content? I'm creating a niche job board in CodeIgniter and I'd rather not have my search be in PHP. I'd like the service to be customizable enough to support refining content, and location based searching. ...

An interesting issue about mysql_real_escpae_string

I have simple form for editting site content: - a text input for title - a textarea for content When adding content, there is no problem, allthings add normally: $chead = mysql_real_escape_string(stripslashes($_POST['chead'])); $ctext = mysql_real_escape_string(stripslashes($_POST['ctext'])); But when edittig the article th...

Populating XML file in PHP

Currently, a friend of mine is wanting a Flash Gallery and the ability to upload files. I don't have the time of day to teach him where to edit the XML properly or dare I even give him FTP access. He hand picked out this gallery program: http://flashnifties.com/xml_gallery.php Which as you can tell works off XML. Creating a script to h...

Transform RSS-Feed into another "standard" XML-Format with PHP

Hey friends, quick question: I need to transform a default RSS Structure into another XML-format. The RSS File is like.... <?xml version="1.0" encoding="UTF-8"?> <rss version="2.0"> <channel> <title>Name des RSS Feed</title> <description>Feed Beschreibung</description> <language>de</lang...

DW-CS5: Run Facebook applications on local server

Hi, Dreamweaver CS5's Live View features seems to be pretty cool. Is it possible to even live view the facebook applications inside DW that we develop, if yes, how to do it. If not possible with DW's live view, then any other work around you may suggest please to test/view facebook applications on local server. ...

where can I find the php.ini for php-cli

It appears that the php command line is using a different php.ini from the main php interpreter. I am using Ubuntu 10.4. My problem is that in the main php.ini I have included an extra path for an external library, but in the cli version this is not present, and so I have a path inclusion error. thanks ...

open url through header in php

I have a .php file in which i have a added a simple code: <?php header("Location:http//www.google.com"); ?> when i run this code, then instead of opening google.com it opens a download file, which is the same as my php file. ...

Cookies not working for password-protected Pages on WordPress

Initially I had the issue reported in this question. Now, what I noticed is that there are some browsers that accept the password, and there are some which don't. Difference? For some reason the cookie is generated when I log in into the Administration module, but it isn't when I write down the password to access the page, forcing it to...

Identifying voice as male or female

I'm not much into audio engineering, so please be easy on me. I'm receiving an audio file as input, and need to detect whether the speaker is male or female. Any ideas how to go about doing this? I'm using php, but am open to using other languages, and don't mind learning a little bit of sound theory as long as the time is proportionat...

Run a JavaScript function from a php if statement

I am using php conditions and want to know if I can run a JavaScript funtion without some one have to click on it using JavaScript: if($value == 1) { javascript to run the function } How would I do that? ...

Large strings: Text files or SQL DB?

I am coding a forum system using PHP. I am currently storing a threads ID, title, author, views and other attributes in an SQL database and then storing the thread body (the HTML and BBcode) in text files inside a folder named after the thread ID. In practise it's really simple to grab the database values then just grab the thread bod...

Catch requests to non-existent classes (not autoload)

Is there a manner in which to catch requests to a class which does not exist. I'm looking for something exactly like __call() and __static(), but for classes as opposed to methods in a class. I am not talking about autoloading. I need to be able to interrupt the request and reroute it. Ideas? ...