User Name
Password

Go Back   Planetarion Forums > Non Planetarion Discussions > Programming and Discussion
Register FAQ Members List Calendar Arcade Today's Posts

Reply
Thread Tools Display Modes
Unread 23 Mar 2003, 03:45   #1
Gayle29uk
Bitch
 
Join Date: Jun 2002
Location: North Yorkshire
Posts: 3,848
Gayle29uk is just really niceGayle29uk is just really niceGayle29uk is just really niceGayle29uk is just really nice
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!!!
Gayle29uk is offline   Reply With Quote
Unread 23 Mar 2003, 04:02   #2
Gayle29uk
Bitch
 
Join Date: Jun 2002
Location: North Yorkshire
Posts: 3,848
Gayle29uk is just really niceGayle29uk is just really niceGayle29uk is just really niceGayle29uk is just really nice
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!!!
Gayle29uk is offline   Reply With Quote
Unread 23 Mar 2003, 04:12   #3
Jester
Pedantic hypocrite
 
Jester's Avatar
 
Join Date: Jan 2001
Location: Back and to the left
Posts: 1,488
Jester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond repute
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
.......
Jester is offline   Reply With Quote
Unread 23 Mar 2003, 04:15   #4
Gayle29uk
Bitch
 
Join Date: Jun 2002
Location: North Yorkshire
Posts: 3,848
Gayle29uk is just really niceGayle29uk is just really niceGayle29uk is just really niceGayle29uk is just really nice
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!!!
Gayle29uk is offline   Reply With Quote
Unread 23 Mar 2003, 04:25   #5
Gayle29uk
Bitch
 
Join Date: Jun 2002
Location: North Yorkshire
Posts: 3,848
Gayle29uk is just really niceGayle29uk is just really niceGayle29uk is just really niceGayle29uk is just really nice
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!!!
Gayle29uk is offline   Reply With Quote
Unread 23 Mar 2003, 04:37   #6
Jester
Pedantic hypocrite
 
Jester's Avatar
 
Join Date: Jan 2001
Location: Back and to the left
Posts: 1,488
Jester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond repute
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
.......
Jester is offline   Reply With Quote
Unread 23 Mar 2003, 04:45   #7
Gayle29uk
Bitch
 
Join Date: Jun 2002
Location: North Yorkshire
Posts: 3,848
Gayle29uk is just really niceGayle29uk is just really niceGayle29uk is just really niceGayle29uk is just really nice
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!!!
Gayle29uk is offline   Reply With Quote
Unread 23 Mar 2003, 05:12   #8
queball
Ball
 
queball's Avatar
 
Join Date: Oct 2001
Posts: 4,410
queball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so little
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
queball is offline   Reply With Quote
Unread 23 Mar 2003, 05:27   #9
Gayle29uk
Bitch
 
Join Date: Jun 2002
Location: North Yorkshire
Posts: 3,848
Gayle29uk is just really niceGayle29uk is just really niceGayle29uk is just really niceGayle29uk is just really nice
Quote:
Originally posted by queball
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
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!!!
Gayle29uk is offline   Reply With Quote
Unread 23 Mar 2003, 05:51   #10
Jester
Pedantic hypocrite
 
Jester's Avatar
 
Join Date: Jan 2001
Location: Back and to the left
Posts: 1,488
Jester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond repute
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
.......
Jester is offline   Reply With Quote
Unread 28 Mar 2003, 15:36   #11
Wombat
MAdnRisKy
 
Join Date: Mar 2003
Posts: 61
Wombat is an unknown quantity at this point
I didn't know you were Continental Jester, that was pure spanish :/
__________________
May the Farce be with you...
Wombat is offline   Reply With Quote
Unread 28 Mar 2003, 16:14   #12
Jester
Pedantic hypocrite
 
Jester's Avatar
 
Join Date: Jan 2001
Location: Back and to the left
Posts: 1,488
Jester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond repute
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
.......
Jester is offline   Reply With Quote
Unread 31 Mar 2003, 00:21   #13
MAdnRisKy
home wrecker
 
MAdnRisKy's Avatar
 
Join Date: Jan 2001
Location: The other side of the galaxy ;)
Posts: 1,041
MAdnRisKy is a splendid one to beholdMAdnRisKy is a splendid one to beholdMAdnRisKy is a splendid one to beholdMAdnRisKy is a splendid one to beholdMAdnRisKy is a splendid one to beholdMAdnRisKy is a splendid one to beholdMAdnRisKy is a splendid one to behold
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
MAdnRisKy is offline   Reply With Quote
Unread 31 Mar 2003, 00:55   #14
Jester
Pedantic hypocrite
 
Jester's Avatar
 
Join Date: Jan 2001
Location: Back and to the left
Posts: 1,488
Jester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond repute
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
.......
Jester is offline   Reply With Quote
Unread 31 Mar 2003, 02:31   #15
queball
Ball
 
queball's Avatar
 
Join Date: Oct 2001
Posts: 4,410
queball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so little
"¿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.
queball is offline   Reply With Quote
Unread 31 Mar 2003, 03:36   #16
MAdnRisKy
home wrecker
 
MAdnRisKy's Avatar
 
Join Date: Jan 2001
Location: The other side of the galaxy ;)
Posts: 1,041
MAdnRisKy is a splendid one to beholdMAdnRisKy is a splendid one to beholdMAdnRisKy is a splendid one to beholdMAdnRisKy is a splendid one to beholdMAdnRisKy is a splendid one to beholdMAdnRisKy is a splendid one to beholdMAdnRisKy is a splendid one to behold
well now see neither of us speak spanish :/
__________________
May the Farce be with you...

#pr0nstars - a pimp is for life, not just for christmas
MAdnRisKy is offline   Reply With Quote
Unread 31 Mar 2003, 07:57   #17
Jester
Pedantic hypocrite
 
Jester's Avatar
 
Join Date: Jan 2001
Location: Back and to the left
Posts: 1,488
Jester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond repute
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
.......
Jester is offline   Reply With Quote
Unread 31 Mar 2003, 08:01   #18
Slidey
Registered User
 
Join Date: Mar 2001
Posts: 205
Slidey is an unknown quantity at this point
and once again we've proved queys websearching skills
__________________
#linux - home of idiots

#impulsed - home of genius..?
Slidey is offline   Reply With Quote
Unread 31 Mar 2003, 12:10   #19
inf
Banned
 
Join Date: Dec 2000
Location: autogenic misery
Posts: 872
inf is an unknown quantity at this point
knowledge.
inf is offline   Reply With Quote
Unread 31 Mar 2003, 12:52   #20
Mong
Forever Delayed
 
Join Date: Sep 2000
Location: www.netgamers.org
Posts: 1,475
Mong is on a distinguished road
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"
Mong is offline   Reply With Quote
Reply



Forum Jump


All times are GMT +1. The time now is 04:17.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2018