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
1
vote
4 answers

PHP 4- ignore parse errors?

I have a script that uses a PHP 5 syntax that's apparently not supported in PHP 4. like MyClass::method()->method(...) I'm trying to display a error at the beginning of the script telling that the server doesn't have PHP 5 installed, and "die"…
Jaaa
  • 13
  • 2
1
vote
1 answer

Both php4 and php5 running on one system

I'm having a problem with my customer's host. The host has configured the server in a way that php4 and php5 co-exist. If you want to use php4, you just have to use a .php extension for your files. If you want to use php5, you have to use a .php5…
1
vote
2 answers

Is there a way to get the last error in php4

PHP 5 has error_get_last. Is there any way to completely or at least partially replicate the same functionality in PHP4.3?
Sam
  • 14,642
  • 6
  • 27
  • 39
1
vote
3 answers

Convert big php project from register_globals to _GET["param"]

I have a rather big php site, which was written for php4 and register_globals enabled. It is old custom CMS. Now I want to run it on the php5 hosting without register_globals. Is it possible to change parameters parsing from $id to $_GET["id"]…
osgx
  • 90,338
  • 53
  • 357
  • 513
1
vote
1 answer

PHP 4 read and write XML

I have found several questions and answers pertaining to my question, but I'm getting a little confused. Perhaps clarification from someone would help. Sadly, I am working in PHP 4 - no chance of upgrading. :( (See comments below... I'm stuck…
Sara
  • 133
  • 5
  • 11
1
vote
6 answers

PHP: re-parse entire page before serving?

At the end of a page, if something occurs, it needs to be cleared, then the entire page needs to be re-parsed before serving to the client. I was going to echo out a javascript to refresh the page, but that will make them load the page and then…
JD Isaacks
  • 56,088
  • 93
  • 276
  • 422
1
vote
4 answers

singleton pattern in PHP 4

is it possible to create a singleton class in PHP 4? Right now I have something like http://pastebin.com/4AgZhgAA which doesn't even get parsed in PHP 4 What's the minimum PHP version required to use a singleton like that?
Alex
  • 66,732
  • 177
  • 439
  • 641
1
vote
2 answers

How to use Output('filename.pdf', \Mpdf\Output\Destination::INLINE); in mPDF v.6.1.4?

I have an issue when calling output function using v.6.1.4. Since i've ever tried to use Output('filename.pdf', \Mpdf\Output\Destination::INLINE); function in mPDF v.7.x so i tried this format function in mPDF v.6.1.4 (just changed "\Mpdf.." to…
1
vote
2 answers

I get a blank page until a session cookie is set - PHP 4.4.9

The first time I visit, I get a blank page - no text whotsoever if i click "view source", but a session cookie is added. The second, everything runs as it should. If I delete the cookie, I get a blank page again. Same in all browsers - Firefox 4, IE…
sabof
  • 8,062
  • 4
  • 28
  • 52
1
vote
0 answers

weird php error - cannot explain just in title

discovered this forum a few days ago and still not into it enough to contribute - will happen soon i hope :) right now i am experiencing something weird i hope someone can help me with. In the following php code: when i run it and enter a valid…
subtuppel
  • 11
  • 2
1
vote
1 answer

php4 file extension support in Plesk Onyx 17.8

I have a legacy web site that I would like to host on a Plesk Onyx 17.8 web server. The web site is running fine on PHP 5.3 FastCGI. The problem is that it is using the old fashioned ".php4" file extension. And since it is a legacy app I didn't…
kall2sollies
  • 1,429
  • 2
  • 17
  • 33
1
vote
1 answer

fgetcsv returning NULL in PHP 4

One of our systems is running on PHP 4 and no I can't change that. The fgetcsv function seems to return null no matter what file I upload. Very simply put: $handle = fopen($file,"r"); var_dump(fgetcsv($handle)); fclose($handle); This will print out…
CMR
  • 1,366
  • 4
  • 15
  • 31
1
vote
3 answers

PHP 4 - Undefined class name

In PHP 4, if you use a class before it's defined you get this error: Fatal error: Undefined class name 'foo' in... My code is: function do_stuff(){ if(foo::what()) ... // this code is before the php file with the foo class is included …
Alex
  • 66,732
  • 177
  • 439
  • 641
1
vote
2 answers

If Statement to overwrite an image

I've got a FORM Setup. The form has a current image and an option to add a new image (In place of that image) The form fields in question are :
StuBlackett
  • 3,789
  • 15
  • 68
  • 113
1
vote
2 answers

Calculate the date difference in the given format in PHP4

I need a function in php4 that will calculate the date difference in the provided date format. eg. $date1 = "2011-08-24 10:03:00"; $date2 = "2012-09-24 10:04:31"; $format1 = "Y W" ; //This format should return the difference in Year and…
sagar27
  • 3,121
  • 3
  • 27
  • 37