php

Bash or PHP script to execute stocked procedure on SQL server

Hi, I am trying to write a bash or PHP script that will execute a procedure on a MS-SQL server, does anybody have pointers on how to do that in the most easiest and convenient way? The script will run on a separate Linux box. Thanks. ...

How can I extract values out of this array?

Array ( [status] => success [stories] => Array ( [0] => Array ( [name] => John Doe [age] => 23) [1] => Array ( [name] => John Doe_1 [age] => 23) [2] => Array ( [name] => John Doe_2 [age] => 23) ...

Best practice for storing global data in PHP?

Hi I'm running a web application that allows a user to log in. The user can add/remove content to his/her 'library' which is displayed on a page called "library.php". Instead of querying the database for the contents of the users library everytime they load "library.php", I want to store it globally for PHP when the user logs in, so tha...

Identify valid server in XML-RPC request using PHP

I'm working on a client-server system, where the client makes XMLRPC requests to the server. The client part of the system is handed to a third-party, meaning that he could eventually modify the code or re-route the xmlrpc requests. Now, hoping the third-party won't modify the code, I need a way to make sure that the server the client s...

How can I find all records for a model without doing a long list of "OR" conditions?

I'm having trouble composing a CakePHP find() which returns the records I'm looking for. My associations go like this: User ->(has many)-> Friends , User ->(has many)-> Posts I'm trying to display a list of all a user's friends recent posts, in other words, list every post that was created by a friend of the current user logged in. T...

PHP Tidy Module: unsupported node type?

When using the PHP Tidy Library (More Specifically, The tidy_repair_string function) I keep getting the following error: Unsupported node type:8. what does this error mean, and what can I do to get around this? ...

Multidimensional array, problem with getting recursive variable output

I’m working on a multi dimensions array but i have a problem Imagine I have a company that can order some furniture’s Fx 5 chair of different type’s width different standard prices different discount (%) and a price after discount now what If a company can choose 3 of the 5 chairs to their design range and add each chair thru as chec...

one router instead of two. Kohana 3

Hi. I meet kohana 3. I would like to know the answer to my question. In general, there are 4 url that I would like to handle one router. Namely: / news / / news/11-02-2009 / / news / butik / / news/butik/11-02-2009 / Where date 11/02/2009 News. Can be any correct date. A butik a string [a-zA-Z_] + I made such a router: Rout...

Send Fax via SBS 2003 Exchange from Linux/PHP

We have SBS 2003 set up to allow us to send faxes out via a Windows Printer. I have also successfully integrated PHP on our Linux Server w/ Exchange through OWA/WebDav -- allowing us to crawl email folders, send out email, etc. through the exchange server. What I'm trying to do is to email out from PHP using the Exchange 2003 service. I...

php: what is the fastest way to display related data between three db tables

Hi, I'm looking for the best way to display data from 3 tables. Let me explain. I have one master table that lists events each event can have a number of categories so I'm using a join table linking the categories to the events. I want to loop through all the events and display under each event the categories that have been related via ...

Module based php system.

Hello! I'm trying to make a module based php system. Each module is a class which implements a module interface and got the same name as the php file. Each module is located inside a directory called Modules. I can list every module in the directory, but how do i get an instance of them? Is it even possible? A little pseudo-code to ...

How can I get all feed entries from a page like Google Reader? (Since RSS is transitory)

I'm trying to build a script to retrieve all feed entries from a given page, but I can get only the most recents. How does Google Reader do it? ...

Your thoughts on kohana's Event component

Hi, I was wondering what others think about kohana's Event component. I like it very much and use it extensively although I am aware that the feature is not native to PHP. As I have to make a decision for a framework to use in an upcoming and traffic-intensive project I would like to hear your thoughts on the subject. Besides all op...

Get The Category Name & Category Link Inside The Loop In WordPress

Is there a way to get the name of the category and the link to the category page separately inside the wordpress loop. I don't have the id of the category either and I wanna display images instead of category names therefore the_category() doesn't work for me. Thanks Appreciate all the answers.. ...

Can you post data from PHP.

I need to cause a user's browser to post data using PHP to another site. Example: You go to start.com/auto-login-hack (via GET)... then PHP sets the right headers etc. and causes the browser to, via POST, go to 3rdparty.com/login.php with login credentials. I have done this is the past by having an HTML form and an onload script that s...

Could this code break wordpress?

//on some hosts the uploads directory is not automatically created //on WP auto install so we create it if (!is_dir(ABSPATH.'wp-content/uploads')) { mkdir(ABSPATH.'wp-content/uploads'); } I'm trying to troubleshoot an issue in which some people who install my WP theme get an error (no description) or a blank white screen. I'm thi...

MySQL: Inheritance

I read about an inheritance feature in PostgreSQL that seemed pretty neat. Unfortunately I am forced to use MySQL. How would you do something similar in a clean way? Say you for example had the two following classes that you want to work with: User ˪ Id ˪ Name ˪ Password Employee : User ˪ Pay How would you store those in a MySQL...

How to handle recursive parent/child problems like this?

In web dev I come across these problems a lot. For example, we have a giant list of URLs that are in this format: /businesses /businesses/food /businesses/food/wendys /businesses/food/wendys/chili /businesses/food/wendys/fries /businesses/food/wendys/chicken-nuggets /businesses/pharmacy/cvs /businesses/pharmacy/cvs/tooth...

How do I convert a PDF file to HTML in PHP?

How do I convert a PDF file to HTML in PHP? Is there any lib or web service? I mean free, thanks! ...

Is CPU execution time different in Loop with Sleep() and Long Loops without sleep(), with both having the same total running time?

Hello, I have a loop that runs for approx. 25 minutes i.e 1500 seconds. [100 loops with sleep(15)] The execution time for the statements inside loop is very less. My scripts are hosted on GoDaddy. I am sure that they are having some kind of limit on execution time. My question is, are they concerned with "the total CPU execution tim...