php4

Tools to highlight deprecated functions in PHP4 sources?

Is there any magic tools i can use to scan source code that was written for PHP4 to highlight deprecated functions in PHP5? I'm currently running the latest version of PHP on a server and need to port this code. Is there anything out there that can give me a hand? ...

php session and path setting

I would like to separate my source folders into two: The folders that contain the code that you type into the address bar and those that make up parts of the page (tiles) and other code (classes, etc). So at the start of every php file I added: <?php // index.php include("config.php"); include("session.php"); ?> Config contains just t...

SVG to JPEG via PHP4

I am currently struggling with a side project I hope you can help me with. I am trying to convert SVG images to JPEG with PHP4. Originally I tried to interface java with php via the php_java.dll and jar that comes with PHP 4.2.2 but while I never got any warnings I never managed to get even the simplest test working. All text regarding...

maked / hashed url param

I have created a quiz app which emails the user the results. I want to include a link in the url that the user can click on and view a breakdown of their results I want the url to look something like this: http://www.mysite.com/quiz/view/32k4k2u4vxcv88xcv8cv0x98c9v7c7v8887cv obviously a can't just hash the id cos that is easy to revers...

SimpleXMLElement PHP4

I know SimpleXMLElement doesn't work in PHP4, but is there a something similar I can replace it with to make the script work with PHP 4? ...

__construct() { issue for PHP4 and PHP5. maybe an another reason...

Hi friends, I have weird issue with CodeIgniter, here is a start part of my controller class Home extends Controller { /** * Constructor */ public function __construct() { parent::Controller(); } ... everything is working fine at localhost, but when I try same at server, I come cross with an error like b...

php 4 to 5 porting question on how to reset a class

Someone wrote the following php4 code which I now am trying to port to php5: the class is Foo (name changed to protect the guilty). In one of the methods, we'll call it save() the class apparently is reset like this: $this = new Foo($this->Foo_Id); That results in the following error: ( ! ) Fatal error: Cannot re-assign $this in ......

how to resize bmp,tiff image using gd library ? and also mention about imagemagic which is good to use

i need to know which is better gd or imagemagic to resize an image ...

Deprecated warning only in some php5 environments?

Hello, We're moving from php4 to php5, and we get this warning on one of our developers machines, but not in our php5 test setup: Deprecated: Call-time pass-by-reference has been deprecated in C:\Workspace\Prelive\www\includes\filename etc.. The code seems to be the same in both environments, and the php.ini on the test environment ha...

PHP object class variable

I have built a class in PHP and I must declare a class variable as an object. Everytime I want to declare an empty object I use: $var=new stdClass; But if I use it to declare a class variable as class foo { var $bar=new stdClass; } a parse error occurs. Is there a way to do this or must I declare the class variable as an object...

Regex for html attributes in php

Hi, i'm trying to parse a string of html tag attributes in php. There can be 3 cases: attribute="value" //inside the quotes there can be everything also other escaped quotes attribute //without the value attribute=value //without quotes so there are only alphanumeric characters can someone help me to find a regex that can...

PHP: Pass a variable to a file you are including?

I am wondering if there is a way to pass a variable to a file you are including via include()? I tried this but got an error: include("header_alt.php?img=hey"); Is there a way to do that? Thanks! ...

How should I store a date in PHP for use with javascript?

What I want to do is make a script on the server read a text file, sort it, then output it to a javascript object (probably via JSON). The text file in question looks something like this: 13/09/2009,17/09/2009,Arbitrary dates 14/09/2009,18/09/2009,Some random comment 14/09/2010,18/12/2010,A comment to the dates 14/09/2010,18/09/2010,A ...

PHP4 - "Fatal error: Cannot redeclare function()"

Second time I've ran into this... I have function foo() that has a helper function inside called formatStr() which is used in an array_map() call. When I call foo() more than once within a script I get a "Fatal error: Cannot redelcare formatStr()". Which leads me to believe formatStr() is not declared locally in the function but globa...

can't get Nusoap server working with cakephp

I am trying to get nusoap server working with cakephp, the problem I am assuming is that the code is within a class (controller) and nusoap is trying to execute 'function()' instead of '$this->function()'. Does anybody know of a simple workaround for this, i don't like modifying 3rd party classes... ...

PHP: Breaking out of PHP for HTML but return as value instead of print on page?

I am generating a lot of HTML code via PHP, but I need to store it in a variable, not display it immediately. But I want to be able to break out of PHP so my code isnt a giant string. for example (but actual code will be much larger): <?php $content = '<div> <span>text</span> <a href="#">link</a> </div>'; ?> I want to do som...

PHP: Turn HTML table into spread sheet?

I am generating an HTML table full of data. They need it to be an editable spreadsheet though that they can save and edit. I currently have it exactly as they want but as an HTML table, is there anyway I can convert this to an excel spread sheet that they can download? Thanks!! ...

PHP: How to embed image in an excel column generated from PHP?

I am echoing TSV data and turning it into an excel file via header() This works fine, but 1 of the columns needs to be an image. How can I embed the image as one of the columns? Thanks! ...

Convert Ruby Code To PHP Help Please

Ruby Code: # Turn hash input into JSON, store it in variable called "my_input" my_input = { "itemFilter" => { "keywords" => "milk" }}.to_json # Open connection to website.com @http = Net::HTTP.new("website.com") # Post the request to our API, with the "findItems" name and our JSON from above as the value response_code, data = @ht...

compiling php4 headers instead of php5

Hi, I'm compiling certain extensions for PHP on dreamhost PS server. I got an error and found that it happens when php4 headers are used instead of php5 headers. running phpinfo shows the server runs php5. however php-v on the command line gives php4. How can I make the compilation use php5 instead of php4 on my server? Is there an env...