php

how can i install php-json for php 4.3.3 ?

i think the title is self-explanatory, i work with easyPHP 1.7, which has the php version 4.3.3, which by itself doesn't include support for json, so i found php-json on the web but don't know how to set it up. so can someone help. thanks. ...

UTF-8 & IsAlpha() in PHP

Dear, I'm working on a application which supports several languages and has a functionality in place which tries to use the language requested by the browser and also allows manual override of this function. This part works fine and picks the correct templates, labels, etc. User have to enter sometimes text on their own and that's wher...

What does fetch in php do?

I don't understand the concept of the fetch function. I am doing a tutorial from 'PHP Solutions' book and i am using MySQL Improved to update something in the database. Here is the code: if (isset($_GET['article']) && !$_POST) { $sql = 'SELECT article_id, title, article FROM journal WHERE article_id = ?'; $stmt = $conn->stmt...

Zend Framework cookie management

hi all, i want to know if Zend Framework has any class for handling cookies. a class that wraps php's setcookie() function for example. thanks in advance. ...

Security considerations behind this code snippet in PHP

Hi all, I've reading some books on advanced PHP, and most of the time I find code like this: $classes = array ("MyClass1", "MyClass2"); if (!in_array ($_GET['class'], $classes)) throw new Exception ("Class not found!"); $params = $_GET; $obj = new $_GET['class']; if (!method_exists ($_GET['method'], $obj) throw new Exceptio...

Convert C# row to PHP

I want to convert a C# row to PHP, but it doesn't work (the result isn't the same): C#: PHP: Someone know how to do this? Thanks ...

(jQuery) Problem processing values in multiselect list box

Hi. I just discovered something that I found odd. I have mys listbox with several store items [item ID, item name]. <select multiple="multiple" size="4" name="storeListBox" id="storeListBox"> <option value="11">item 1</option> <option value="12">item 2</option> <option value="13">item 3</option> <option value="10">item 4</option> </sel...

PHP Bytes 2 DWord

I have an array: $arr[0] = 95 $arr[1] = 8 $arr[2] = 0 $arr[3] = 0 That are bytes. I need a DWORD. I tried: $dword = $arr[0]+$arr[1]*265+$arr[2]*265*265+$arr[3]*265*265*265; Is that right or am I doing it wrong? ...

PHP MySQL query with %s and %d

SELECT COUNT(*) AS test FROM %s WHERE id = %d AND tmp_mail <> '' What are %s and %d for? ...

What mysqli function should I use?

Hello, I'm currently trying to extract data from a table, and am using this: $online = mysqli_fetch_field(mysqli_query($db, "SELECT `online` FROM `tbl_system` WHERE `property` = 'extranet'")); However, it's not working as echoing $online give "Array". Here's a var_dump from $online object(stdClass)#3 (11) { [...

wordpress get_categories() issue

I have created the function below which is intended to list the sub categories of the parent with the id of 3. The function should also return meta data from the first post in each sub category. This works (kinda) but instead of just getting one set of data, it returns 3 sets with different outcomes. Any ideas why? global $cat; ...

How to make a DIV section clickable?

I have written a web page in which links are all contained within their own tags. I've also made them all button styles with CSS (border, background color, padding). How do I enable the whole DIV to be clicked to activate the link? ...

What's wrong with this function?

Hello, I'm using this function to determine whether my application should be online or offline: function online() { if ($online == "0") { if($_SESSION['exp_user']['userlevel'] != "1") { include("error/offline.php"); exit(); } } ...

How can I use PHP to play video clips when the user clicks a thumbnail?

hi i'm wondering can php do this take this for example, if your not sure what im trying to explain :p this is a example setup /var/www/ this is where all the php etc files folders are /var/www/sdata/ is where the videos are with same name as the output thumbs /var/www/thumbs/ same name-example.jpg thumb how can i use php to display vi...

How do I create a Load Balancer sort of logic using PHP?

Hello all, I wish to make use of my unlimited shared hosting to create several small shared hosting accounts that I can offload processing to. So I need to create some logic in PHP to create the basics of a Load Balancer. I have 4 shared accounts, one is the main site and the other 3 is the processing server accounts. Please see image....

Read lua-like code in php

I got a question... I got code like this, and I want to read it with PHP. NAME { title ( A_STRING ); settings { SetA( 15, 15 ); SetB( "test" ); } desc { Desc ( A_STRING ); Cond ( A_STRING ); } } I want: $arr['NAME']['title'] = "A_STRI...

Options for using ImageMagick from PHP with MySQL blobs?

So my host provides ImageMagick on the server, but no MagickWand or IMagick API for PHP. I can do operations with the PHP exec command to manipulate images. But that requires full path file names to work, and I want to pull my images from my MySQL database. Will I have to have pull them out of the database and put them to a file every...

How do I make an asynchronous GET request in PHP?

Hello all, I wish to make a simple GET request to another script on a different server. How do I do this? In one case, I just need to request an external script without the need for any output. make_request('http://www.externalsite.com/script1.php?variable=45'); //example usage In the second case, I need to get the text output. $o...

How to echo a MySQLi prepared statement?

I'm playing around with MySQLi at the moment, trying to figure out how it all works. In my current projects I always like to echo out a query string while coding, just to make sure that everything is correct, and to quickly debug my code. But... how can I do this with a prepared MySQLi statement? Example: $id = 1; $baz = 'something'; ...

Simple ajax onclick question

Hi, I'm having difficulty setting up a simple menu that displays results on a div box: I have a list of 10 links which link to php files on my server that return data. I would like it so that when the viewer clicks on one of the links, the data from the php file will display on a div box on the screen, and then when he clicks on anoth...