php

How to manage eclipse project on remote computer; ssh, ftp?

Hello, Usually I'm creating project work space on my localhost (win). As soon as my code is tested I'm committing it into repository. But some days ago I've faced a little difficulty. My customer want me to write code right on his server because he have some handmade binaries working only on his machine (solaris). I really don't know w...

facebook leftcol links how those work?

hi everyone, I never understood how facebook left column links eg welcome, newsfeeds and photos, how this things wont open new page beside it open #link, do they have any server side check client side. and second thing how they open whole page in content div, yes you can do this with javascript but they dont have onclick event on that it...

Site in maintenance. How to redirect visitors?

My PHP site in maintenance. How to redirect visitors to a "site in maintenance" single page? I heard something about app_offline.htm for ASP.NET. Is there something similar for PHP? I want that every page from "mysite.com" be redirected to "maintenance.php"; I don't want to do the minimum modification in the existing site pages, idea...

Are there any PHP DocBlock parser tools available?

I would like to build some smaller scale but hightly customized documentation sites for a few projects. PhpDocumentor is pretty great but it is very heavy. I thought about trying to tweak the templates for that but after spending only a couple of minutes looking into it I decided that it would be too much work. Ideally I'd like to see s...

Pass a variable from postDispatch() to view instance in Zend Framework

I have a controller plugin with postDispatch() hook, and there I have a $variable. How to pass this variable to the view instance? I tried Zend_Layout::getMvcInstance()->getView(), but this returns new view instance (not the application resource). The same with $bootstrap->getResource('view'). I don't want to pass it as a request para...

What exactly is a framework? Like Zend Framework for PHP

I am new to coding and would just like to know a bit more about frameworks. How does a framework help you code and what exactly is it? Such as Zend for php. ...

php proxy to local mercurial server

I was wondering is it possible to create a php proxy to a server that listens onlu locally so that the php gateway is public and it directs everything to the server listening on localhost. This server would be mercurial's hg serve that listens only on 127.0.0.1 and php will do the authentication. Do You think it's possible to do? Anybo...

Zend_Registry: real life examples

Do you find Zend_Registry useful? For which tasks it should be used? For which not? Global state for variables is not a good practice. Main objects may have global state injected via $front->setParam('paramName', $object), so what's the purpose of Zend_Registry?. ...

Giving my function access to outside variable

I have an array outside: $myArr = array(); I would like to give my function access to the array outside it so it can add values to it function someFuntion(){ $myVal = //some processing here to determine value of $myVal $myArr[] = $myVal; } How do I give the function the right scoping to the variable? ...

mysql query not running correctly from inside the application

I am completely stumped. Here is my php (CodeIgniter) code: function mod() { $uid = $this->session->userdata('uid'); $pid = $this->input->post('pid'); if ($this->_verify($uid,$pid)) { $name = $this->input->post('name'); $price = $this->input->post('price'); $curr = $this->input->post('curr'); ...

returning statement created by mysqli_stmt_bind_param

I am using mysqli_stmt_bind_param() to create an INSERT statement. For some reason I am getting an error. I used mysqli_error() to see the error message, but it's not especially useful. Is there a way to just see what query is actually being executed? the resulting error: You have an error in your SQL syntax; check the manual that ...

Article search engine in php

Hello, I am using sphinx as a search engine on my website its working perfect and I have no complain with it. The only thing it lacks is, it does not allow me to search articles whose query length is more than 15 words. I know in reality people don't use more than 3-4 words i want to use it for finding duplicate contents. I was wonderi...

Image cropping in PHP is producing blank result

I'm simply trying to crop a JPEG image (no scaling) using PHP. Here is my function, along with the inputs. function cropPicture($imageLoc, $width, $height, $x1, $y1) { $newImage = imagecreatetruecolor($width, $height); $source = imagecreatefromjpeg($imageLoc); imagecopyresampled($newImage,$source,0,0,$x1,$y1,$width,$height,...

How does session_start lock in PHP?

Originally, I just want to verify that session_start locks on session. So, I create a PHP file as below. Basically, if the pageview is even, the page sleeps for 10 seconds; if the pageview is odd, it doesn't. And, session_start is used to obtain the page view in $_SESSION. I tried to access the page in two tabs of one browser. It is not...

All symbols after "&" stripped

My query: mysql::getInstance()->update('requests', array('response' => mysql_real_escape_string($_POST['status'])), array('secret' => $_POST['secret'])); ?> If i wand to add string with "&" symbol, all symbols after "&" stripped. Example: string: !"№;%:?*()_+!@#$%^&*()_+ in database i see only: !"№;%:?*()_+!@#$%^ How to fix this? ...

PHP JAXB Equivalent

Is there a PHP equivalent to JAXB? It's proved very useful for Java development, and as a new PHP'er I'd like to use the same concepts JAXB provides in a PHP world. ...

Optimal way to generate list of PHP object properties with delimiter character, implode()?

I am trying to find out if there is a more optimal way for creating a list of an object's sub object's properties. (Apologies for the crude wording, I am not really much of an OO expert) I have an object "event" that has a collection of "artists", each artist having an "artist_name". On my HTML output, I want a plain list of artist name...

facebook connect box redirecting in the box not on the page

I am working on a facebook connect application and I am just integrating facebook connect. So far, it does connect to facebook, however, it redirects to the page specified in the application settings in the dialog that appears instead of the page I was at. The dialog does not close and the page it supposedly directing to appears in the d...

PHP Array To Class Static Public Values.

I want to make a class that has all the values of an array as a static object in that class. For example: $vars=array(... );//some array with actual values $Class_code='class MyClass{'; for($i=0; $i<count($vars); $i++){ $Class_code.='static public $'.strval($vars[i]).';'; } eval($Class_code.'}'); /* When I echo the line above ...

fopen with/without @ before it

I've seen code samples that use an @ before fopen as in $fh = @fopen($myFile, 'w'); What's the significance of this @? ...