Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Drop Down Executes Query On Post? Reply To: Drop Down Executes Query On Post?

#170682
MBM
Participant

Without strict Error filtering they work! I was previously using :

error_reporting(E_ERROR);

They variables are used in other pages so I edited those pages. I can get rid of the error messages :

$message = $_GET['message'];

to :

(!empty($_GET['$message']) ? $_GET['$message'] : null);

And :

$usercomments = nl2br($_POST['usercomments']);

to :

(!empty($_POST['$usercomments']) ? $_POST['$usercomments'] : null);

Or by moving the variables next to their relating statements.
I use the message variable to display empty form field validation messages. When I made the change above, I get UNDEFINED VARIABLE: MESSAGE for this line (in another script not the filter ratings script) :

<div>
<?php print $message ; ?>
</div>

So I tried removing it from within the HTML and declaring it inside the php (at the top of the page) as follows :

echo '
<div>
'. $message.'.
'.$usercomments.'
</div>';

There are no php error messages but the empty form field validation messages do not fire, they’re displayed in the address bar but previously they displayed inside the form, where I wanted them.

You can post from the gist. I’ve updated it to show the changes.

The filter ratings and post ratings will all be in one page which is why it may appear as if the variables are not being used, I’ve copied a page as a template and am using it to get the filter working.