php

Can't view order in magento

Hi, I've been setting up a fresh magento 1.4.0.1 install, working great so far. I did some test orders just to see. Everything works fine, but when I click on "view order" under "my orders", I get a bunch of error messages: There has been an error processing your request Notice: iconv_substr() [function.iconv-substr]: Unkno...

Disabling Xdebug's dumping of caught exceptions

By default Xdebug will dump any exception regardless of whether it is caught or not: try { throw new Exception(); } catch (Exception $e) { } echo 'life goes on'; With XDebug enabled and the default settings this piece of code will actually output something like the following (nicely formatted): ( ! ) Exception: in /test.php on li...

how to split mysql row

how to split mysql row? i have 12 row in my table then i want to display first 4 row and next display 4 row how to use please tell ...

Using clases in PHP to store function

Hello! I need some advise on my PHP code organisation. I need classes where I can store different functions, and I need access to those classes in different parts of my project. Making an object of this classes each time is too sadly, so I've found a two ways have to solve it. First is to use static methods, like class car { public s...

Send information from PHP to Java

I want to send some information from PHP to Java. Why? Because I have a database on my server, and I get information from my database using PHP scripts. Now I want to send that information to my client in Java. How can I do that? I send information from Java to PHP by POST, and it works well, but I don't know how can I do the reverse. ...

Frameworks And 'traditional' coding

Hello Sorry if this too open ended for this forum, but here goes. I mostly use languages such as PHP and Javascript without frameworks (e.g Jquery, Drupal, CakePHP). The only real exception to this for me, is Wordpress when 'traditional' coding is slower for building information sites. I've dabbled with several frameworks over the past...

Codeignitor Global Array Declaration

I have a sequence of number like follows 1 -> 25, 2 -> 60, 3 -> 80, 4 -> 100 and so on which means that if input is 1 output will be 25 and so on...I need to store it in global array.I would like to use it in multiple pages also.In codeigniter where i can declare a global array and store all these? I am trying like as follows in...

Fatal error with php code

Hello I have a problem in my php code that uses recursion: <?php solveTowers(5, "A", "B", "C"); function solveTowers($count, $src, $dest, $spare) { if (count == 1) { echo "Move a disk from ".$src." to ".$dest ; } else { solveTowers($count - 1, $src, $spare, $dest); ...

PHPUnit with Zend Framework

Hi, i have studied some examples for PHPUnit with Zend Framework, but there is one part iam not understanding. In the most examples, the Application Bootstrap runs from some kind of baseClass inside the setUp() Method. Why not in __construct()? Is there any good reason? Example iam talking about ...

how to get value from an array

how to get the value 4500 to a variable stdClass Object ( [total] => 4500 ) i tried like these $abc['total'] $abc->total when i print the $abc->total i got Array ( [0] => stdClass Object ( [total] => 4500 ) ) please help me ...

how to find the directory already is there or not in php

hi i want know find the directory is already there or not... if not i would like to create the directory... my coding is below... $da = getdate(); $dat = $da["year"]."-".$da["mon"]."-".$da["mday"]; $m = md5($url)."xml"; if(is_dir($dat)) { chdir($dat); $fh = fopen($m, 'w'); fwrite($fh, $xml); fclose($fh); ech...

PHP making input from web form case insensitive?

So I have some code here that takes user input from a standard web form: if (get_magic_quotes_gpc()) { $searchsport = stripslashes($_POST['sport']); $sportarray = array( "Football" => "Fb01", "Cricket" => "ck32", "Tennis" => "Tn43", ); if(isset($sportarray[$searchsport])){ header("Location: ".$sportarray[$searchsport].".html"); die; } ...

How to config phpeclipse to myeclipse 8?

I copy the features and plugins of phpecipse to the myeclipse root, but nothing happened. ...

Best way to simulate a domain?

I am going to build a website on a test server that will behave differently depending on which domain is used to access it (The real website will have multiple domains pointing to it). But how will I be able to simulate the different domains on the test server? ...

PHP: Singleton vs Static Class

Possible Duplicate: Difference between static class and singleton pattern? Hello, Just wanted to know what exactly is the difference between a singleton and static class? Thanks for your time ...

how to rearrange randomly and show all the 5 elements

how can I rearrange it randomly and NOT use shuffle function and still be able to randomly arrange all the elements $input = array("Neo", "Morpheus", "Trinity", "Cypher", "Tank"); $rand_keys = array_rand($input, 5); echo $input[$rand_keys[0]] . "\n"; echo $input[$rand_keys[1]] . "\n"; echo $input[$rand_keys[2]] . "\n"; ...

Issues with PHP 5.3 and sessions folder.

I recently upgraded to PHP 5.3 and since then I get (sporadic) error messages which indicate Apache (or may be the cleaner of the session files) has no permissions to the folder where the sessions are stored. This happens randomly and can't be reproduced with exact steps, which led me to guess it is the session cleaner. Any one has any e...

How to Keep the selected value of the select box after Form POST or GET

Im trying to implement the search feature in my website. when the search keyword is entered in the textbox, and the category combo is selected, the form will be Posted and the result will be shown on the same page. what i want is to keep the selected category of the combo by default in the form after posted For eg., If i select the c...

PHP - Execute PHP file

Alright this probably sounds easier than it is :) I've got two files: file1.php file2.php Withing my file1.php is a loop and within that loop i'd like to execute (not include) file2.php. while(1){ //execute file2.php } I know i could use exec() or wrap file2.php into a function but is there a native function to do something like t...

apache server is confusing with HTTPService responses

Hi, This is a very weird problem. I have an apache server on solaris with php. I wrote two php scripts that return values. Sometimes, when I run the php scripts urls on the same time, the apache server returns the result of one php script to the other php page. I tried to minimize the problem by write two php script: 1. hello.php - prin...