Questions tagged [php4]

For issues relating to development using PHP, version 4.

PHP is a widely-used, general-purpose scripting language designed specifically for web development, though it has since been extended to other applications too. PHP is the most popular language for web development, powering over 20 million websites.

Useful Third-party Code and Tools

In addition to the vast functionality provided in the PHP Core and through PEAR and PECL, there are a number of noteworthy 3rd party contributions to the PHP world, some of which are listed below.

Related tags

323 questions
2
votes
3 answers

Migrating php4/mysql4 to php5/mysql5: expected php issues?

I have a legacy web application php4/mysql4 (MyISAM, db contains some cms, some user data, some calendar application). Now I am going to migrate to a new server with php5/mysql5. What are the typical php issues in such a migration scenary (php, sql…
user89021
  • 14,784
  • 16
  • 53
  • 65
2
votes
1 answer

Class Object in PHP session reset during AJAX operation?

I have a simple example of PHP sessions and AJAX, which works when holding an array in session: Request file:
shanethehat
  • 15,460
  • 11
  • 57
  • 87
2
votes
1 answer

PHP4 parameter by reference?

I'm quite used to PHP5 but have to write a PHP4 sync script, now I'm doing some digging to find the differences between PHP5 and 4. Problem is that I get alot of contradiction, some sites tell me that PHP4 has no byref whatever and others tell me…
Rob
  • 2,466
  • 3
  • 22
  • 40
2
votes
3 answers

Store Objects in Array difference in PHP 4 and 5

I had similar problem in the post here: Storing objects in an array with php The test code is attached below. The interesting thing is when I run the same code in PHP 4.3.9, and it outputs: Array ( [0] => timitem Object ( …
Xin Chen
  • 283
  • 5
  • 14
2
votes
1 answer

Code not working in PHP 4

I have a PHP script which works fine in PHP 5, but not in PHP 4. I've made a small test case for you to demonstrate (disclaimer: I know that the below code could be written much better, but it's not an actually used piece, rather the one to…
Fluffy
  • 27,504
  • 41
  • 151
  • 234
2
votes
2 answers

anonymous functions (lambdas, closures) in PHP 4

Is there a trick in PHP 4 to implement functions which return functions? I expected that the following code would work: function xxx($a) { return function($b) { print "a=$a, b=$b \n"; } } $f1 = xxx(1); $f1(2); Unfortunately, no luck in PHP…
olpa
  • 1,167
  • 10
  • 28
2
votes
1 answer

Copying file uploaded vai PHP's HTTP Get in PHP 4

I have been working on adding functionality to a site originally written in PHP 4.4.9. It's not in their budget to port the site to PHP5, so don't even suggest it. (Although it needs it badly). The problem I am facing is how to copy binary data from…
user131441
2
votes
1 answer

PHP: How to make "Latest visit" count nicer

I have "Your latest 5 visits" at the home page of the user when he logs on. It works great without any problem. But then i want to change it. I dont know how i should do this, but someway somehow only count the user 1 time at the time, and not e.g…
Karem
  • 17,615
  • 72
  • 178
  • 278
2
votes
1 answer

Failed to validate oauth signature and token

For reasons beyond my control I am using PHP4 to write a twitter client. Requests don't work properly - I am having a tough time seeing what's wrong. Any ideas? I have grabbed the code and banged it in a very simple script here to illustrate…
oauthor
  • 61
  • 1
  • 5
2
votes
1 answer

Find when Internal (built-in) Functions and Predefined Constants were introduced (version number) in PHP

I was working on a couple of backwards compatibility issues and have been using the PHP manual for reference. Ive been using the version information located at the top of the page. Example, is_null version information is (PHP 4 >= 4.0.4, PHP 5,…
TarranJones
  • 4,084
  • 2
  • 38
  • 55
2
votes
3 answers

PHP - Question about uploading & uploaded image file

I have read the following tutorial "Uploading Files To the Server Using PHP" and have several questions related to the topics. Q1> The tutorial mentions that "Note that PHP must have write access to $uploadDir or else the upload will …
a2011
  • 257
  • 1
  • 7
  • 13
2
votes
3 answers

How to round a decimal number to nearest 5 or nearest 10 in php

How to round a decimal number to nearest 5 or nearest 10 in php
Sohail Anwar
  • 304
  • 1
  • 5
  • 16
2
votes
2 answers

PHP4 for Apache 2.2.9 in Ubuntu server 8.10

I recently moved from a windows based development environment to an ubuntu one. I need to have both PHP4 and PHP5 available (PHP4 is a company requirement, so not much I can decide about it). My problem is that I can't install PHP4, as it's not…
Erico Lendzian
  • 333
  • 1
  • 3
  • 9
2
votes
4 answers

Intern working for Indian NGO - Help with PHP 4, advising staff

For the past three months I've been working for an Indian NGO, doing some volunteer work in the field but also trying to improve their website, which needs a ton of work. Recently I've been trying to fix the "subscribe to newsletter" button, which…
Kevin Burke
  • 61,194
  • 76
  • 188
  • 305
2
votes
3 answers

Parse error PHP4 array

I have the following code $jsonReplaces = array("\\", "/", "\n", "\t", "\r", "\b", "\f", '"'); and I get the following error message running php4: Parse error: syntax error, unexpected '/', expecting ')' And running php5 is not an option. Any…
Nitrodbz
  • 1,276
  • 1
  • 15
  • 25