317 questions
1
vote
1
answer
30
views
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]) {
...
0
votes
1
answer
88
views
How can I make these loops faster?
I'm using PHP4 for a project I'm working on. I had to expand this code (which works fast enough for the data at hand):
for ($i = 1; $i <= count($arr); $i++) {
$a = $arr[$i]['date'];
for ($y = ...
0
votes
0
answers
29
views
Php\Ubuntu virtual links
I have latest Ubuntu 18, also Apache2, php 7.2, mysql.
I have rather old simple php application, written on php4 (at least not older than php5).
I have a task to run this application in this ...
-5
votes
1
answer
302
views
IF statement fails
I have created a simple a php script I do not understand what could be wrong with it. I believe it should echo "Died!" because the die function is executed right
if (die()){
echo "Died!";
}
...
0
votes
1
answer
181
views
Change all values in a column mysql php 4.4.9
I have seen multiple posts saying that to update all rows in a column you use
UPDATE Table
SET Column= 'New Value',
but it doesn't seem to work for me.
Here is my code:
<?php
$host_name = '';
$...
-1
votes
1
answer
42
views
Put a variable SESSION in an other variable, delete SESSION content variable
I've an application in PHP 4.3.9 and I've a problem with SESSION.
When I put a variable SESSION in an other variable, like this :
$tempInsInscription = $_SESSION['ins_inscription'];
$_SESSION['...
0
votes
1
answer
132
views
Configuring Oracle connection in PHP 4.4.8
Issue is regarding PHP 4.4.8, having trouble in configuring oracle connection (server is IIS8). I tried using php data objects(PDO) it didn't work. I also tried using extension php_oci8.dll
function ...
-1
votes
1
answer
31
views
Can you check the existence of a variable by if ($var) in PHP 4?
I'm upgrading an old code from PHP 4 to PHP 5 and what I often see is:
if (!$variable) {
// for example...
$variable = "test";
}
To understand the code I need to know if it was possible ...
-1
votes
2
answers
328
views
How do I upgrade my PHP 4.0 login script to PHP 5.6?
my script below worked perfect on PHP 4.0 but my ISP upgraded to PHP 5.6 and now there seems to be something wrong (it does not connect to mySQL, etc), any help is appreciated
Many thanks
<?php
$...
0
votes
2
answers
177
views
exporting a mysql query in php version 4 to a csv
Edit on my original post. I found the answer!!!! with help:)
I now have this working by using the below code with thanks for the advice on this in the comments:
<?php
$f = fopen('incident_csv\...
0
votes
1
answer
691
views
Post JSON Data to API with credentials PHP 4
I have an issue and I am in need of some help. I have PHP version 4.4.7 and I want to POST data in API which uses MVC pattern and json data. I tried with get_file_contents method but i get 405 Error.
...
1
vote
1
answer
224
views
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(...
8
votes
1
answer
5k
views
Difference between old-style and new-style PHP constructors
Could someone tell me how the "old-style" object constructor is different from the "new-style" constructor? I'm learning PHP OOP, and I want to know when I'm reading old syntax vs new syntax, and ...
1
vote
1
answer
91
views
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 ...
0
votes
0
answers
593
views
PHP 4 Send email through SMTP
I have a PHP 4 code that needs to be modified to send emails through SMTP and I have already installed the Pear mail package on the server. It is Sevrer 2008 R2 64 bit. The problem is that it does not ...
0
votes
1
answer
1k
views
Formatting date/time in php 4
I'm working (or learning) on server with old php4 installed and most of the conventional methods from php5 for date/time formatting doesn't work in php4.
I have time string in this format:
2003-07-...
0
votes
1
answer
490
views
php decode or parsing each nibble of hexadecimal
How can we decode a hex value in php?
I have hex value which encodes some data.
for ex: my hex value = 0x 1121 0031
here, each nibble of this hex value tells me something like first nibble 1 means ...
2
votes
3
answers
126
views
Parse error PHP4 array
I have the following code
$jsonReplaces = array("\\", "/", "\n", "\t", "\r", "\b", "\f", '"');
and I get the following error message running php4:
Parse error: syntax error, unexpected '/', ...
1
vote
1
answer
112
views
PHP Json output formatting
I am parsing Json using PHP. Here is a small part of my code
$rootObj = array(
'MainEvent' => $event_value['MainEvent'],
'OutcomeDateTime' => $formatteddate->format('Y-m-d H:i:s'), ...
0
votes
1
answer
348
views
PHP4 problems for Ajax, json_encode and database
I have my company project which they require PHP4 development.Please check the complete code. It should display list of mobile brands and price and should filter according to multiple checkbox. As i ...
1
vote
1
answer
204
views
Simulating old LAMP stack on local machine
I am currently working on legacy code, and I'm trying to find a way to recreate the server environment for this old site.
The site is written in PHP4, so I am having trouble working with it on my ...
0
votes
1
answer
3k
views
Could not be located in dynamic link library php4ts.dll
before it was working fine after installing dot net ..when i started wamp i am getting error as
The procedure entry point_object_and_properties_init could not be located in
dynamic link library ...
0
votes
1
answer
500
views
ajax style page reload with $_SERVER["PHP_SELF"] and a switch statement
I'm helping out a friend with her web page and I can't seem to make sense of the routing.
So this webpage was written years ago in php.
Essentially, there is stuff like this:
<li><a href="&...
1
vote
1
answer
362
views
PHP SQL Return just returns "Array"
I've tried using something similar to the following PHP code to retrieve items from a Firebird database.
$sql = "select P_1,P_2,P_3 from p_players('$playerid', '')";
//This sends the SQL select ...
1
vote
0
answers
311
views
openssl_sign and PHP 4 identical signature for different messages
I have to maintain an application in php 4 that must send signed data via openssl_sign. The issue is that for different data of the same size, the signature is always the same.
Eg. this code:
$...