NineChime forum

Furry stuff, oekaki stuff, and other stuff.

You are not logged in.

Post a reply

Write your message and submit
Options
Humanity test

What is seven + two?

Go back

Topic review (newest first)

Titanium
06-09-2008 02:10:39

I was able to get it to work. There was an error in my SQL query. Instead of using 'usrname', I was using 'username'. :p

And thanks for the explanations. They helped a lot!

Waccoon
06-08-2008 20:32:21

Hmm... that code looks fine, and if you're using your own server, there shouldn't be a problem using the word "infraction" as a control variable.  Is there also a "mode" variable set in the form?  You can only use either "mode" or "action", but not both.  Have you tried testing the passed value?  You can do that by adding this to the top of the functions file, below the code that includes "boot.php".  It handles all required exit routines:

Code:

// Input
// $pageno
w_exit($action);

Titanium wrote:

Why do I get this "No mode.  Is a server filter being used?" error? What does it mean?

That means no branches in functions.php executed, so the end of the script was reached.  On some servers, POST data might be ignored by the server, which typically happens when people use bad language or "spam" when posting comments, so the server simply throws away the POST data.  This should not happen on a properly configured server.

The "mode" and "action" variables are used to determine the mode.  $mode is for $_GET requests, and $action is for $_POST.  Both control variables are filtered as alphanumeric in boot.php, so you may only use letters, numbers, and the underscore in mode values.  Symbols in the value will result in problems.

Titanium wrote:

And could someone explain to me how the w_gpc() function works? I'm not understanding the filter part.

PHP throws a tantrum if you try to read superglobals without testing to make sure they are set.  The w_gpc() function gets around this, and handles importing values from $_GET, $_POST, and $_COOKIE (G, P, and C).

The function takes two strings as parameters:

Code:

$filtered_gpc = w_gpc('variable_name', 'filter_type');

The available filters are:

Code:

'i'    = Integer.  The value is an actual integer, and not a string
'i+'   = Positive integers only.  Negative numbers are rounded up to 0
'a'    = Alphanumeric, with underscores
'html' = HTML encoded, with slashes
'raw'  = Do not add slashes to the input

Due to limitations with OekakiPoteto, all returned values except 'raw' have slashes applied, so to properly echo values from CGI input, you need to remove slashes, first.  You do not need to do this when printing data fetched from the database.

Code:

$my_data = w_gpc('text_input');
echo ('You typed: ' . w_html_chars(strip_slashes($my_data));

OR THIS:

$my_data = w_gpc('text_input', 'raw');
echo ('You typed: ' . w_html_chars($my_data);

OR THIS:

$my_data = w_gpc('text_input', 'html');
echo ('You typed: ' . strip_slashes($my_data);
Titanium
06-08-2008 19:50:52

No, I'm on localhost. I'm using xampp.

Kia
06-08-2008 19:06:23

Are you using funpic? Does that a lot on there.

Titanium
06-08-2008 16:49:22

I'm using Wacintaki 1.3.13, and I'm making an addon for my oekaki. Basically I made a separate page with a form on it.

<div id="contentmain">
<form name="form1" action="functions.php" method="post">
<input name="action" type="hidden" value="infraction" />
Then the rest of the form code goes here...
</form>
</div>

------------------

And then in functions.php

if ($action == 'infraction') {
//do  stuff here
}

Why do I get this "No mode.  Is a server filter being used?" error? What does it mean?

And could someone explain to me how the w_gpc() function works? I'm not understanding the filter part.

Thanks a lot.

Board footer

Yep, still running PunBB
© Copyright 2002–2008 PunBB