php

is it right to save media file of project into svn repository?

I know that I can save all my projects files into repository so deployment of new version of software become only using svn export into properly directory. But I have a feeling that it is not right way and for media files I should use some other utilities for deployment like rsync. But it is also a problem with double-side sync = I like...

Sugar CRM Soap call not working properly

I am using a soap call to sugarcRM instance which is given below $response = $client->call('get_entry_list',array('session'=>$session_id,'module_name'=>'itf_Apartments', "query"=>"itf_apartments_cstm.neighborhood_c='$neighborhood'", 'order_by'=>'','offset'=>'','select_fields'=>array($type))); // Check for a fault if ($client->fault)...

UTF-8, and mbstring extension in php

While I was converting my latin-1 mysql database into utf-8 i came across this article (http://developer.loftdigital.com/blog/php-utf-8-cheatsheet) please note I have successfully converted my database and my app appears to be working/outputting correctly It the previously mentioned link it says about installing and using the mbstring ...

php conditional problem

Goal: User only selects one, only one option at a given time for the denomination, either some value of Nickels only, some value of Dimes only, or some value of Quarters only. Problems: Currently the code only defaults to Nickels only? Pre-existing condtion: If I select a different denomination, for example, Quarters only, I only get t...

Relative / Root paths on apache / cpanel / php shared hosting

Hi all. I am trying to deploy a php / codeigniter project to a shared hosting environment. Locally I am running MAMP and all my paths are referenced thus:- background:transparent url(/img/myimj.jpg) left top no-repeat; When I deploy the shared host, these links do not work and to resolve them I need to add "../". Changing all these r...

adding php to javascript

How can I add php variable to javascript e.g: onClick="javascript:alert('echo $name;')Click Me</a>*** but it is not working i have not includey original becuse it is not showing original …!! ...

PHP SimpleXML new line

Hi, I have created a XML file using PHP's simple XML, saved the file. When opening the file in php using fopen and printing the contents. my XML looks like this: (see below) <?xml version="1.0" encoding="UTF-8"?> <home><orderList><delivery_cost>0.00</delivery_cost><delivery_surname>TEST</delivery_surname><delivery_postcode>1234</delive...

How well is SQL Server implemented in PDO?

I'm getting a new project some time now and wanted to use PHP for this one, as I don't have the time to get started with MVC and absolutely hate C# for Webdev. So I was thinking of going "back to my roots" and use PHP and PDO for that. Problem is, the Databases are all SQL Server 2003 and I don't quite know how well that is covered in P...

Some thought about a PHP Enum setup

Hi all, For a project I'm working I need to have some sort of enumaration class since the data won't be changed It's useless to store it in a database and exhaust the db-server with unnecessary request. So after reading some related posts on SO I tried the following: class Model_MaintenanceTerminology { const SetDefault = array("id" ...

mysql/php - How to implementing a unique view system?

Introduction I am wondering what is the best way to implement a unique views system... I think I know how, so if I could explain how I think to do it and you point out any mistakes or improvements. obviously I will have to store a log table containing a video id and something which (relatively) uniquely identifies the user. At first I ...

Ordering and grouping in php/MySQL

I have a table with user_id and lap_time and I'm running the following query: SELECT `Lap`.`id`, `Lap`.`user_id`, `Lap`.`lap_time` FROM `laps` AS `Lap` WHERE `Lap`.`lap_time` < 57370 GROUP BY `Lap`.`user_id` ORDER BY `Lap`.`lap_time` ASC I am trying to get the all the laps that are quicker than X but only unique users. The query ...

Best way for fast processing

Hello all, As a PHP programmer faced a lot with (deepgoing) statements I'm curious how you handle this. Are you using switch, if-elseif-else or if-else structures? I personally prefer using the switch selector when dealing with more than 2 cases. Is this also the best way from a performance perspective? And how about nested statements?...

errors are not displaying in PHP script.

Hi, I have tried with these code: error_reporting(E_ALL^E_NOTICE); ini_set("display_startup_errors","on"); ini_set("track_errors","on"); ini_set("error_reporting","E_ALL^E_NOTICE"); But still errors are not appearing on my script.It just displaying only blank white screen when any error occur.Please guide me. ...

decorating Zend_Form_Element_MultiCheckbox in a unordered list

I need to decorate to Zend_Form_Element_MultiCheckbox into a unordered list, I can get each item surround by , by setting setSeparator to '' and the HtmlTag tag to li I just get find anything to set the around this list, anyone able to point me in the right direction? Thanks for reading (My code is below) $interests = new Zend_Form_E...

Caching in a clustered environment

Caching your data in your application code is generally a good idea for many reasons. We have being doing this for quiet some time in our shared environment which includes ColdFusion, .NET, and PHP. However, because we share this environment with many other development groups in our organization, there is significantly more downtime then...

compliant formatted email

hi, i've been using php's pear Mail & Mail_Mime libraries to send well formatted html emails with/without attachments. some hosting companies don't have these libraries installed, and are reluctant to do so. so, i'm looking for a good technical source, tutorial, readable spec so i can write my own class using php's mail function... do...

$_SERVER[REQUEST_URI] in all server environments

In a custom project of mine, a function is fully dependent on $_SERVER['REQUEST_URI'] variable. Does it always return the same value on all server environments? (IIS, Apache, etc.) Thanks. ...

Getting Theme information from the style.css file in Wordpress

With a Wordpress theme, it is necessary to add information to the top of the style.css file: e.g; for the default theme there is this: /* Theme Name: WordPress Default Theme URI: http://wordpress.org/ Description: The default WordPress theme based on the famous <a href="http://binarybonsai.com/kubrick/"&gt;Kubrick&lt;/a&gt;. Version: 1...

PHP SoapClient result missing data in the XML response

I'm trying to consume a SOAP web service and some of the complexType's in the WSDL aren't getting back to PHP will all the expected data. Here's one example: DataSheetAttribute definition from WSDL (http://ws.spexlive.net/service/soap/inquire?appId=1&amp;wsdl): <s:complexType mixed="true" name="DataSheetAttribute"> <s:annotation> <s...

Create subdomain upon user registration

I have a website where I want users that sign up to get their own subdomain. This subdomain is virtual, and every subdomain uses the same web server files. I use PHP and Apache, and I know about Virtual Hosts, but I'm wondering where I need to put the vhosts code. First, I don't have access to httpd.conf. Second, I want this to be done ...