This topic is locked

Messages not displaying on different servers

1/22/2010 6:50:48 PM
PHPRunner General questions
D
Dale author

I noticed as I was building and testing, that on certain servers, when I save a record for example, The message would NOT display as it should.

On my local development box, if I click save on a record, the record returned with a message RECORD UPDATED. Everything works fine, on all browsers on my box.
I uploaded to the server, and no browsers would display the message. The savc was made properly, just NO message back.
THe only difference from my local box to the server in question would be the versions of php and mysql. My local box has later versions of both products.
So the question is, Using 5.1 2503 is there some php function to create the message and display it that is not backword compatible with an older version of php or mysql.

I believe the server is running mysql 4.1 something and php is 4.03 I think. Im hoping I can solve this without having to move to a new server. Upgrading is out of the question.
Any tips or words of wisdom.

Sergey Kornilov admin 1/25/2010

Hard to tell what exactly causes this trouble but PHP v4.0.3 sounds really old (released in 2000). I would upgrade it first.

D
Dale author 1/29/2010

I hate to bring this one back up but it is driving me crazy.

I have a bit more info about the issue.
On my live server, clicking Save when editing a record, does NOT return the <<< Record Updated >>> message back to the displayed form.

It saves just fine and everything is good. Just no message.
So I put an alert box in the *_edit.php to display $_SESSION["message"] and when I hit the save button, IT RETURNS in the popup "Record Updated" message. Close the popup and no message on the page. So I know the server is returning what it should to phprunner. The okay result is coming back to phprunner, somewhere its just loosing it.
Now here is the kicker. I opened an Edit page, changed the data so I should get a failure in the Save. Duplicated data.

AND POOF, the message, Record was not updated blah blah blah with the duplicate error information.

Also the alert popup I added shows the error message, close the popup and error message shows on the edit.
Why does that work, and not just the regular save of good data.
Like I say its driving me crazy. I know the server is running the older php and mysql, but I cannot update it, and why DOES it work for the other messages.
I have older PhpRunner 3.0 applications running on this same server and it all works fine. Messages show no issue.
Im hoping this extra information will help with debugging this.

There has to be a reason, why, Error messages when saving and adding show, but not when there is no error and the add and save are good.

I know it must be a backward compatible thing, but I do not have the option to upgrade the server. Its got to be some comma or slash somewhere, or maybe a newer function, ANY workaround will do. Please.

Sergey Kornilov admin 1/29/2010

Things like are impossible to catch unless you have access to this server and can actually step through the code to see what the problem is. My guess is that one of functions PHPRunner uses doesn't work with this version of PHP or, even worse, works different way.

D
Dale author 2/1/2010

For your info Sergey.
I solved the issue with something that makes absolutely no sense to me. But with one line of code, it all works perfectly, on all servers.

I'm sharing the change in code, Please please explain to me while doing just this makes it all good. Great lead in, eh.
I spent hours trying to get this to work. And I found after lots and lots of troubleshooting, found that if I added just a echo command before the closing of the function, everything worked. Im not even echoing a value as you can see. But with that line, it works, without it, it would not display the edit updated or record added message on my older server.

And perhaps I could code something better and still get the same effect. But It works. Done.
Anyway, modifying the add.php and the edit.php in source.

For example in the edit.php

I found the function below and added ONLY the bolded line.

if(function_exists("BeforeEdit"))

$retval=BeforeEdit($evalues,$strWhereClause,$dataold,$keys,$usermessage,$inlineedit);

if($retval)

{

if(DoUpdateRecord($strOriginalTableName,$evalues,$blobfields,$strWhereClause))

{

$IsSaved=true;
// after edit event

if(function_exists("AfterEdit"))

{

foreach($dataold as $idx=>$val)

{

if(!array_key_exists($idx,$evalues))

$evalues[$idx]=$val;

}

AfterEdit($evalues,KeyWhere($keys),$dataold,$keys,$inlineedit);

}

}

// added line below

[b]echo "<div style=\"display:none;\">Review Record</div>";[/b]
}

else

{

$readevalues=true;

$message = $usermessage;

$status="DECLINED";

}