php

Possible Multi-Instanced Object Problem in PHP

Hi, I'm getting a "Call to a member function process_data() on a non-object in page.class.php on line 35" even though the object has been called. Here is the index.php extraction showing the object being instantised // require our common files require("modules/module.php"); require("registry/objects/datetime.class.php"); require("reg...

Any means of reading third party cookies from "friend" sites?

A recent question made me post this one. I'm working on a set of web pages that have some very simple user login, and store the user id in a cookie. Let's say that due to certain decisions which I'm in no position to overrule, the pages use several alternate domain names. I.e., the login page uses one domain name, and the page that shou...

How to handle diacritics (accents) when rewriting 'pretty URLs'

I rewrite URLs to include the title of user generated travelblogs. I do this for both readability of URLs and SEO purposes. http://www.example.com/gallery/280-Gorges_du_Todra/ The first integer is the id, the rest is for us humans (but is irrelevant for requesting the resource). Now people can write titles containing any UTF-8 c...

php disk_total_space

hello, i need help with disk_total_space function.. i have this on my code <?php $sql="select * from users order by id"; $result=mysql_query($sql); while($row=mysql_fetch_array($result)) { ?> Name : <?php echo $row['name']; ?> Email : <?php echo $row['email']; ?> Diskspace Available : <?php $dir = "C:/xa...

PHP-Json Problem

Hi there.. I have to similar Json files... I can json_decode read one of them... but I can't other one... I've uploaded files to http://www.huzursuz.com/json/json_test.rar if would you like to see, "brother_a.php" is working, "brother.php" is not... I don't think this is json_decode nested limit, because files are so similar... Tha...

What generally causes PHP to encounter a stack overflow?

I am on a windows IIS server serving some php sites. We have moved a working PHP site on to our server, however submitting one of the forms returns: PHP has encountered a Stack overflow When commenting out the MYSQL INSERT and assigning SESSION variables the form processes, however these are vital segments of the submission form. Any...

Database structure for saving search results

I currently work for a social networking website. My boss recently had the idea to show search results by random instead of normal results (registration date). The problem with that is simple and obvious: if you go from one page to another, it's going to show you different results each time as the list is randomized each time. I had t...

What is the max key size for an array in PHP?

I am generating associative arrays and the key value is a string concat of 1..n columns. Is there a max length for keys that will come back to bite me? If so, I'll probably stop and do it differently. ...

PHP: Attempting to connect to a memcache server, but getting "Permission Error (13)"

When I try to connect to my memcache server, I get "... Permission Error (13) ..." in my PHP error log. I can connect through telnet and even get a response, but can't connect through PHP. The script works when run from the command line, but when run through Apache it fails. Any ideas? ...

Twitter/PayPal Framework for PHP

Is there any framework that would allow me to integrate paypal with twitter, such as to send a tweet once payment for an item has been recieved. I'll be programming this with PHP. Thanks. ...

How do I convert a PDF document to a preview image in PHP?

Our environment is a LAMP stack. I'm wondering what libraries/extensions etc. would be required to convert a portion of a PDF document into an image file? Most PHP PDF libraries that I have found center around creating PDF documents, but is there a simple way to render a document to an image format suitable for displaying on a web page...

What is a loosely typed language?

Often I hear people refer to PHP as a loosely typed language. What is a loosely typed language and what are its pros and cons? ...

Can I create a thumbnail of a PDF file on the fly using PHP?

sample: I have a list of PDF documents and which to list them as thumbnails, can I create a thumbnail of those PDf files the same way I could create the thumbnail of a jpg? thank you! ...

Sorting an array of arrays by the child array's length?

What's the best way in PHP to sort an array of arrays based on array length? e.g. $parent[0] = array(0, 0, 0); $parent[2] = array("foo", "bar", "b", "a", "z"); $parent[1] = array(4, 2); $sorted = sort_by_length($parent) $sorted[0] = array(4, 2); $sorted[1] = array(0, 0, 0); $sorted[2] = array("foo", "bar", "b", "a", "z"); ...

CodeIgniter form validation - Get the result as "array" instead of "string"

I am writing my form validation class using CodeIgniter. Is there any way so that I can get error messages in name value pair? Say, in an example form there are four fields: ‘user_name’, ‘password’, ‘password_conf’, ‘timezone’. Among them ‘user_name’, ‘password’ validation has failed. So after executing: - $result = $this->form_valida...

Getting the MySQL table structure in PHP

What query do I need to run in PHP to get the structure of a given table in the database and what query do I need to run to get a list of all the tables in the database. ...

Is it possible to create static classes in PHP (like in C#)?

I want to create a static class in PHP and have it behave like it does in C#, so Constructor is automatically called on the first call to the class No instantiation required Something of this sort... static class Hello { private static $greeting = 'Hello'; private __construct() { $greeting .= ' There!'; } p...

Zend Auth and ACL

Hi there, I am hoping some can help me a little bit, I am currently developing my first site using a PHP framework, part of the site is spilt into a members area, this is where my confusion begins to surface, withing the members area I want normal members to be able to add new comments and edit there own comments, simple enough that I ...

Why won't my Gmail login work using PHP and CURL?

I'm implementing one project using PHP, in that I want to login into a page automatically . The code is below. $ch = curl_init(); $postdata="Email=$username&Passwd=$password&continue=https://www.mail.google.com"; curl_setopt ($ch, CURLOPT_URL,"https://www.google.com"); curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt ($ch,...

Missing symbol after compiling swig interface

Hi, Im trying to compile a php interface for my linux shared object and i have managed to get it to compile all right using the output from swig, however when i try and load the so it complains of a missing symbol: error: undefined symbol: zend_register_long_constant Now i have had a look at zend and it seems to be a php framework. I...