Page 1 of 1

need help in solving problem...

Posted: Fri Sep 25, 2009 12:51 am
by panyaung
Hi all,

I am facing a problem and I hope you can help and give suggestions.
I have an application written in php which use mysql for database. The application is running properly in the current server. I also have a backup server and I need to back up the applications on it, later I may use this backup server for my applications. My problem is:
When I copy the applications and database to the backup server, some of the pages are not working in backup server, whereas they run in the current web server. I’ve got the same error messages for all pages which are not working. The error message is
“PHP Notice: Undefined index: xxx in xxx\...\xxx.php on line no.”

When I look at those lines, I found out that the error shows in $_POST[‘variable’] or $_REQUEST[‘variable’].

I am out of my idea to solve this problem because the exactly the same coding is working in current server. Please give me suggestions to solve the problem. Thanks in advance you guys!

********
panyaung

Re: need help in solving problem...

Posted: Fri Sep 25, 2009 2:28 am
by requinix
Are you interested in hearing the way to fix those errors? It'll take time to fix them all.
Or do you not care about that and simply want the messages to go away?

Re: need help in solving problem...

Posted: Fri Sep 25, 2009 3:43 am
by panyaung
eee... I would like to fix the problems.
I would like to learn php too. I am not familiar with php.

Re: need help in solving problem...

Posted: Fri Sep 25, 2009 4:34 am
by jackpf
Use isset() or array_key_exists() to check the array keys exist before using them.

Re: need help in solving problem...

Posted: Fri Sep 25, 2009 6:06 am
by r4r4
hey panyaung, you put nice question and right now i have no good knowledge about the php and i m taking php class.

Re: need help in solving problem...

Posted: Mon Oct 12, 2009 10:43 pm
by panyaung
Another problem comes... :(
As I mentioned b4, there are 2 servers : webserver and backup server.
Before I state the problem, I would like to tell that I am using same application(same coding) and same database for web and bk servers.
Everything works fine in webserver. Backup server gives me problem.

The following is the problem I am facing :

I run an application in bk server and index page is OK. When I click on a link to open another page from the index page, only the header, footer and title of the page appeared. The rest : the text boxes and submit button doesn't appear.
Why???

Whether I am not PHP professional, I am quite understand program flow. I don't think its a coding problem because the same coding works well in web server.
I reinstall PHP again and test again but same thing happened.
Please help me if you have any idea!!!

Note : Don't know where to put this post, so if there's a wrong place, sorry!!!

Re: need help in solving problem...

Posted: Tue Oct 13, 2009 3:48 am
by turbolemon
If your live site is using a different configuration to that of your backup servers, you may experience problems (e.g. Windows and Unix-like systems use different file systems, php config may be different, apache might be configured differently, you may be using different versions of PHP, etc.). It's very difficult to advise with so little information, but I would suggest that you attempt to exactly replicate the configuration of the live system on the backup systems.

If the app still doesn't work, it's most likely a problem with the application (e.g. a hard-coded include, a configuration file may need updating, etc.). You will have to go through the code.

Re: need help in solving problem...

Posted: Tue Oct 13, 2009 4:38 am
by cokeetang
code code, your code.