<div class="gmail_quote">On Mon, Nov 30, 2009 at 2:37 PM, inhahe <span dir="ltr"><<a href="mailto:inhahe@gmail.com">inhahe@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Mon, Nov 30, 2009 at 1:21 PM, Victor Subervi <<a href="mailto:victorsubervi@gmail.com">victorsubervi@gmail.com</a>> wrote:<br>
> On Mon, Nov 30, 2009 at 2:00 PM, inhahe <<a href="mailto:inhahe@gmail.com">inhahe@gmail.com</a>> wrote:<br>
>><br>
>> On Mon, Nov 30, 2009 at 12:58 PM, inhahe <<a href="mailto:inhahe@gmail.com">inhahe@gmail.com</a>> wrote:<br>
>> > On Mon, Nov 30, 2009 at 12:49 PM, Victor Subervi<br>
>> > <<a href="mailto:victorsubervi@gmail.com">victorsubervi@gmail.com</a>> wrote:<br>
>> >><br>
>> >><br>
>> >> If I'm not mistaken, that won't help me actually print to screen the<br>
>> >> user's<br>
>> >> choices as he selects them, which in my application, is important.<br>
>> >> Please<br>
>> >> advise.<br>
>> >> TIA,<br>
>> >> V<br>
>> ><br>
>> ><br>
>> > sure, that's where this part comes in:<br>
>> ><br>
>> > the javascript would populate the list for the colors the user selects<br>
>> > (the easiest way would probably be to give the list an id and use<br>
>> > getElementByID())<br>
>> ><br>
>> > so basically you'd define, e.g., an onClick="blah('red'); return true"<br>
>> > within the red element's tag, and then define a function blah(x) that<br>
>> > says<br>
>> > getElementById("my_list_id").innerHtml += "<br>" + x;<br>
>> > and of course give your list textarea an id="my_list_id" attribute in<br>
>> > the tag.<br>
>> ><br>
>> > that could be slightly wrong, my javascript's rusty<br>
>> ><br>
>><br>
>> also don't forget to sanitize the data you receive before committing<br>
>> it to the database, or someone can hack the javascript and send an SQL<br>
>> injection attack<br>
><br>
> Good call! However, in my case I can put this all behind a firewall. It's<br>
> only for the shop builder's use, and that's my client...whom I can track!<br>
> But I presume this would entail doing searches for and eliminating all<br>
> unnecessary characters, right?<br>
> V<br>
><br>
<br>
depends on if you're using python or php on the server side<br>
if you're using Python, just use parameterized sql, which completely<br>
avoids the issue of sql injection<br>
if you're using php, parameterized sql is kind of pain in the ass, but<br>
it includes a function for sanitizing strings so you don't have to<br>
make one yourself.<br>
if i remember correctly though, my friend and i had issues with that<br>
function, for example ' would be saved as \' in our database, or<br>
something like that<br>
i'm not sure which characters you need to eliminate to sanitize sql<br>
parameters.. i wouldn't be comfortable relying on my own function to<br>
do that without thoroughly researching the issue... and i'd probably<br>
just rather find a function that's already been written<br>
</blockquote></div><br>Yeah, parameterize it. PHP?! Wash your mouth out with soap!<br>;)<br>V<br>