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

MySQL: How many minutes ago was DB updated?

I need to keep a field in a data-base and update it with a time somehow, then later I need to check that time to see if it was over 30 minutes ago or not, and if not, how minutes left until 30? I am going to be doing this with PHP+MySql can anyone…
JD Isaacks
  • 56,088
  • 93
  • 276
  • 422
2
votes
2 answers

Strange behaviour migrating sessions with callbacks from php4 to php5

I have to migrate a php4 app that uses session_set_save_handler() to php5. In php4 everything was fine, but in php5 the callback functions cannot access the global vars anymore, which were set on the page before session_set_save_handler() was…
user89021
  • 14,784
  • 16
  • 53
  • 65
2
votes
3 answers

How backwards compatible is php 5 with php 4?

I work on a code base written in php 4. I'd like to go through the process of upgrading the code to php 5 (the latest version my host provides). I'm wondering if anyone else has gone through a similar upgrade experience and can share what…
Doug T.
  • 64,223
  • 27
  • 138
  • 202
2
votes
1 answer

Why PHP APC cache miss in increasing all the time

I am using apc.php to check the PHP APC's stats (http://svn.php.net/viewvc/pecl/apc/trunk/apc.php) I have the following stats on a fairly busy server Cached Files 317 ( 26.3 MBytes) Hits 51483 Misses 6814 The problem is the Misses is always…
Ryan
  • 10,041
  • 27
  • 91
  • 156
1
vote
0 answers

PHP4: Adjust date() and strtotime() for different timezones

I'm working on a podcast (on-the-road events) that contains future dates and different time zones. Wed, 14 Nov 2012 19:00:00 EST Wed, 25 Jul 2012 19:00:00 CDT Thu, 29 Mar 2012 19:00:00…
doubleJ
  • 1,190
  • 1
  • 16
  • 29
1
vote
2 answers

Unable to parse ISO 8601 dates in PHP 4 using strtotime

I'm trying to parse the following ISO 8601 date in PHP 4 using the strtotime function: 2012-02-01T00:00:00.000Z However this returns -1. How come and what can I do to work around this? Unfortunately I'm stuck using PHP 4.3.10 and so can't use any…
Justin
  • 84,773
  • 49
  • 224
  • 367
1
vote
4 answers

loop though a multi level array with an unknown amount of levels

I have a categories table that looks like this: ---------------------------------------- | id | parentId | Name | ---------------------------------------- 1 0 Cat 1 2 0 Cat 2 3 0 …
azzy81
  • 2,261
  • 2
  • 26
  • 37
1
vote
2 answers

PHP: keep track of requests by user and by product brand?

I have a MySQL table that has price requests in it, it has date, first, last, and product_id fields. The product brand can be found from the product table from the product_id. Given a date range, they want to know the total number of requests, by…
JD Isaacks
  • 56,088
  • 93
  • 276
  • 422
1
vote
2 answers

Escaping quotes - moving from PHP4 to PHP5

I've inherited a php4 site that needs to run on my PHP5 Server, I've solved most of the issues but can't figure out what the author was trying to do here. Well, to be precise, he was tring to quote the submitted text but I'm not sure how this…
deep64blue
  • 33
  • 3
1
vote
6 answers

PHP: Tell if a file exists?

I need to be able to tell if an image exists in a directory or not. Given the file name and the directory, how can I tell if it exists? Thanks!
JD Isaacks
  • 56,088
  • 93
  • 276
  • 422
1
vote
4 answers

Method name clashing with language construct

I simply want to name a method in my class list(). If I try and do so: class MyClass { function list () { // Do some stuff here } } ...I get a parse error (Unexpected T_STRING...). The same is true if I use echo or print - so I am…
DaveRandom
  • 87,921
  • 11
  • 154
  • 174
1
vote
2 answers

Is there a way to do parameterized queries in PHP 4 when using a MSSQL database?

I am doing some maintenance work on an older system that is running PHP 4 and talks to a MS SQL2000 database via FreeTDS. I know, it already sounds somewhat scary! A lot of the code used unsafe string-concatenation for generating SQL queries. I…
Wally Lawless
  • 7,539
  • 7
  • 37
  • 53
1
vote
1 answer

How do I get the request body?

I am trying to implement a simple JSON-RPC server. The client part is handled by the jquery.jsonrpc. This seems to work fine, sending a JSON-RPC message as the payload of a post message. My JSON-RPC 'server' currently just wants to echo the data so…
graham.reeds
  • 16,230
  • 17
  • 74
  • 137
1
vote
1 answer

array_splice behavior in PHP 4.x

I'm in the process of migrating an old piece of code to PHP 8.1 from (hold on to your hat...) PHP 4.2! However I did make significate progress. I ran in to the following statement if ($arr[$key]) { array_splice($arr[$key]); } var_dump…
phper
  • 307
  • 2
  • 12
1
vote
3 answers

Php unexpected T_String on php4 webhost but not on php5 localhost

I am getting a really frustrating problem with my php script below. Everything works as expected on my local machine using XAMPP, but when I put it on the web I get: Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or…
Zach Lysobey
  • 14,959
  • 20
  • 95
  • 149