Page 1 of 1

Differences between Local build versus Remote build

Posted: Sat Oct 04, 2003 7:01 am
by mikeb
Hi,

I'm building a site at the moment. I'm building it locally, testing, and ftp'ing working files to the server. All has been well and good 'til recently. Now I find that the remote site is working fine, but although I've DOWNloaded all the remote files to the local server, there's a difference! Global variables for db values etc. have been replaced so there's no problem there. The symptoms are:

There's a form page which posts to an update/edit page. The update page edits the specific record based on an id variable being posted over. Simple as that. Works fine on the remote live server, but locally the fields are not being updated. I don't get an error either! I know the fields are not being updated 'though because when I check the db manually the records have not been changed and also the page which shows the user what they've updated, has blanks where the updated field info should be.

It's a long shot, but I'm hoping someone else knows exactly what this is because it's happend them.

FYI,
The remote server uses:
Apache 1.3.2.7
PHP4.3.0
MySQL 3.23.54
UNIX box

My local server uses
Apache V.2
PHP4.3.3
MySQL 3.23.49
W2K box

Incidentally (in case it has a bearing), The entry form has a textarea in html and locally I cannot do carriage returns when entering information but I can remotely. Sorry, my questions are always epic. If this is against rules please let me know! Code snippets available on request - just thought my question was long enough for the moment,

Mike

Posted: Sat Oct 04, 2003 7:03 am
by Cruzado_Mainfrm
check this out buddy
viewtopic.php?t=511

Posted: Sat Oct 04, 2003 9:18 am
by mikeb
Thanks mate but I'm already using the POST form for my variables! It ain't that. What a bummer! I can't go any further with my site unless I crack this.

cheers,

Mike

Posted: Sat Oct 04, 2003 10:11 am
by McGruff
Have you tried debugging your script sequentially, ie go through it a block at a time to check that everything is correct up to that point. You can use print_r() / echo() to check vars and finally die() to stop the script.

Posted: Sat Oct 04, 2003 10:23 am
by volka
or spend some time to set up a much more powerful debugger
http://www.php.net/manual/en/debugger.php

All hail to the debuggers ;-)

Posted: Sat Oct 04, 2003 2:25 pm
by JAM
This is one of the big questions for developers. If you use phpinfo() at home and on your host, you likely will see difference (not talking about the obvious $_SERVER ones and such).

An example from the manual...

Code: Select all

<?php
echo get_magic_quotes_gpc();         // 1
echo $_POST['lastname'];             // O''reilly
echo addslashes($_POST['lastname']); // O\\''reilly

if (!get_magic_quotes_gpc()) {
    $lastname = addslashes($_POST['lastname']);
} else {
    $lastname = $_POST['lastname'];
}

echo $lastname; // O''reilly
$sql = "INSERT INTO lastnames (lastname) VALUES ('$lastname')";
?>
If you magic_quotes_gpc setting is different at home vs. your host, you would get different results if you are not using the if-else-clause...

This is just one example as there are alot more settings that just might fubar your script. Not even telling that this is the case for you, but it might be worth looking into.

Posted: Sun Oct 05, 2003 5:21 am
by mikeb
Thank's to all who replied. I feel like such a donkey! Cruzado_Mainfrm, Mia Culpa, you were right all along :oops: . I don't know how I got caught with it 'cause I already know about the issues with posting. I suppose I just assumed that I was using the $_POST form of passing the variables, and y'know how you can look at a page and see what SHOULD be there rather than what IS? Anyhow that's working now, thanks again,

(if ever somebody's signature was a noose to hang themselves with!!)

Mike

Posted: Sun Oct 05, 2003 7:27 am
by Cruzado_Mainfrm
those are good news that u finally fixed it, keep up the good work