php

Zend Framework: view var set in bootstrap not accessible in view scripts?

I've set a view var in bootstrap file like this: protected function _initVars() { $this->bootstrap('layout'); $layout = $this->getResource('layout'); $view = $layout->getView(); $view->theme = 'MY_THEME'; } My application.ini has following line as well: resources.view[] = But inside view scripts, <?php echo $this->...

Jquery/Ajax Refresh without reload or load the page?

I have a report page which dynamically generate the record and saved in the database. From database i need to show the dynamically updated records in the page without reload or load the contents using setInterval time function. ...

PHP .htaccess issue, specific/dynamic keywords

Here goes my .htaccess file's content. Options +FollowSymLinks RewriteEngine On RewriteRule ^online-products$ products.php?type=online RewriteRule ^land-products$ products.php?type=land RewriteRule ^payment-methods$ payment-methods.php RewriteRule ^withdrawal-methods$ withdrawal-methods.php RewriteRule ^deposit-methods$ deposit-methods...

php, checking correctnes of text splitting

I need to split html document on two parts. First part, should contain N(30) words, and next one should contain everything else. And the main problem, is to prevent splitting tags (description and body of tags). <a **<=>** href="text" > text </a> <a href="text" > **<=>** text </a> <a href="text" > text </ **<=>** a> Give me please su...

Change Stylesheet via If in php

Hey i have a question. At the moment i'm trying to use a stylesheet which i get through a if. but it doesn't do anything. here is my code at the moment. the variable $stylesheet will be variable but while testing i've setted it to normal <?php $stylesheet = 'normal' if($stylesheet = 'small') { $style = './sitestyle/styles...

Passing Info From One View to Another

EDIT 1. The results of a query from my database are displayed on my view page. Next to each unique result is a button: // first_view.php <?php echo form_open('controller/method'); ?> <?php foreach($results_found as $item): ?> <p><?php echo $item->name ?></p> <p><?php form_submit('buy','Buy This'); ?></p> When a user clicks on one ...

How to deserialize MXML with PHP?

Hello, I have an array structure that have to be converted to MXML. I know of PEAR XML_Serialize extension but it seems the output format it produces is a bit different. PHP generated XML: <zone columns="3"> <select column="1" /> <select column="4" /> </zone> MXML format: <mx:zone columns="3"> <mx:select colu...

Different formats of OpenIDs

stackoverflow, I am experimenting with implementing OpenID in my existing site. I have looked at Plaxo's article on this very subject and I'm a mite confused about something. I am using this PHP OpenID library. I have some code running, and I am getting a unique OpenID back. From myopenid.com, I am getting an id that looks like https:...

Is there a JQuery DOM manipulator/CSS selector equivalent class in PHP?

I know that I can use DOMDocument and DOMXPath to manipulate XML files. But, I really love JQuery, and it would be great if there was something more like JQuery in the PHP world that I could use for sever side DOM manipulation. NOTE: I'm only interested here in how JQuery Selects and Manipulates the DOM, not all the other parts...

PHP object access using string

Hi all, I have an object in PHP with some very odd property names. I just need to know how to access a property when it's name is "//www.w3.org/1999/02/22-rdf-syntax-ns#type". I found something that suggested $object->{'//www.w3.org/1999/02/22-rdf-syntax-ns#type'}; but that doesn't seem to work. Thanks in advance Rob ...

php and mysql user tracking and reporting

Hi, I currently have a table which consists of user information and lesson id; the table layout looks like: ---------------------------------------------------- |employeeID|numVisits|lessonID1|lessonID2|lessonID3| ---------------------------------------------------- |33388 |2 |1 |0 |3 | and a lessons ta...

Javascript add a PHP file.

var editing = false; if (document.getElementById var buttext = document.createTextNode('Ready!'); butt.appendChild(buttext); butt.onclick = saveEdit; } function catchIt(e) { if (editing) return; if (!document.getElementById || !document.createElement) return; if (!e) var obj = window.event.srcElement; els...

Eclipse PDT Autocomplete

Hey Guys, this sounds a bit stupid, but i try for several days now to get autocomplete working. i have a clean install of pdt and one with plugins like aptana and subversion, but none works with autocomplete. what do i have to do that i get a list with all functions, variables, etc beginning with "str" for example when i type "str"? Do i...

PHP: cUrling in Aweber

Did anyone here manage to curl in aweber? Thanks! ...

How do I decode mail header strings with their encoding type in them in PHP

I'm creating a small, web based, mail client in PHP and noticed that a number of email Subjects and Contents appear as follows: =?ISO-8859-1?Q?Everything_for_=A35_-_Box_Sets,_Games_?= =?ISO-8859-1?Q?and_CD_Soundtracks...hurry,_ends_soon?= =?utf-8?B?UGxheS5jb206IE9uZSBEYXkgT25seSDigJMgT3V0IG9mIHRoaXMgV29ybGQgRGVhbHMh?= =?windows-1252?Q?J...

Can you use back references in the pattern part of a regular expression?

Is there a way to back reference in the regular expression pattern? Example input string: Here is "some quoted" text. Say I want to pull out the quoted text, I could create the following expression: "([^"]+)" This regular expression would match some quoted. Say I want it to also support single quotes, I could change the expressio...

Datetime and date-range comparsion

Hello guys, I have datetime-row in mysql database. I have to check time between now and that date using php. If the range is bigger then 1 month - do somtething. I tried something like this: $dateFromMysql = strtotime($rowData); $currentDate = date("m/d/y g:i A"); And then comparsion by hands. It's ugly. ...

How to create a test environnement on the production FTP

Hello, I'm currently working on a symfony webapp, which is already on production. To develop and add/delete/modify functionnality of the model, I work on my laptop, using symfony 'dev' environnemment. I test if everything work fine, then I pray a little and deploy it on the prod server (with all the risk of data error, like when I add ...

how to install registration plugin in roundcube

can any one tell me how to install registration plugin in roundcube. i tried posting in other forum, but no correct response ...

preg_replace - don't include string if $4 is blank

I have this expression: $regex_phone = '/^(?:1(?:[. -])?)?(?:\((?=\d{3}\)))?([2-9]\d{2})' .'(?:(?<=\(\d{3})\))? ?(?:(?<=\d{3})[.-])?([2-9]\d{2})' .'[. -]?(\d{4})(?: (?i:ext)\.? ?(\d{1,5}))?$/'; if(!preg_match($regex_phone, $data['phone'])){ $error[] = "Please enter a valid ph...