Hi I'm trying to move away from procedural programming and at the same time have a better appreciation for design patterns. I would like to know what Design Pattern can best represent the code below. It's an if else statement that basically outputs a value based on the time of day. This is just a sample of several if/else if statement I ...
I've seen a few creative solutions for dealing with serialized SPL objects but am looking for more options (or elaborations). I store nested serialized objects - of which, one is SimpleXML - in the database, only to be un-serialized later. This obviously cause some problems.
$s = new SimpleXmlElement('<foo>bar</foo>');
$ss = serialize($...
I'm having problems loading the parse_ini_file, currently I have registered a path in my include-path but there was an unexpected behavior parse_ini_file (didn't load)
(A little note: using phpunit to test, don't know if it affects the loading)
Example:
Path is: "C:/mydevelopworkspace/project/"
In that path there are well, php file...
I am trying to integrate Selenium and phpUnderControl on a headless Linux box, but haven't found anything about it. I can run Selenium with Xvfb, and phpUnderControl is running OK. My question is: how to configure phpuc to execute selenium tests, and show their results on its webpage? Is it possible?
...
I want to track a few hundred, maybe a few thousand people in real time.
Let's say that the hardware aspects are sorted out and I can get the data into a database.
Now, I want to get it out and show it, in real-time.
Weeeell ... "real-enough" time. Let's say that I want to draw a floorplan of a building and plot everyone every 1 to 5 ...
Can you tell me what are the process in a php file compilation.
...
I have a navigation bar on my webpage with links to different pages. Is there an easy way to automatically set the class on the navigation element corresponding to the current page? For instance, I want the "About Us" tab on the bar to have a different style if you're currently viewing the "About Us" page. I know I could rig up some P...
I am writing a weather API to connect to the NOAA's XML METARS in C# NETMF. Before, this API was written in PHP, where I was able to use an associative array to return the weather parameters. For example, the return of the getWX() function might have been
Array(
"temp_f" => "70.0",
"windchil" => "65.0",
"wind_dir" => "90"
);
I am try...
I am designing a web site, and it has the ability to log in. When someone is logged in, there is at times a need to know what group they're in. Specifically, whether they are in the officer group. Currently, I have a MySQL stored proc BOOL is_officer(INT id), where id is the user id number.
My question: Is it wise to make a PHP function...
i have a favicon.ico in my webroot folder according to this piece of code
<link rel="icon" href="<?php echo $this->webroot;?>favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo $this->webroot;?>favicon.ico" type="image/x-icon" />
and i use this in my header to make it appear on all the pages.
<?php echo $ht...
We have a site built in Zend Framework and we're using the Zend Soap client.
I'm having trouble with one of the soap requests:
It's expecting data in this form
<CustomerForm>
<CustomerFormRow>
<CuisineType>3</CuisineType>
<CuisineRestaurant>True</CuisineRestaurant>
<Nu...
I am looking for a PHP example/tutorial which can accept hi-scores/survey upload from an iPhone. Hopefully, the PHP script:
accepts POST, in additional to GET
works over SSL (https)
connects to MySQL
In addition, it'd best the iPhone can get a session from the server and submit the session value along with the hi-score. Thanks
...
I am using Jaxer.Sandbox.open(url,null,openOptions); method to fetch url contents. I want to find out time required to fetch url content. If this process took long time say more than 6 sec. then custom error page should display.
...
Hello Everyone,
I am used to doing dynamic Binding in PHP this way
function ($className)
{
$obj = new $className();
.
.
.
}
here $className is a String parameter and based on name of the class an object of that class is created. So when I need to add more functionality I just add another class and everything get sorted out automa...
Possible Duplicate:
What is a RECURSIVE Function in PHP?
I was just wondering what is a recursive function in PHP? And is there any good tutorials or examples of a PHP recursive function?
...
I want all traffic to go to:
http://www.domain.com
http://domain.com
|
V
http://main.domain.com
I can use .htaccess or maybe something in PHP, I'm using zend framework. Please note I also have:
http://sub1.domain.com
http://sub2.domain.com
thx
...
I have a xml file, and i need to append a child to it if a parent exists. So i used xpath to query for that specific node.
$dom = new DomDocument();
$dom->load('testing.xml');
$xp = new domxpath($dom);
$category = $xp->query("tree[@heading='something']");
Now i am not sure how to append a child to this result. The variable $category ...
Well It seems that we have not a lot of Facebook people here, still it is a nice place to ask.
How can I get the pages that user that gave me an extended permission is a admin of?
...
I have a PHP webserver and a .NET mobile application. The .NET application needs data from a database, which is provided (for now) by the php webserver. I'm fairly new to this kind of scenario so I'm not sure what the best practices are. I ran into a couple of problems and I am not certain how to overcome them.
For now, I have the follo...
Paypal IPN doesnot return any variable for subscription payment, I have spent more than a week, still i haven't break the wall. I am using host gator webhosting service.
please send the the working example...thankyou
[email protected]
...