php5

Looping through all attributes of a XML element in XSLT

Hey everyone, I am trying to use <xsl:for-each select="@*"> to grab all the attributes of a given element but when i do that my <xsl:choose> statement doesn't execute. Here is the element that I'm working with: <textBox id="Airfare" value="" label="text 1"/> Here is the XSLT template I'm using: <xsl:template match="textBox"> <div> ...

Zend_Pdf how to set 595x842 image as a background of A4 pdf

I have an image with 595x842px dimensions, I would like to use the image as a background for a page in pdf. I want it to fill the whole background. How can I do that? I have this now: <?php error_reporting(E_ALL); set_include_path(get_include_path() . PATH_SEPARATOR . 'd:/data/o'); // Load Zend_Pdf class include 'Zend/Pdf.php'; // ...

Zend_Pdf table?

Is it possible to create a table in Zend_Pdf? If yes, could you give me some code snippet? I've tried searching documentation and devzone but I couldn't find anything about adding tables to pdf. ...

Php compatibility question

I am trying to run cimyadmin(http://cimyadmin.net/) but i am getting a lot of helper depreciation errors and after looking around the web for answers i am convinced its a php issue.Is there a way to run php 5.0.2 or earlier but not less than php 5 code on latest distributions of php. ...

strotime() returning false on proper date formatted string?

Trying to format a date string using a technique I've used countless times, suddenly returning false (PHP5). Anyone run into this? //$new_date = June 14,2010 echo $new_date; $new_date = date("F j, Y", strtotime($new_date)); //returns the infamous December 31, 1969 because strototime() is returning false? ...

login script in php using session variables

<?php echo"login"; $connect=mysql_connect('localhost','user','password') or die(mysql_error()); $database=mysql_select_db('test'); ?> <html> <body> <?php $submit=$_POST['submit']; if(!isset($submit)) { echo '<form name="login" method=post action=login.php> <br/>username:<input type=text name=user></input> <br/> <input type=submit name=...

Add 2 values to 1 key in a PHP array

I have a result set of data that I want to write to an array in php. Here is my sample data: **Name** **Abbrev** Mike M Tom T Jim J Using that data, I want to create an array in php that is of the following: 1|Mike|M 2|Tom|T 3|Jim|j I tried array_push($values, 'name', 'abbreviation') [pseudo code], which gave me the ...

Can I refresh a Yii CGridView from js?

When a "Create" modal dialog is submitted via XHR Then the rows in a Yii CGridView should be refreshed. I've tried to achieve this by rendering the new gridview in the XHR "create" action and then inserting it into the page via $("#list").html(response), but rendering a CGridView causes jQuery <script> include tags to be registered for ...

copy text (Indian language- GUjarati) from word document to web page text area problem.

Hi all, I am developing one site in Indian language (Gujarati). My problem is as below: My client wants that they able to copy Gujarati text from word document and paste into the Text area. But when i copy text from word doc and paste into text area the its get converted to the English letters. http://www.chanakyanipothi.com/gujchan...

get twitter screen name

i am new to OAuth i want to know how to use "Twitter OAuth library from Abraham Wiliam" to get user's credential information.such as screen_name. ...

Is it possible to set a location of a library extension within a Php file

I want to load an extension within a Php file as I don't have access to the php.ini file. I tried: ini_set('extension','php_gd2.dll'); With the file in the same directory as the Php page but it did not work. Must it always be done with in php.ini or can it be done like the above? ...

Zend_Pdf UTF-8 characters?

Hello, I have problems outputting UTF-8 characters into pdf file with Zend_Pdf. Here is my code: // Load Zend_Pdf class include 'Zend/Pdf.php'; // Create new PDF $pdf = new Zend_Pdf(); // Set font $page->setFont(Zend_Pdf_Font::fontWithPath('fonts/times.ttf'), 12); // Draw text $page->drawText('Janko Hraško', 200, 643, 'UTF-8'); ...

Kohana 3 download file from another server

Hi All, I am using Kohana 3. Up to now my downloadable files were residing in my application document root. So far using $this->request->send_file($download_file); it was working perfectly right. But now my downloadable files are on another server can be accessed using http say http:://www.test.com/download/test1.doc. So Kohana's $thi...

Sorting by a specific key of a multi dimensional array PHP

I have an array of arrays. The inner array looks like this. Array ( [comparisonFeatureId] => 1188 [comparisonFeatureType] => Category [comparisonValues] => Array ( [0] => Not Available [1] => Not Available [2] => Not Available [3] =...

Using a class as namespace

Are there any reasons I should not create a final class with static methods to avoid that some internal functions are called? final class ModuleGlobalFunctions { static public function generateWord { $result = ''; while (strlen($result) < 12) { $result = self::generateSyllable(); } return $result } static ...

Call function of just created object

How to call function of just created object without temporary variable? Code (new \Foo())->woof(); is not valid in php. What is right? ...

Another Undefined Index (this one's defined though)

Alright, PHP is throwing this error (in the log) and it's quite detrimental to the application. PHP Notice: Undefined index: sessid in methods.php on line 7 Yes, I'm aware of what this error means, what I cannot figure out is why it's obviously defined and saying it's undefined. Here is the relevant code in methods.php $sessid = mys...

PHP Accessor functions and arrays

Using a __set accessor function in PHP I can set the value of a scalar, but not an element of an array. Ie: $p->scalavar = "Hello"; // This works fine $p->myarray['title'] = "Hello"; //This does not work My accessor is as follows: function __set($mbr_name, $mbr_value) { $this->$mbr_name = $mbr_value; } Thanks! ...

Read an image to a byte array using php

Using php I need to read an image to a byte stream which has to be passed to a .NET web service. Can anyone provide me with a php code snippet to read an image to a byte array ? I am using using php 5. thanks ...

Is PHP MVC too hard for me?

I am reading a lot of PHP MVC material. There's a lot to take in at once. I am trying to create one from scratch, but it seems very difficult especially with OOP involved. Is this out of my level? If so, what steps should I take? Maybe I am trying to hard by trying to create everything perfectly right off the bat. I appreciate any readin...