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 declare public static class fields in PHP4

Do you have the solutions that public static class fields in PHP4 var static $field = null; Parse error: syntax error, unexpected T_STATIC, expecting T_VARIABLE
freddiefujiwara
  • 57,041
  • 28
  • 76
  • 106
1
vote
1 answer

How to refer to internal array in bson/json object?

I have bson/json data comming as an output like {"waitedMS":0,"result":[{"_id":{"$id":"58131c7799fbad4c1d000205"},"fullname":"Deborah Cheryl Fox","firstmiddle":"Deborah Cheryl","firstlast":"Deborah…
user2179026
1
vote
5 answers

Make quoted_printable_encode() work on PHP4

I'm trying to use the quoted_printable_encode() and [quoted_prinatble_decode(), but the problem is my server is running PHP4, and according to the PHP docs, quoted_printable_encode() is only available on PHP 5 >= 5.3.0. Does anyone know of a hack or…
user511292
  • 63
  • 7
1
vote
3 answers

Foreach on checkboxes does not return values

I made a script before, that worked completely fine in PHP 5.2. But when recently going over to my friends server (version PHP 4.4.9), I noticed some actions didn't work the way they should. The outcome of what the checkboxes returned came out…
Nisto
  • 13
  • 3
1
vote
0 answers

Upload products to amazon and retrive/import/export/ orders from amazon to own store

My company is using oscommerce 2.2ms and php 4. We want to upload our products to amazon shop. We have found magnalister and holbi connectors that we want to use but we cannot because we aere running php version 4. So, I decide to create my own…
Aryan
  • 25
  • 1
  • 5
1
vote
1 answer

Compiling PHP4.4 with MySQL 5 support

I'm trying to support a rickety old system until the new intranet is built. The previous programmer somehow got PHP4 and MySQL 5 to work together by doing option 1 and I need to do the same to make a dev environment so I can stop messing directly…
David
  • 75
  • 8
1
vote
1 answer

Why is session data lost using session_set_save_handler?

I'm doing a migration of a PHP4 application from an old version of CentOS to a newer version. I'm using session_set_save_handler and for some reason when the following callback is invoked, write(string $sessionId, string $data) the $sessionId is…
user2457870
  • 640
  • 1
  • 10
  • 14
1
vote
0 answers

Old PHP4 : method to recover variable from URL

I have to reinstall a really old intranet for a customer on a brand new machine with the latest version of Debian. Before I begin : It is really old code, I know it is depracated, but it is not question to change anything to the code. My customer is…
Math
  • 63
  • 1
  • 7
1
vote
4 answers

what is the different between this in php?

what is the difference between $totalprice += $product['price'] * $product['count']; and $totalprice = $product['price'] * $product['count']; both give the same result. so what's the use of (+=) ?
ktm
  • 6,025
  • 24
  • 69
  • 95
1
vote
2 answers

Using a class in PHP4 and i don't know how to set a method

in PHP 5 it would be class Example { private $foo = "old data"; public function __construct(){} public function setVar($data){ $this->foo = $data; } public function output(){ return $this->foo; } } $var = new…
1
vote
2 answers

ftping only todays files only

I am new to php. have a task to ftp only todays files from the server containing files for over a week. how do i select or filter the files based on date and ftp to my local folder. Help is much appreciated !! Soloman
salvadore
  • 11
  • 1
1
vote
1 answer

PHP copy() giving me a warning

I'm trying to copy files from an FTP remote server to another FTP remote server and I'm getting a warning: Warning: copy(): The first argument to copy() function cannot be a directory in I've double checked my folder names and file path and all is…
Mike
  • 1,760
  • 5
  • 21
  • 40
1
vote
1 answer

how to restrict a page to only a specified ip range in php

im looking for a way to restrict my administration page to only my own ip range concider my ip range is 215.67.. so in php i will begin with this : $myip = "215.67.*.*"; $myip = explode(".", $my_ip); $userip = getenv("REMOTE_ADDR") ; $userip =…
Mac Taylor
  • 5,020
  • 14
  • 50
  • 73
1
vote
0 answers

using a context-stream resource with file_get_contents returns a NULL string

I'm using PHP 4.3.9 and am trying to POST to a url without a form using stream_context_create like below: function do_post_request($url, $postdata) { $content = ""; foreach($postdata as $key => $value) $content .= "$key=$value&"; …
jlern
  • 11
  • 2
1
vote
2 answers

PHP4 including file during session

I am trying to put second language on my webpage. I decided to use different files for different languages told apart by path - language/pl/projects.ln contains Polish text, language/en/projects.ln - English. Those extensions are just to tell…
KotuS
  • 41
  • 5