470,855 Members | 1,194 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,855 developers. It's quick & easy.

php MySQL works on remote server, only partially on local server

I am new at php and MySQL and have some (ugly, I'm sure) code to
populate form select fields with data from a MySQL database, so a user
can use those to sort/filter and view the 3,000 records. No inserts --
just selects; very simple.

I originally set this up using URL-based query strings at
http://stjuliana.org/school/ar/BUindex.php but since that only allowed
sorting and not filtering, hence all 3k records load, I made a form
verson at http://stjuliana.org/school/ar/index.php . Everything works
just fine, however, there's still a lot of tweaking I want to do, such
as splitting the form input and output into two pages (_blank), having
a printable version, etc. To that end I just set up the latest builds
of Apache, php and MySQL on my local Windows XP box, lest I blow my
beer budget for the month on bandwidth overage. <g>

I have a very simple page I used to test my localhost setup and
everything's fine. I can connect to MySQL, create, insert and select
from DBs, so I know my config is fine. All my other .php pages on this
site work fine locally as well.

The two abovementioned pages, however, are giving me fits when run
locally...

For the URL-query-string version, it loads up with the default view
(=name_ns), which grabs all records and sorts by name and point asc.
No matter which of the other sort 'views' I might choose, it still
loads up all the records in that default sort. The server's holding on
to something and I don't know how to clear it. The remote version
correctly sorts based on the query string chosen.

The form version is worse. It connects to the DB and populates the
select boxes with the field data -- that part's fine. But no matter
which submit button is selected, no data is retrieved. I get no error,
but no data either. The form's action is set to $_SERVER['PHP_SELF']
and I've tried both GET and POST -- no change.

Since the exact same pages work on the remote server I know it has to
be something on the local setup. But where do I look if there's no
obvious error?

This is probably something incredibly basic but I'm bleary-eyed from
reading tutorials and forums all over the Internet and can't come up
with anything.

TIA
Hera
Jul 17 '05 #1
2 2135
I noticed that Message-ID: <jt********************************@4ax.com>
from hera contained the following:
Since the exact same pages work on the remote server I know it has to
be something on the local setup. But where do I look if there's no
obvious error?


This is most likely a register globals issue. If you are passing the
sort criteria to the script via a form you need to make sure you
retrieve them via the $_POST array

Try echoing your SQL to the screen to see what you are actually
searching for.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #2
Thank you so much - that was indeed the answer and now I can test to
my heart's content locally.

The comments in php.ini indicate that turning register_globals on is a
security risk and my host obviously has this setting on or the script
wouldn't have worked remotely. Ergo, I've not done a good job with my
script in that I should get it to work with register_globals off, so
it's more secure.

Thanks again,
Hera
On Sat, 06 Nov 2004 08:25:04 +0000, Geoff Berrow
<bl******@ckdog.co.uk> wrote:
This is most likely a register globals issue.

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Mike MacSween | last post: by
reply views Thread by Lenz Grimmer | last post: by
3 posts views Thread by apostolosl | last post: by
4 posts views Thread by Jerim | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.