Jump to content

PHP/MySQL errors as the result of site relocation


bjj_hsc13

Recommended Posts

I think this is most appropriate for the php site area, but we'll see.. We are a non profit who has recently moved a related website  to a different path on our web server, and have inadvertently broken some content as a result.

 

Background:

 

There are several pages on this Green Clean Schools site which feature (MySQL) database-driven content (developed long ago and with little/no remaining support), and our MySQL instance is also located on our web host, and unfortunately due to our move, this database driven content is non-functional. Further unfortunate is that we don't have any php expertise in house.  :-\

 

Here's two example pages with partially broken content: 

 

1. http://www.greencleanschools.org/distributors-center.html

2. http://www.greencleanschools.org/ag-our-sponsors.html

 

In the first, the US state image is supposed to be mapped to our MySQL database to return eligible products which are available through distributors in given states. In our database, each product has fields for each state it is able to be distributed within.

 

There are 3 php files use primarily by the site for MySQL-related functionality, they are called in an includes :

 

1. Connect to the MySQL database (hsc_conn.php)

2. Contains all variable and array declarations for products and companies (these are the only 2 database tables) (hsc_config.php)

3. All functions performing operations on variables and arrays for actual site functionality (hsc_functions.php)

 

We seem to think the problem is in the 2nd file, as it seems that the arrays which are declared in this file are unable to be read by any of the functions in the 3rd file, and so all functions effectively return garbage or incomplete data. None of the code, either in the php config files or the webpages themselves, was altered as part of the move, and all references to directories, etc are relative, so there were no anticipated issues. We have tested database connectivity successfully, and our .htaccess file contains an Apache handler so that php can be rendered correctly, php version 5.2.17.

 

I realize this sounds like a lot, but I feel the fix for this could be very simple. You guys seem like a very helpful resource and I hope this is not asking too much, so any advice or questions are welcome, however simple!!

 

Cheers,

Ben

hsc_config.php

hsc_conn.php

hsc_functions.php

distributors-center.html

Link to comment
Share on other sites

I would say what you try to explain is quite detailed, but still not sufficient to let others help you.

 

for example:

 

1. it would helpful if you can provide error message you get 

2. it would helpful if you explain each item that does not work according to you,

 

 

as far i can see there are:

1. extras /> on page #1 , which is a questionable content

2. i can see short open and close tag on page #2 <?=$item?> , check your php.ini setting , it looks like php treat it as html. 

 

 

since you run a non profit, is there any way to contribute in my free time? if there is anything i can do without leaving this desk i can help you. i use php and mysql for my day job. 

Edited by mweldan
Link to comment
Share on other sites

absolutely you can contribute in your free time, we're open to any sort of help! there really are no error messages other than broken linked images as you can see, and unfortunately i have no screen shots of the site as it existed pre-move to demonstrate what isn't working.

 

the root of the problem seems to be that the php code on each page is not being rendered properly, but apart from adding a line to our .htaccess to allow HTML to be parsed as php (which we have already done), i don't know how else to address that.

 

when we did add that to .htaccess, it did fix issues we had with php includes which are used to load 2 header and 1 footer section which the site uses universally.

Link to comment
Share on other sites

simple simple simple.. the php.ini file was not being referenced in .htaccess for this site!

 

thanks for the tip mweldan, i didn't know this was referenced in .htaccess (in addition to the handler) as our old .htaccess file was about 100 lines long as it functioned for multiple sites.

Edited by bjj_hsc13
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.