php

Get Instance ID of an Object in PHP

I've learn a while ago on StackOverflow that we can get the "instance ID" of any resource, for instance: var_dump(intval(curl_init())); // int(2) var_dump(intval(finfo_open())); // int(3) var_dump(intval(curl_init())); // int(4) var_dump(intval(finfo_open())); // int(5) var_dump(intval(curl_init())); // int(6) I need something simi...

Displaying an image from the tmp directory

I have the following. A website that create temporarily images in the /tmp folder on the Linux server. The reason why I store it within this folder is since these images need to be cleared once in a while and it's so much easier just to clear the tmp directory using tmpwatch. Now my issue is to display the image within my browser? Code ...

PHP help with error

Hi, I am working on a Zend project and it has been well over 12 months since I touched Zend, I am getting an error on one of my functions, and I cannot work out why, I think it may be down to the site being originally built in an earlier version of PHP (5.2) and I am now running 5.3. The function looks like this, public function add...

Server is the wrong time

So I am from the UK and have hosting in the US. I contacted my host and said that my server time is set 6 hours behind GMT. They said I need to alter this in my CMS. How would i go about doing this? Whenever i put now() i am getting the wrong time. Never seen this before, could anyone offer any suggestions? ...

Is it possible to pass an array as a command line argument to a PHP script?

I'm maintaining a PHP library that is responsible for fetching and storing incoming data (POST, GET, command line arguments, etc). I've just fixed a bug that would not allow it to fetch array variables from POST and GET and I'm wondering whether this is also applicable to the part that deals with the command line. Can you pass an array...

what's the best technology for creating a web site which manages users accounts?

I'm going to create a web site which should manage users accounts. A user opens an account and gets relevant data for his needs. What technology should I be using to create this site? Are there any templates I could use? I don't have the time to take care of the web site's desgin, Are there any places where I can buy some graphics? Th...

Update post via Typepad API

Hello, I'm trying to update post in my TypePad blog using PHP and cURL, but I can't get it to work. Code follows $ch = curl_init($post['url']); $wsse = new WSSE($credentials['login'], $credentials['password']); $wsseHeader = $wsse->get_header(); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); curl_setopt($ch, CURLOPT_POSTFIELDS, $post[...

Smart URI handling for a CMS engine?

I am writing a CMS engine that improves upon the blog engine on my website. So far, the existing blog only has one smart URI handler - one that converts /123 into /blog.php?p=123 and that's currently done by a few mod_rewrite statments. I am afraid that this method is unwieldy and kludgy for when I have more "smart URIs" in my CMS. At t...

php,unix command ,imagick ,overflow

This is Add text to image echo system('convert mug.jpg -font courier -fill green -pointsize 30 -annotate +100+230 \'hi Wlecome yy\' mug123.jpg'); unix command run in php it is working fine when we change the point size hi welcome is over flow the image how can we over come? ...

Need one login for two or more different sites in joomla

I am tasked to create a web site using joomla. It will be a 'sister' site to an existing joomla site. Both are in the same domain. However, the owners want the users to be able to log into one and still be logged into the other one. How can this be accomplished? If it is possible Thanks in advance! :) ...

How to add a toolbar (like google translate) to a webpage opened through a link for saving/processing using html/javascript and php?

Hello, lets say I have bunch of hyperlinks. When link is clicked, I'd like an opened page (in a separate window) to have a google-translator style toolbox that I could use to save the page to a localdisk if I liked it, adding a few tags to the database using php. I understand how to save a file using php, but could You help me with ideas...

Activetopics - Get max 5 topics per category

Hey, I want to get the 5 latest active topics within several category's. Each topic has a subcatid and this subcatid relates to a catid. What I want is to get the 5 active topics within each catid. I'm trying to use the query below, but this isn't working at all: set @num := 0, @catid := 0; SELECT ...

PHP Retrieving what has already been sent.

Ok I know I can do this via javascript but was wondering if I have say this <HTML><HEAD><TITLE>Specifics of Bronica SQAi 150/4 PS </TITLE> <? include('producttopads.html'); and html processes php can I get the title... Any ideas. Thanks Richard ...

Super strange PHP error

Hi everyone, When trying memcache:get, I'll get the following error message back: Message: Memcache::get() [memcache.get]: Server localhost (tcp 11211) failed with: Failed reading line from stream (0) I run a Windows 32bit test environment (XP) and here's how my code looks: function getMulti(array $keys) { $items = $this->mem...

Is it possible to integrate user databases between Drupal and an ASP&SQL Server platform?

We have a game project designed on ASP&SQL Server, and we need to integrate it's user database with Drupal. This would be easier from Project to Drupal (since there is user_save and user_delete functions available globally by using drupal bootstrap) but I'm not sure if we can execute PHP functions on an ASP platform. Is there any docum...

How can I create multiple different blocks in one module in Drupal 6?

I'm using hook_block to create a block with the name of the custom module I'm creating. I'm not being able to create a block without using myModuleName_block. Do I need to do different modules for every different block I want to create? ...

Zend Framework: How to subtract amount from database table field ?

I want to subtract a amount from a table's field in Zend Framework. I can run it with SQL using following query: UPDATE `Person` SET credit=credit-50 where id=1 But how to write above SQL query in Zend Framework? ...

How much data can be sent via $_GET

How much data can be sent via $_GET in PHP5? Is there a maximum number of variables, string length etc? Thanks in advance. ...

How do you define paths in application?

I'm using global constants, like this: /project /application bootstrap.php /public index.php index.php defines PUBLIC_PATH and APPLICATION_PATH calls APPLICATION_PATH . bootstrap.php bootstrap.php defines LIBRARY_PATH, MODULES_PATH, TEMP_PATH, CONFIG_PATH, ... does real work Also i want to ask if there ...

how to run imagemagik commands in PHP ?

Hi, i am trying to bend text using imagemagik in PHP. but the commands shown in the website are not working. http://www.fmwconcepts.com/imagemagick/texteffect/index.php how can i run these scripts in PHP ? somebody please help me.. NB :-t \'SOME ARCHBOTTOM TEXT\' -s outline -e arch-bottom -d 1.0 -f Arial -p 48 -c skyblue -b white -o ...