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
1 answer

How to use get_cfg_var() in a cakePHP app ?

I have a cakePHP app with my DB servers configured in the app/config/ database.php file. However, I need to use the get_cfg_var ('mysql.default_host') to get the host name because the client does not want the name hardcoded.
Ashu
  • 11
  • 1
1
vote
1 answer

PHP4 and static methods / callback functions

The static keyword was introduced in PHP5, which kinda makes one come to the conclusion that PHP4 didn't support static methods or variables. And yet when I run the following code on PHP 4.4.9 it works without the constructor ever being…
neubert
  • 15,947
  • 24
  • 120
  • 212
1
vote
0 answers

How to wrap C++ code in PHP4?

I found a very good example of how to wrap C++ code for using in PHP code. This is for PHP5 and it works for me. How do I need to modify this example to use PHP4 (4.4.9-pl0-gentoo) instead? So that the example works calling php4 instead php (with…
Alex
  • 41,580
  • 88
  • 260
  • 469
1
vote
1 answer

How can I define an array inside a PHP class scope in PHP4

I need to define a constant array within the scope of an class, which is to be used statically (i.e. I am not creating an instance of the class). Here is the sample code which works in PHP5, but not in PHP4: class MyTest { static $arr =…
Alex
  • 41,580
  • 88
  • 260
  • 469
1
vote
1 answer

PHP support for Mssql on windows server

My client wants to upgrade this website from php4 to latest version. But first I have to check website on php4 with a SQL databse. I googled for it but not getting exact information for below - Does php4 supports SQL database properly? Is it good…
Hello Python
  • 110
  • 2
  • 13
1
vote
2 answers

Sorting XML data in PHP4

Hi there I have the following XML code: AAA 243168 090828-000300 …
user214392
1
vote
3 answers

Why does file_put_contents not append data to a file?

I have a complex php4 code and want to write something to a file, using file_put_contents, like the following: $iCounter = 0; foreach blah... ... code file_put_contents("/tmp/debug28364363264936214", "test" . $iCounter++ . "\n",…
Alex
  • 41,580
  • 88
  • 260
  • 469
1
vote
3 answers

Best practices / info: Writing a PHP4 ORM

For a number of reasons (all of which can, basically, be broken down to bad management decisions) we're unable to switch to PHP5, meaning we'll have to support PHP4 for probably a few more years. Since a lot of our applications (as with a lot of web…
Duroth
  • 6,315
  • 2
  • 19
  • 23
1
vote
2 answers

Path error with PHP include();

While I am developing my site I have it hosted on my current site in a folder. I'm not very good with levels, but this is how I set it up. In the top of my body I have: I have my page.php in /learn/ and the…
1
vote
4 answers

PHP, MySQL: Duplicate series of rows, but change 1 column?

I have a table called scheduler_sched which has several columns, including a column called schedule_id. I need a function where I can pass 2 ids (copy_from_id, copy_to_id) as parameters. And what I need to do is take every row where schedule_id =…
JD Isaacks
  • 56,088
  • 93
  • 276
  • 422
1
vote
2 answers

How to pass an additional variable into a cmp function for use with usort in php

I need to order an array using usort based on a string of text that comes from a mysql call using php4. So far I have the mysql call to get the order: $result=mysql_query("SELECT rank from order WHERE id=1"); $row = mysql_fetch_row($result); this…
pg.
  • 2,503
  • 4
  • 42
  • 67
1
vote
2 answers

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!
JD Isaacks
  • 56,088
  • 93
  • 276
  • 422
1
vote
6 answers

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…
JD Isaacks
  • 56,088
  • 93
  • 276
  • 422
1
vote
1 answer

PHP version update from 4.4 to 5.3.6 broke site

Somehow when moving a site to a newer server, the php code broke. We did have it tested with a temporary site first, but it still broke. All of the dynamic links for listings no longer work. I have a next button that does nothing except change the…
Jamie
  • 1,579
  • 8
  • 34
  • 74
1
vote
1 answer

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()".…
frio80
  • 1,293
  • 3
  • 14
  • 23