Hello,
I m using zend.
I want to define the below code outside the controller class & access in different Actions.
$user = new Zend_Session_Namespace('user');
$logInArray = array();
$logInArray['userId'] = $user->userid;
$logInArray['orgId'] = $user->authOrgId;
class VerifierController extends SystemadminController
{
public function...
I have a CMS content in database. The content contains '<img src= .............../>' also.
I want to retrieve this content using mysql query and show on frontend but with all '<img src='.........../>' removed from the content.
How can it be done using query in mysql?
...
<?php
$combinedArray = array("apple","banana","watermelon","lemon","orange","mango");
$num_cols = 3;
$i = 0;
foreach ($combinedArray as $r ){
/*** use modulo to check if the row should end ***/
echo $i++%$num_cols==0 ? '<div style="clear:both;"></div>' : '';
/*** output the ...
I have the following method to create an Excel file from in PHP starting with a two-dimensional array:
header("Content-Disposition: attachment; filename=ExcelFile.xls");
header("Content-Type: application/vnd.ms-excel");
$Data[] = array('field1', 'field2', 'field3');
$Data[] = array('field1', 'field2', 'field3');
$Data[] = array('fie...
I want to do the validation on my PHP side and then have my JQuery code display your changes have been saved when the submit button is clicked but the JQuery code states that the changes have been saved even when the validation fails.
How can i fix this so that PHP can do the validation and then JQuery can do its thing when PHP has fini...
I am developing a project under LAMP, there is a situation to generate xls file from the system then it would be upload by users later.
While uploading the document it's type is ODS , so it could not be parse by the system.
What can i do to resolve this issue, kindly expect suggestions to you all.
...
I am trying to upload a pdf file using webservice api. But this api doesnot work for pdf file. it works fine for text file.when i try to upload a pdf file it give error as
Client-SOAP-ERROR: Encoding: string '%PDF-1.4 %\xc7...' is not a valid utf-8 string
So can we convert this pdf file into utf8 string.
i am using php as a scripting l...
I am working on an issue management system, developed in PHP/MySQL.
It requires search functionality, where the user will mention the search parameters and based on these parameters the system will return the result set.
To solve this I am trying to write a function and all the user selected parameters are passed as arguments. Based on ...
Has anyone here tried it or is it possible?
I've been using PHP for quite a few years but never know exactly the underlying c scripts.
Is there a way to go into it?
...
I've made a simple form, with the proper enctype for uploading files. When i try to upload a .docx everything works fine in IE 8 and Safari, but in Firefox or IE 7 or 6 i can't even click submit, nothing happens! Could this still be a server issue? It's an apache server.
Everything works fine if i choose to upload a .doc file
<form enc...
Hi guys - this may seem odd but I was wondering if it was possible to add custom header details to emails already in an inbox. Like lets say I wish to add in the Header of the email something like - myvariable = myvalue and then be able to query it somehow. I'm looking at code from Iloha mail and most of the details like subject and from...
I'm trying to use squid to modify the page content of web page requests. I followed the upside-down-ternet tutorial which showed instructions for how to flip images on pages.
I need to change the actual html of the page. I've been trying to do the same thing as in the tutorial, but instead of editing the image I'm trying to edit the htm...
How do i get all defined vars inside a class like if it was called outside the class scope? When i call the function inside a class method i only get an empty object.
...
This problem drives me nuts, because the max_execution_time in the php.ini and in the htaccess and reported from php is definitely higher, than reportet in the warning message.
<?php
echo "Max execution time: ".ini_get("max_execution_time")."<br />";
while(true)
{
sleep(1);
}
?>
Output:
Max execution time: 240
Fatal error: Maxim...
I'ld like to configure my forms using config with an ini file.
I need individualized error messages like the following one:
suche.elements.methode.options.validators.strlen.options.messages.stringLengthTooLong = "Der Suchbegriff '%value%' ist zu lang!"
This works well for strlen and regex, but how do I set it up for "required" element...
I tryed to create a socket in php and reuse it from other process.
I know this can be done with a daemon script but I want to do this without.
I created a socket and binded it to a specific port.
$sock = socket_create (AF_INET, SOCK_STREAM, SOL_TCP);
socket_set_option ($sock, SOL_SOCKET, SO_REUSEADDR, 1);
socket_bind ($sock, 'xx.xx....
I need to be able to permanently change variables in a php file using php.
I am creating a multilanguage site using codeigniter and using the language helper which stores the text in php files in variables in this format:
$lang['title'] = "Stuff";
I've been able to access the plain text of the files using fopen() etc and I it seems t...
I have set an array in my config file that I use global in my functions.
This works fine, but now I want to pass the name of this array as a @param in my function.
// in config file:
$album_type_arr = array("appartamento", "villa");
global $album_type_arr; // pull in from db_config
echo $album_type_arr[0];
function buildmenu($name)...
Hi everybody!
I have to set some routing rules in my php application, and they should be in the form
/%var/something/else/%another_var
In other words i beed a regex that returns me every URI piece marked by the % character, String marked by % represent var names so they can be almost every string.
another example:
from /%lang/module/c...
I'am writing a migration in Doctrine and i have to add a autoincrement to a column, but i don't find any information to do so via the changeColumn-method.
...