php

PHP (XAMPP) install ssh2 module on CentOS 5 using phpize failed

Hi, I am running CentOS 5 with XAMPP PHP 5.3.1 I'd like to config SSH support for PHP. I first installed the libssh2, then download ssh2-0.11.0 from http://pecl.php.net/package/ssh2 issues the following commards and get the error response after 'make' #/opt/lampp/bin/phpize #./configure –with-ssh2 –with-php-config=/opt/lampp/bin/ph...

How to convert XML element data into PHP numeric array

I'm not really a web developer and I'm trying to make a web interface for parsing and displaying experimental data, so I apologize if this is a ridiculously easy solution. I'm trying to take data from an XML element and convert it into a PHP numerical array that I can plot using GD. So far, I have the XML creation, XML loading, and GD ...

rewrite url not working on ubuntu localhost in php

I have the file called call_center_interface.php Options +FollowSymLinks RewriteEngine on RewriteRule call_center_interface-act-(.*)\.htm$ call_center_interface.php?act=$1 i use the above url rewrite code but it is not working in ubuntu ...

(php) Any patterns around to help with memcache invalidation routine?

Hello, some cached elements of my project are stored in memcache. I'm using memcache tagging mechanism (not native, of course) to simplify cache invalidation control. Everything is ok, but project is growing, number of controllers and models is growing and it is becoming really difficult to support cache invalidation control. Unfortunat...

A newbie question about doctrine

Select * from tableName order by id desc limit 10 How to perform something like the above with doctrine by a demo? ...

Searching strings IN strings with preg

If someone searches by "ender" and the title of the item is "Henderson", this function should return: H<span class="mark">ender</span>son Somehow it is not working when i call mark_match("Henderson","ender"); Any ideas? This is the function that takes the original item title and compares it to the search string: function mark_match(...

Where to connect to DB in MVC

I am using php and building an MVC for my web application. I am to the step where I need to connect to my DB, look at the current URL, compare that to data in my DB, and then return the correct content from my DB to the user. My question is, where should I put the code that connects to the DB and processes it? Would this go in the Mod...

php preg_replace regex that matches multiple lines

I'm sure this is trivial, but I'm unable to create a regex that takes into account that the subject consists of multiple lines. The "m" modifier for one does not seem to work. ...

Using php variables to manipulate the html's title and the body's Id (is anybody doing this?)

I basically use php variables to store the value of the title and the body's ID. This last one is a technique to have my button (pressed) in the navigation according to which section of the page the user is (in this case the user will know he is currently at "home"). Beginning of my index.php: <?php $title = "New Project"; $bod...

Use Sort Whilst Still Retaining Keys

When I use the sort function in php it deletes all of the keys. What's an alternative method? ...

Oracle SP array parameter in php

I'm calling an Oracle Stored procedure which takes an array as an input parameter. Owa.vc_arr(varchar2) I'm making a call in php and getting an error. Any help would be greatly appreciated. Code which i'm using is given below. function findSupplier($ptype) { $proCall = 'BEGIN ICPISSAAPILIB.FIND_SUPPLIER(:P_PRODUCT_TY, :P_RESULTS); E...

How Do I Draw A Slightly Diagonal Gradient Fill in PHP?

I found the following function can draw a vertical gradient in PHP. However, many web designers like their gradients to have an upper-left lightsource to make the gradient look more realistic. So, how do I change the angle slightly on the vertical gradient, making it into a slight gradient? I don't want to completely overdo it, but just ...

Wildcard Search PHP

Hi, I dunno really what its called but basically this is what I want to represent this as a string in PHP : <div class="post" id="post-*Any Content*"> How could i do this. edit: sorry for not explaining it very well guys, basically I'm going to be checking to see if a string contains this text, where any content is basically anything...

(PHP) When using a SHA256 hash, how long is the hash? (ie, how long should my mysql VARCHAR be?)

I'm going to run SHA256 on a password + salt, but I don't know how long to make my VARCHAR when setting up the mysql database. What is a good length? ...

Install PHP 5.3 on Leonarp - Mac OS X 10.5.8

I was trying to update from php 5.2 to php 5.3. Basically what I did is I download the php 5.3 Package from entropy.ch and ran the package. Everything installed successfully. Now, when I try to run local pages. For those that are calling mysql queries, I get blank pages as a result. Looking at the apache2 error logs, I see the followin...

Shortcut to setting/getting variables in $_SESSION?

I have like a hundred or so form elements in a multiple-page form and I have to check if certain session vars were defined or not. The main thing is I have sub-namespaces within my sessions by way of a CONSTANT and then a fields key. Is there some shortcut to doing say, <input value="<?php echo isset($_SESSION[CONSTANT]['fields']['fir...

Regex for parsing comment variables in PHP

I have a comment block that can look like this; /** * variable1: value * variable2: value */ or like this; /* variable1: value variable2: value */ What I need is to be able to match any number of variable/value pairs and add them to an array. I can't seem to figure it out though, I keep matching the wrong things. All variables ...

Email a Div from a form

We have a form that is submitted and the results displayed to the user using php. As far as I am aware there is no way of styling a cgi email, nor a php email to look like the html page. I have tried with php (which I am not familiar with) but as far as I can see it will not work because there are other php captions inside what would be ...

AJAX/PHP Question

First off, thanks for reading my question! Secondly, I am looking at developing the most simple of simple Cart applications.. or functions. It will only be used on a single page for 3 static products. All I want: A PHP function, attached to a button, that will allow me to add a variable (cost of item) to another variable (Total Cart) ...

PHP5.3 is not working with MySQL5.1 IIS7 Times out

I have set up PHP5.3, MySQL5.1, and IIS7 on Window 7 but php doesn't want to work with MySQL. I'm assuming it is a configuration error or an incomplete install on my part. MySQL5.1 is working PHP5.3 is working, phpinfo() shows info and that i have enabled MySQL IIS is setup and using fastCgiModule to run PHP IIS registers php.ini...