php

Storing the HTML output from a local PHP file into a string using file_get_contents

There is a header.php file and it contains some php codes that return HTML. I know I can use require, include to echo the results, but what I want to do is to store its processed output string into a variable. In a page, I used: $headerHTML=file_get_contents('header.php'); Then I got the PHP code output rather than the processed HTML...

Simple implementation of admin/staff panel?

A new project requires a simple panel (page) for admin and staff members that: Preferably will not use SSL or any digital ceritification stuff, a simple login from via http will just be fine. has basic authentication which allows only admin to login as admin, and any staff member as of the group "staff". Ideally, the "credentials(user...

Doctrine SQL Server uniqueidentifier isn't cast as char or nvarchar when retrieved from the database.

When I retrieve a record from the database which has a column of type "uniqueidentifier", Doctrine fills it with "null" rather than the unique id from the database. Some research and testing has brought this down to a PDO/dblib driver issue. When directly querying via PDO, null is returned in place of the unique id. For reference, htt...

Amazon Product API ResponseGroups and Default results

A. In our application, most of the data we work with is stored as free text .i.e. there is no categorization done as of now. We are using openNLP libraries to make sense of the data(extract keywords/classify) and do a query to Amazon web services to pull the results of the query. We use searchindex=All and keywords=. Results are not ...

When hydrating a doctrine record manually, call to Doctrine_Record->exists() returns false, when it actually does exist. Options

When I manually hydrate or synchronize a record (for legacy integration reasons) and call ->exists() on the instance, it returns false. However, this record actually does exist. Is there some way to make Doctrine tell us the truth without having to execute another query? ...

What is a framework in PHP?

How does one determine if a certain PHP project has evolved to the point that it's a framework? ...

accessor and mutator?

when using doctrine i stumble upon these 2 words: accessor and mutator. are these only used in doctrine or are they specific for php? and what do they mean? thanks ...

Drupal: How to modify menu items with hooks?

I need to add the URL 'user/7/orders' to a particular menu. As this requires PHP for the UID (7), how do I write a script to add an item to a particular menu? ...

Modifying Model data in beforeSave of Behavior when using saveAll

I'm trying to write a Meta behavior for a project I am working on that will allow me to assign custom variables/attributes to a model, similar to how you can create custom fields in a wordpress post. I have created a Meta behavior that binds the meta model to the model it is acting on and also has a beforeSave callback that loops throug...

Can I retain a Google apps session token permanently for a specific user who logs into my google application?

Hi guys, is it possible to retain upon authorization a single session token for a user who signs into my gogle application. CUrrently my application seems to every now and then require the user to authenticate into google apps. I think it has to do with session dying out or so. I have the following code: function getCurrentUrl() { g...

How to send values to a controller?

How can I pass a result to a particular controller's action in zend? ...

AJAX, PHP, XML, and cascading drop-down lists

What PHP libraries would you recommend to implement the following: Three dependent drop-down lists Three XML data sources AJAX-based Essentially, I'd like to create an XML database and wire up a form that allows the user to select three different dependent parameters: User clicks Region User clicks District (filtered by Region) Use...

can someone help me fix my code?

Hi, I have this code I been working on but I'm having a hard time for it to work. I did one but it only works in php 5.3 and I realized my host only supports php 5.0! do I was trying to see if I could get it to work on my sever correctly, I'm just lost and tired lol Ol, sorry stackoverflow is a new thing for me. Not sure how to think of...

Which is faster: glob() or opendir()

Which is faster between glob() and opendir(), for reading around 1-2K file(s)? ...

Baffled by PHP escaping of double-quotes in HTML forms

I have a simple PHP script I use to front-end an SQLite database. It's nothing fancy or complex. But I have noticed from looking at the records in the database that anything I enter in a form-field with double-quotes comes across in the form-processing as though I'd escaped the quotes with a backslash. So when I entered a record with the...

addition of gmt times in php

Hi , i have a time zone in 2010-05-04T05:27:00.000Z format which indicates the GMT time and i want to add GMT 10+ in to it using php. i can do that thing using following code but how would i directly add 2010-05-04T05:27:00.000Z and GMT 10+ so that i can get a valid date and time. $offset=10*60*60; $dateFormat="d-m-Y H:i::m:s"; echo ...

cURL gets Internal Server Error when posting to aspx page

I have a big problem. I have some applications made on an unix based system, and I use PHP with cURL to post an XML question to an IIS server with asp.net. Every time I ask the server something I get error: HTTP/1.1 500 Internal Server Error Date: Tue, 04 May 2010 07:36:08 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET X-AspNet-Ver...

Strip H1 tag and its contents

How can i remove <h1>and its contents</h1> from the following line strip_tags(substr($article->content(),0,255) from this complete code <?php $last_articles = $this->children(array('limit'=>5, 'order'=>'page.created_on DESC')); ?> <?php foreach ($last_articles as $article): ?> <div class="entry"> <h3><?php echo $article->link($a...

Trace IP Adress in Wordpress

I need to trace the ipadress (where my website access)for optional loading of my theme.Explanation: I want to add a share link to twitter and facebok in my application.i think in some countries like china;twitter blocked.Thats why i need to check from where my site is accessing.otherwise which affecting my site's performance.How can we s...

give preference to print array values in php

Hi , I have country table, i fetch all values and moved into array , these value i like to populate into combo/dropdown list , here i want to do some magic things, that is , for my site most of the users coming from uk,us,Australia,Romain and few, So i like to populate by my preference , is there any array will do this magic w...