php

Is it possible to auto generate Getter/Setter from Array Values in PHP?

So I have a couple of arrays $array_1 = Array('one','two','three'); $array_2 = Array('red','blue','green'); Is there a dynamic way to create the Setters and Getters for an array with single value entries? So the class would be something like: class xFromArray() { } So the above if I passed $array_1 it would generate something li...

Strange characters/text when installing PHPBB3 forum

Hi all, I am trying to install a PHPBB3 forum, and get strange characters/text after the install on certain pages - everything seems to install correctly though...no errors from the installer.. :( Originally it only appeared on the "new topic" or "post a reply" pages, but now it is appearing in various different places! Any help woul...

Symfony sfDoctrineGuard plugin sfGuardUser module

When using sfDoctrineGuard plugin, it automatically generates the backend administration functionality where I can edit users of the system and assign them permissions. So I visit http://.../backend_dev.php/sf_guard_user/:id/edit where I am presented with the user's information including the available permissions to select. By default ...

A good PHP IDE to work with Joyent

I want to start working with Joyent accelerator over PHP. I have been using aptana IDE + Cloud for a year and I'm fed up with it. Have you some good suggestions? Thanks ...

Paypal Payflow pro library

I already have an express checkout integrated with my Codeigniter application. Now I want to integrate seamless paypal where I collect the CC information and pass it to Paypal (via backend) and once everything is approved, my application shows that to the user. All this with out ever going to Paypal's website. I know that Paypal gives a...

how can i make sure only a single record is inserted when multiple apache threads are trying to access the database?

I have a web service (xmlrpc service to be exact) that handles among other things writing data into the database. Here's the scenario: I often receive requests to either update or insert a record. What I would do is this: If the record already exists, append to the record, If not, create a new record The issue is that there are cert...

Can multiple wordpress's feed off one database?

I am a template designer and I want to create one wordpress with all generic posts, but I don't want to have to keep logging in and copy & pasteing the same wordpress posts everytime. Can I point multiple WP installs to one database? A harder way would be export a master db and importing it to each install. Before I go crazy and try to h...

Digital Content and Google Checkout

I have integrated Google Checkout to my payment system with the use of php code provided on the Google Official site. Now I need to add Digital Content to the Cart. I have checked the Cart and couldn't find any direct function or example for achieving this. Please suggest the method to add Digital Content to Google Checkout ...

Stop While true loop with a specific or any key pressed in a php script

Hi, I want to stop a while true loop when a specific or any key is pressed. I know I can ctrl-c the script but I am locking tables in my MySql database, and I doesn't want to unlock them in the beginning of the script because i want to be able to run multiple instance of the script. Thank you for any insight ...

How to setup split test?

I want to create a way to test different layouts on a page to see which get more conversions. For example. If I have 2 versions of a page and I send 50% to page A and 50% to page B and see which one converts more sales. So I am thinking maybe use .htaccess to rewrite half to page A and the other half to page B. But how can I do that w...

best way to take Backup of code and DB ?

So what can be best way to have a Backup of code and DB is it downloading Locally via http ? But i fear it is security risk as some hacker might get access to it . I am looking into compress then encrypt the compressed file. But i dunno what encryption i should use and if linux CLI tool available for password protected encryption ? T...

Is Stomp's MessageMap format completely unusable?

I'm sending MapMessages in Java to ActiveMQ and retrieving them using Stomp in PHP. My message creation code looks like this: MapMessage message = session.createMapMessage(); message.setInt("id", 42); message.setInt("status", 42); message.setString("result", "aString"); When I retrieve them in PHP, the array that's created looks like ...

Why is this mail going straight to SPAM box?

I am using the following script to send mail <? extract($_POST); $subject = "Feedback from ".$name." (".$email.", Ph: ".$phone.")"; $mail = @mail($send,$subject,$content); if($mail) { echo "Your feedback has been sent"; } else { echo "We are sorry for the inconvienience, but we could not send your feedback now."; } ?> But this is alwa...

Can someone point me to a good PHP/MySQL salted hashed password implementation?

Hey everyone, After reading about salts password hashing Id like to implement a simple version for an admin area to a site Im building. If you have any good links with code that have implemented this idea well, I would appreciate it if you could share. Thanks, ...

XML/PHP : Content is not allowed in prolog

Hello, i have this message error and i don't know where does the problem comes from: <?php include "DBconnection.class.php"; $sql = DBConnection::getInstance(); $requete = "my resquest (which is working)"; $sql->query($requete); $xml = '<?xml version="1.0" encoding="UTF-8"?>'; $xml .='<GamerCertified>'; while($row...

A quick regular expression needed

I want a regular expression which ALLOWS only this: letter a-z case insensitive allows underscores allows any nrs How should this be written? Thanks ...

Referring to the public root in PHP - best practices

I've been using the $_SERVER["DOCUMENT_ROOT"] environment variable to refer to the public root in my apps. Now I'm realizing that that's not very reliable. I'm thinking about an approach where I define a constant in my index.php based on a magic constant. Something like that: define("PUBILC", __DIR__."/"); I'm not sure about it though...

what does this do, preg_match

preg_match('/^(AREA|TEST)$/i', $arrow) ...

Generate Windows .lnk file with PHP

Hello, I'm working on a project which involves an FTP server running ProFTPd and a PHP/MySQL backend that creates accounts for users. Upon the creation of accounts, users are sent e-mails with their account details and instructions for downloading FileZilla or CyberDuck, depending on their OS, detected via user-agent string. To make t...

How to consume PHP SOAP service using WCF

I am new in web services so apologize me if I am making some cardinal mistake here, hehe. I have built SOAP service using PHP. Service is SOAP 1.2 compatible, and I have WSDL available. I have enabled sessions, so that I can track login status, etc. I don't need some super security here (ie message-level security), all I need is transp...