|
23 Mar 2003, 03:45
|
#1
|
Bitch
Join Date: Jun 2002
Location: North Yorkshire
Posts: 3,848
|
Why won't it work :(
This is the relevant code from the form...
Code:
echo '<tr><td><INPUT TYPE=CHECKBOX NAME="sizefilter">
Imbalanced score distribution.</td>
<td><input type="text" name="scorecoeff" value="35" size=3>
Coefficient of variation</td></tr>';
echo '<tr><td><INPUT TYPE=CHECKBOX NAME="roidfilter">
Imbalanced roid distribution.</td>
<td><input type="text" name="roidcoeff" value="40" size=3>
Coefficient of variation</td></tr>';
Why when I check roidfilter is it always NULL? sizefilter works fine and this is driving me insane now
__________________
ACHTUNG!!!
Das machine is nicht fur gefingerpoken und mittengrabben. Ist easy
schnappen der springenwerk, blowenfusen und corkenpoppen mit
spitzensparken. Ist nicht fur gewerken by das dummkopfen. Das
rubbernecken sightseeren keepen hands in das pockets. Relaxen und vatch
das blinkenlights!!!
|
|
|
23 Mar 2003, 04:02
|
#2
|
Bitch
Join Date: Jun 2002
Location: North Yorkshire
Posts: 3,848
|
Now another one I just added doesn't work
Is there a limit on the number of values you can pass via a form or something that I don't know about?
__________________
ACHTUNG!!!
Das machine is nicht fur gefingerpoken und mittengrabben. Ist easy
schnappen der springenwerk, blowenfusen und corkenpoppen mit
spitzensparken. Ist nicht fur gewerken by das dummkopfen. Das
rubbernecken sightseeren keepen hands in das pockets. Relaxen und vatch
das blinkenlights!!!
|
|
|
23 Mar 2003, 04:12
|
#3
|
Pedantic hypocrite
Join Date: Jan 2001
Location: Back and to the left
Posts: 1,488
|
I'd be quite surprised if there is a limit, I once filled out a form with 400 checkboxes. Do you have some more code I can look at?
Jester
__________________
I always wanted to be a dancer, but I could never get the shit off my shoes
.......
|
|
|
23 Mar 2003, 04:15
|
#4
|
Bitch
Join Date: Jun 2002
Location: North Yorkshire
Posts: 3,848
|
Quote:
Originally posted by Jester
Do you have some more code I can look at?
Jester
|
Eek...my code is ugly
2 secs while I grab some...
__________________
ACHTUNG!!!
Das machine is nicht fur gefingerpoken und mittengrabben. Ist easy
schnappen der springenwerk, blowenfusen und corkenpoppen mit
spitzensparken. Ist nicht fur gewerken by das dummkopfen. Das
rubbernecken sightseeren keepen hands in das pockets. Relaxen und vatch
das blinkenlights!!!
|
|
|
23 Mar 2003, 04:25
|
#5
|
Bitch
Join Date: Jun 2002
Location: North Yorkshire
Posts: 3,848
|
Code:
echo '<table align="center" border="1" cellspacing="0" cellpadding="2">
<tr><th colspan=6>Top 10 galaxies by ratio.<br></th></tr>';
echo '<tr align="center"><th>X</th><th>Y</th><th>Galaxy</th>
<th>Size</th><th>Score</th><th>Ratio</th></tr>';
$count=0;
while($count<$rows){
if((($sizedev[$count]<$roidcoeff)||$roidfilter!="on")&&
(($scoredev[$count]<$scorecoeff)||$sizefilter!="on")){
echo '<tr align="center"><td>'.$planets[$count][1].'</td>
<td>'.$planets[$count][2].'</td><td>'.$planets[$count][5].'</td>
<td>'.$planets[$count][6].'</td><td>'.$planets[$count][7].'</td>
<td>'.$planets[$count][0].'</td></tr>';
}
$count++;
}
echo '</table>';
That table uses roidfilter (one of the problem variables). No matter what happens to the checkbox it's NULL.
The other variable is $maxresults and is set in the form by this line...
Code:
echo '<tr><td align="right">Maximum number of results</td>
<td><input type="text" name="maxresults" value="25">
</td></tr>';
It's used in this line...
Code:
$query='SELECT x,y,galaxy,score,size,ratio FROM galdump
WHERE age=0 AND score<'.$maxscore.' AND score>'.$minscore.'
AND size<'.$maxsize.' AND size>'.$minsize.' AND ratio<'.$maxratio.'
AND ratio>'.$minratio.' order by size desc limit 0,'.$maxresults;
...and is always NULL as well. I have no idea whatsoever why
__________________
ACHTUNG!!!
Das machine is nicht fur gefingerpoken und mittengrabben. Ist easy
schnappen der springenwerk, blowenfusen und corkenpoppen mit
spitzensparken. Ist nicht fur gewerken by das dummkopfen. Das
rubbernecken sightseeren keepen hands in das pockets. Relaxen und vatch
das blinkenlights!!!
|
|
|
23 Mar 2003, 04:37
|
#6
|
Pedantic hypocrite
Join Date: Jan 2001
Location: Back and to the left
Posts: 1,488
|
You could try setting a value. I seem to recall having some trouble with checkboxes that don't have a value defined. It's been about a year since I've done any php of my own though
Jester
[edit] This might help.[/edit]
__________________
I always wanted to be a dancer, but I could never get the shit off my shoes
.......
|
|
|
23 Mar 2003, 04:45
|
#7
|
Bitch
Join Date: Jun 2002
Location: North Yorkshire
Posts: 3,848
|
Jester I love you \o/
It works now
__________________
ACHTUNG!!!
Das machine is nicht fur gefingerpoken und mittengrabben. Ist easy
schnappen der springenwerk, blowenfusen und corkenpoppen mit
spitzensparken. Ist nicht fur gewerken by das dummkopfen. Das
rubbernecken sightseeren keepen hands in das pockets. Relaxen und vatch
das blinkenlights!!!
|
|
|
23 Mar 2003, 05:12
|
#8
|
Ball
Join Date: Oct 2001
Posts: 4,410
|
Your code isn't particularly ugly, but if you're concerned I find double quotes are cleaner for SQL:
Code:
$query="SELECT x,y,galaxy,score,size,ratio FROM galdump
WHERE age=0 AND score<$maxscore AND score>$minscore
AND size<$maxsize AND size>$minsize AND ratio<$maxratio
AND ratio>$minratio order by size desc limit 0,$maxresults";
And heredocs for HTML:
Code:
echo <<<END
<tr align="center"><td>{$planets[$count][1]}</td>
<td>{$planets[$count][2]}</td><td>{$planets[$count][5]}</td>
<td>{$planets[$count][6]}</td><td>{$planets[$count][7]}</td>
<td>{$planets[$count][0]}</td></tr>
END;
Also, I'd like to pimp this if you're gonna use arbitrary strings in SQL statements:
http://php.red-illusions.dk/forum/vi....php?p=358#358
|
|
|
23 Mar 2003, 05:27
|
#9
|
Bitch
Join Date: Jun 2002
Location: North Yorkshire
Posts: 3,848
|
I'll keep that in mind in case I ever decide to make this toy properly public. Need to add better input filtering if I do, as it stands anyone messing around with it gets what they deserve, an error
__________________
ACHTUNG!!!
Das machine is nicht fur gefingerpoken und mittengrabben. Ist easy
schnappen der springenwerk, blowenfusen und corkenpoppen mit
spitzensparken. Ist nicht fur gewerken by das dummkopfen. Das
rubbernecken sightseeren keepen hands in das pockets. Relaxen und vatch
das blinkenlights!!!
|
|
|
23 Mar 2003, 05:51
|
#10
|
Pedantic hypocrite
Join Date: Jan 2001
Location: Back and to the left
Posts: 1,488
|
Quote:
Originally posted by Gayle29uk
Jester I love you \o/
It works now
|
\o/
Unlike queball I don't prefer here docs for html. That said it's probably more readable, but I quite simply prefer writing strings of html.
However, doublequoting SELECT statements and single quoting inside is more 'correct' as double quotes in the SELECT statement is against the ANSI standard (and won't work in some other SQL systems). Of course variable interpolation doesn't hurt
Jester
__________________
I always wanted to be a dancer, but I could never get the shit off my shoes
.......
|
|
|
28 Mar 2003, 15:36
|
#11
|
MAdnRisKy
Join Date: Mar 2003
Posts: 61
|
I didn't know you were Continental Jester, that was pure spanish :/
__________________
May the Farce be with you...
|
|
|
28 Mar 2003, 16:14
|
#12
|
Pedantic hypocrite
Join Date: Jan 2001
Location: Back and to the left
Posts: 1,488
|
Quote:
Originally posted by Wombat
I didn't know you were Continental Jester, that was pure spanish :/
|
Que?
Jester
__________________
I always wanted to be a dancer, but I could never get the shit off my shoes
.......
|
|
|
31 Mar 2003, 00:21
|
#13
|
home wrecker
Join Date: Jan 2001
Location: The other side of the galaxy ;)
Posts: 1,041
|
Quote:
Originally posted by Jester
Que?
Jester
|
it's Quai?
(I think, at least it is if you're trying manuel over frog)
__________________
May the Farce be with you...
#pr0nstars - a pimp is for life, not just for christmas
|
|
|
31 Mar 2003, 00:55
|
#14
|
Pedantic hypocrite
Join Date: Jan 2001
Location: Back and to the left
Posts: 1,488
|
Quote:
Originally posted by MAdnRisKy
it's Quai?
(I think, at least it is if you're trying manuel over frog)
|
I believe I proved I was not Spanish though
Jester
__________________
I always wanted to be a dancer, but I could never get the shit off my shoes
.......
|
|
|
31 Mar 2003, 02:31
|
#15
|
Ball
Join Date: Oct 2001
Posts: 4,410
|
"¿qué?" is the Spanish equivalent of posting "what?". que is just like the French meaning, see http://www.wordreference.com/es/en/t...n.asp?spen=que
The French would say quoi. (like in pourquoi). Un Quai is the French for a quay.
|
|
|
31 Mar 2003, 03:36
|
#16
|
home wrecker
Join Date: Jan 2001
Location: The other side of the galaxy ;)
Posts: 1,041
|
well now see neither of us speak spanish :/
__________________
May the Farce be with you...
#pr0nstars - a pimp is for life, not just for christmas
|
|
|
31 Mar 2003, 07:57
|
#17
|
Pedantic hypocrite
Join Date: Jan 2001
Location: Back and to the left
Posts: 1,488
|
I don't think queball does either...
Jester
__________________
I always wanted to be a dancer, but I could never get the shit off my shoes
.......
|
|
|
31 Mar 2003, 08:01
|
#18
|
Registered User
Join Date: Mar 2001
Posts: 205
|
and once again we've proved queys websearching skills
__________________
#linux - home of idiots
#impulsed - home of genius..?
|
|
|
31 Mar 2003, 12:10
|
#19
|
Banned
Join Date: Dec 2000
Location: autogenic misery
Posts: 872
|
knowledge.
|
|
|
31 Mar 2003, 12:52
|
#20
|
Forever Delayed
Join Date: Sep 2000
Location: www.netgamers.org
Posts: 1,475
|
Quote:
Originally posted by Jester
You could try setting a value.
|
Bingo!
__________________
Firefly Oper and General l4m3r - "I Do Stuff"
O2 Rip-off campaign
<vampy> plus i hate people ... i despise humanity as a whole
pablissimo "I'm still geting over the fact you just posted a pic of your own vomit"
|
|
|
|
All times are GMT +1. The time now is 04:17.
| |