php

POST data not being received from iPhone

I've got an iPhone App that is supposed to send POST data to my server to register the device in a MySQL database so we can send notifications etc... to it. It sends it's unique identifier, device name, token, and a few other small things like passwords and usernames as a POST request to our server. The problem is that sometimes the serv...

How to secure PHP from piggy backing?

I just read this article about piggy backing in PHP. I googled it but not so much information there. Can anyone tell me more details how to prevent this kind of attack, what kind of code practices are vulnable and what we should do? Thanks in advance. ...

Compiling PHP Code

Hello, How do I obfuscation the PHP code. Thanks Jean ...

Remove Parent in PHP Multidimensional Array

What's the best way to remove the parent of a matched key in an Multidimensional Array? For example, let's assume we have the following array and I want to find "[text] = a" and then delete its parent array [0]... (array) Array ( [0] => Array ( [text] => a [height] => 30 ) [1] => Array ( [text] => k...

Release Project with parts licenced unter BSD with MIT-Licence?

I don't know if this is the right place to ask, but I'll try: Can I release a PHP project based on Zend Framework (BSD) and use the MIT-Licence to allow people to do anything they want with it? ...

(PHP) How remove extension from string (only real extension!)

Welcome, I'm looking for small function what allow me to remove extension from filename. I found many examples on the Google but there are bad because just remove part of string with "." . They use dot for limitter and just cut string. Look at this scripts $from = preg_replace('/\.[^.]+$/','',$from); OR $from=substr($from, 0, (st...

Execute a method less times possible - PHP

I have a site in multiple languages. I have a method that returns me the today currencies in a array. I display that currencies in a table then. // --- en/index.php <?php include_once "../exchangeRates.php"; $currencies = ReadExchangeRates(); // --- fr/index.php <?php include_once "../exchangeRates.php"; $currencies = ReadExchangeRates...

WYSIWYG HTML / CSS builder

Maybe it is to much to ask... I want to make a online WYSIWYG HTML / CSS builder where the graphic designer can build a website template without knowing CSS /HTML. For that purpose there should be a GUI to build a website template. That means HTML and CSS are created out of the choices selected in the GUI. http://www.constructyourcss....

UTF8 Bug in Chrome and Safari? Or wrong Apache setup?

Hello everyone So, this page: http://utf8test.n.ceromedia.dk/ has some UTF8 Characters. They display correctly in Firefox, IE and Opera, but doesn't work in Chrome and Safari. Boxes appear instead. I have and when I look at the headers: Content-Type: text/html; charset=utf-8 Can you see what's wrong? Is it something I do wrong, or is...

Making HABTM relationships unique in CakePHP

I have two models, called Book and Tag, which are in a HABTM relationship. I want a couple (book, tag) to be saved only once. In my models I have var $hasAndBelongsToMany = array( 'Tag' => array( 'className' => 'Tag', 'joinTable' => 'books_tags', 'foreignKey' => 'book_id', 'associationForeignKey' => '...

php slideshow sample

I try to do a simple image slideshow in php (just cycle images, no links, no other effects). after some googling I found the following in net: <HTML> <HEAD> <TITLE>Php Slideshow</TITLE> <script language="javascript"> var speed = 4000; // time picture is displayed var delay = 3; // time it takes to blend to the next picture x = new Arra...

Kohana 3: Organize Classes (MVC) in Subfolders

Hi, i was wondering how to organize and name my classes The goal: classes books controller model view authors controller model view // thanks for helping ...

php process forking and get the child process id

Hi all, Objective: My script will download a remote file upon form submission, since the file might be big, I would like to fork off a process and let the user go on with his/her life. Example of a command: wget -q --limit-rate=1k --tries=10 "http://helios.gsfc.nasa.gov/image_euv_press.jpg" -O /web/assets/content/image/image_euv_press...

Is good knowledge of PHP needed to make an installable template for CMS's like Wordpress, Joomla, or Drupal?

Is good knowledge of PHP needed to make an installable template for CMS like Wordpress, Joomla, Drupal? Or is good knowledge of XHTML and CSS enough? ...

Google Federated Login to retreive blog urls - PHP

Is there any way to retrieve the blog URLs registered under a particular Gmail account with the help of Google Federated Login in PHP ? ...

What should i learn after getting good knowledge of XHTML, CSS, Web Standards, Accessibility? Javascript or PHP?

What should i learn after getting good knowledge of XHTML, CSS, Web Standards, Accessibility,Usability, Information Architecture and Adobe Photoshop? Javascript/jquery or PHP First I want to learn and be focus to learn anyone of these two? Which language would be good to learn first? ...

Today's best approaches on scalable high-performance PHP-applications

Hi everybody! We are in the startup build phase of a new PHP webapp that will be placed onto a cloud server to allow fast and easy up/downscaling when customers will grow or decrease in numbers. Most probably, we will use a PHP framework (Codeigniter) to keep development speed high. Our next step is to implement features for increased ...

What does new self(); mean in PHP?

I've never seen code like this: public static function getInstance() { if ( ! isset(self::$_instance)) { self::$_instance = new self(); } return self::$_instance; } Is it the same as new className() ? EDIT If the class is inheritant,which class does it point to? ...

Regex for random text replacement on input stream

I have a paragraph of text below that I want to use an input source. And I want the doSpin() function to take the stream of text and pick one value at random, from each [%group of replacement candidates%]. This [%should|ought|would|could%] make it much [%more convenient|faster|easier%] and help reduce duplicate content. So th...

Form is trying to save the login value of the submit button to my DB.

Here's my Zend code: <?php require_once ('Zend\Form.php'); class Sergio_Form_registrationform extends Zend_Form { public function init(){ /*********************USERNAME**********************/ $username = new Zend_Form_Element_Text('username'); $alnumValidator = new Zend_Validate_Alnum(); $user...