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
3
votes
3 answers

Difference between php 4 and php 5?

I'm in search of the web hosting space, and got to know the PHP version is 4.3 and MySQL Version 4.1 But i developed my application in MySQL version 5.x and PHP version 5.x Can anyone give me the differences in versions ? what all i cannot access…
Satish Ravipati
  • 1,431
  • 7
  • 25
  • 40
3
votes
2 answers

PHP 4 - variables inside class

I have a class like class blah extends blahblah{ private $variable = '5'; function somefunction(){ echo $variable; } } this works in php 5, but not in php 4. I get a error: Parse error: parse error, unexpected T_VARIABLE, expecting…
Alex
  • 66,732
  • 177
  • 439
  • 641
3
votes
1 answer

Parse and Stringify JSON in PHP 4

Possible Duplicate: php4 with json data Is there a library or class that provides parsing (JSON to PHP primitives/arrays) and stringifying (PHP primitives/arrays to JSON) for PHP 4?
Jeff Meatball Yang
  • 37,839
  • 27
  • 91
  • 125
3
votes
3 answers

PHP: Inject iframe right after body tag

I would like to place an iframe right below the start of the body tag. This has some issues since the body tag can have various attributes and odd whitespace. My guess is this will will require regular expressions to do correctly. EDIT: This…
mikeytown2
  • 1,744
  • 24
  • 37
3
votes
2 answers

How to check if a PHP object has a property in PHP4.

I would like to check if a PHP object has a property. For PHP5 I could use if (property_exists($object, "foo")) {...} but how can I do the same in PHP4?
Alex
  • 41,580
  • 88
  • 260
  • 469
3
votes
3 answers

PHP: get next 13 dates from date?

I am trying to get an array of a date plus the next 13 dates to get a 14 day schedule starting from a given date. here is my function: $time = strtotime($s_row['schedule_start_date']); // 20091030 $day = 60*60*24; for($i = 0; $i<14; $i++) { …
JD Isaacks
  • 56,088
  • 93
  • 276
  • 422
3
votes
3 answers

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…
mck89
  • 18,918
  • 16
  • 89
  • 106
3
votes
0 answers

Xdebug prevents PHP to process the page

I have a weird problem with XDebug. First the project setup (it's completely deprecated, but it's a customer project and I can't change a thing): PHP 4.4.9 XDebug 2.0.2 (last stable version for PHP 4.4) Netbeans 7.0 Easy Debug I configured…
trollr
  • 1,095
  • 12
  • 27
2
votes
2 answers

Redeclare function works on old server but not new

I'm migrating a PHP 5.2.x application to a new 5.2.x server. The old server actually started as a PHP 4.0 server many years ago and was upgrade to PHP 5.2 over time. One of our modules has a function that gets redeclared if this module is used more…
Kristopher Ives
  • 5,838
  • 7
  • 42
  • 67
2
votes
2 answers

PHP: how to create and ftp a file to another server?

We are setting up a drop-ship agreement with a vendor to where we don't have to stock their products we just sell them and they ship them out. To inform them of an order they want us to FTP upload a tab delimited .txt file with the order info to…
JD Isaacks
  • 56,088
  • 93
  • 276
  • 422
2
votes
4 answers

PHP: how to load file from different server as string?

I am trying to load an XML file from a different domain name as a string. All I want is an array of the text within the < title >< /title > tags of the xml file, so I am thinking since I am using php4 the easiest way would be to do a regex on it to…
JD Isaacks
  • 56,088
  • 93
  • 276
  • 422
2
votes
2 answers

How to prevent SQL injection of $_POST e-mail field using PHP 4

This would be a bit easier if I was able to use PHP 5 unfortunately this is not a viable option? I am already using RFC 2822 from this stackoverflow thread to validate the e-mail format is valid, granted this is using JS on the form page which is…
Eric
  • 565
  • 1
  • 8
  • 25
2
votes
4 answers

Codeigniter Call to a member function set_userdata() on a non-object

I am getting a fatal error in a CI app that I just moved from a php4 shared host to a php5 shared host. Fatal error: Call to a member function set_userdata() on a non-object in…
TJ Sherrill
  • 2,465
  • 7
  • 50
  • 88
2
votes
4 answers

Single function to remove all kinds of whitespaces

I need a php function to remove all the whitespaces in a string. I tried str_replace(" ","",$str); Then I tried rtrim(); But even then I can't remove the spaces that are formed by the   I tried str_replace(" ","",$str);, but its not working. Then I…
Geo Paul
  • 1,777
  • 6
  • 25
  • 50
2
votes
2 answers

Is there a way to emulate PHP5's __call() magic method in PHP4?

PHP5 has a "magic method" __call()that can be defined on any class that is invoked when an undefined method is called -- it is roughly equivalent to Ruby's method_missing or Perl's AUTOLOAD. Is it possible to do something like this in older versions…
jes5199
  • 18,324
  • 12
  • 36
  • 40
1 2
3
21 22