drwex: (Default)
[personal profile] drwex
Thanks to the spot-on suggestion from Dr Memory I've gotten Apache, php, and MySQL installed and running now.


I'm certain that various things work - for example all the admin pages work, the PHP test page that causes it to dump its environment works, and the databases are all present and data accounted for.

The problem seems to be in using a PHP page as the target for a form submit.

The situation is that I have A.PHP which connects to MySQL and selects from certain tables to build a form (HTML dropdowns). Those are built and presented properly so I know PHP is connecting to the database alright and that the first SELECT statement runs as it should.

The fields are in a form, the target of which is B.PHP. When I submit the form, Apache shows me B.PHP, but its contents are empty. Using printf() statements I can see that the form variables it is trying to examine are null, and so it never runs the DB query that it should be using to populate its contents.

Question: is there something I have to tweak in the Apache conf files or somewhere in order for PHP pages to work properly as the targets of forms?

EDIT TO ADD: A.PHP and B.PHP are unchanged from the previous installation, in which they worked correctly. What's changed is the underlying Apache and MySQL servers, which is why I suspect it's some kind of configuration or permissions issue.

Date: 2008-12-04 06:50 pm (UTC)
From: [identity profile] points.livejournal.com
I think I need to see your B.php. I have a suspicion of what your issue may be, but need to see a sample of the code, first.

Date: 2008-12-04 07:06 pm (UTC)
From: [identity profile] gamehawk.livejournal.com
It's a bit on the order of "did you check to see if it was plugged in," but: did you check to make sure the A.PHP form actually encloses all its input fields? If they're outside, the browser won't submit them in the http request to B.PHP.

Date: 2008-12-04 07:21 pm (UTC)
From: [identity profile] golux-org.livejournal.com
What PHP variable are you reading in B.PHP to obtain the contents of the form fields? For example, $_GET['x'] to read the form field named 'x' from a GET submission.

Historically, there have been a few ways to read form variables in PHP, and the behavior of some of these have changed with newer PHP versions. This is probably not the problem, but since the symptom is that form variables are missing, it seems like a possibility.

Date: 2008-12-04 07:56 pm (UTC)
From: [identity profile] awfief.livejournal.com
This, btw. sometimes you can just use $fieldname, other times it's in an array.....how have register globals set in the php.ini affects this too.

Date: 2008-12-04 08:20 pm (UTC)
From: [identity profile] caulay.livejournal.com
No answers from me, we don't deal with PHP here. And very glad of it, too. JHTML and JSP at least make sense (in a strange Java-ish sort of way).

Profile

drwex: (Default)
drwex

July 2021

S M T W T F S
    123
45678910
11121314151617
1819 2021222324
25262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 12th, 2026 10:10 am
Powered by Dreamwidth Studios