need help in solving problem...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
panyaung
Forum Newbie
Posts: 3
Joined: Fri Sep 25, 2009 12:31 am

need help in solving problem...

Post 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
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: need help in solving problem...

Post 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?
panyaung
Forum Newbie
Posts: 3
Joined: Fri Sep 25, 2009 12:31 am

Re: need help in solving problem...

Post by panyaung »

eee... I would like to fix the problems.
I would like to learn php too. I am not familiar with php.
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: need help in solving problem...

Post by jackpf »

Use isset() or array_key_exists() to check the array keys exist before using them.
r4r4
Forum Newbie
Posts: 11
Joined: Thu Jul 02, 2009 12:01 am

Re: need help in solving problem...

Post 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.
panyaung
Forum Newbie
Posts: 3
Joined: Fri Sep 25, 2009 12:31 am

Re: need help in solving problem...

Post 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!!!
User avatar
turbolemon
Forum Commoner
Posts: 70
Joined: Tue Jul 14, 2009 6:45 am
Location: Preston, UK

Re: need help in solving problem...

Post 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.
cokeetang
Forum Newbie
Posts: 3
Joined: Mon Oct 12, 2009 1:24 pm

Re: need help in solving problem...

Post by cokeetang »

code code, your code.
Post Reply