riahc3 50 Â Team Colleague

You can by creating the stored procedure with two params and use CALL yourprocedure(param1, param2).

Apart from that I advise to use MySQLi or PDO using bound parameters. If you insert table names like that be sure to do strict validations before using them. Using backticks around your table and columns names too.

Stored procedures rarely have to do with security and certainly not in your example. Of course you should use prepared statements along with PDO for example but you should validate data both client side and server side. Creating a stored procedure for a single statement doesn’t make any sense other than hiding it from you.

Could you give me example (on that simple query) how to make it secure client/server side? Thank you

riahc3 50 Â Team Colleague

I currently have

$tableName="thenameofthetable";
$someid=$_GET["someidthruget"];
$result = mysql_query("SELECT name,age FROM ". $tableName. " WHERE idp=". $someid);   

Which looks really insecure.

How can I do it using a stored procedure which I think will make it a lot more secure?

Thanks

riahc3 50 Â Team Colleague

http://img689.imageshack.us/img689/4387/messedupq.png

And yes, before you ask, I made the site based on Firefox using Firebug to fix things.

Problably going to be left like that as it is "decent" and all buttons are reachable.

riahc3 50 Â Team Colleague

Looks horrible in IE.
Looks great in Chrome
Looks a bit worst in Firefox

Im going to try to fix it for IE then work on the rest....

Thanks for the tip

riahc3 50 Â Team Colleague

Ill give this a try, thanks.

riahc3 50 Â Team Colleague

Sadly I cant get it to work with a combobox and using a JSON datasource :(

Will have to stay nonedynamic. :( Too bad.

riahc3 50 Â Team Colleague

The code is currently like this (this is not my code)

$j('#imageplus').mousedown(function(e) {
            this.image.width += this.RESIZE;
            this.image.height += this.RESIZE;

            this.x = (canvas.width() / 2) - (this.image.width / 2);
            this.y = (canvas.height() / 2) - (this.image.height / 2 + 10);

            this.canvasListener.redraw();
        }.bind(this));

        $j('#imageminus').mousedown(function(e) {
            this.image.width -= this.RESIZE;
            this.image.height -= this.RESIZE;

            this.x = (canvas.width() / 2) - (this.image.width / 2);
            this.y = (canvas.height() / 2) - (this.image.height / 2 + 10);

            this.canvasListener.redraw();
        }.bind(this));

RESIZE is 5.

The image is shown exactly as it is in its original size.

riahc3 50 Â Team Colleague

jQuery UI has an autocomplete widget which might be what you're looking for:

http://jqueryui.com/autocomplete/

The data source it uses can be hard coded in Javascript or returned from some server side script via AJAX

Looks OK.......The only thing that I would need changing is that if it finds nothing (like I type PHL in that example) it should show me all the list

riahc3 50 Â Team Colleague

I'm not sure if I am thinking too simply, but to keep an image's aspect ratio you can just resize either the height OR width but not both. The other should be left as auto. Working out the orientation of the image i.e. portrait or landscape might help you decide which one to resize.

Im not sure how that would work....

The button would reduce its height (lets say) 2px....Then it would automatically do the same for the width?? Not sure if it would work.

Obviously of course maintaining the current position...

riahc3 50 Â Team Colleague

Hello

I want to create a Javascript button that takes a image on a page and makes it bigger keeping aspect ratio and also another button and makes it smaller but also keeping aspect ratio.

Can someone tell me a good example on how to do this?

Thank you

riahc3 50 Â Team Colleague

OK, I think its a bit better now.

Sorry about that....

riahc3 50 Â Team Colleague

Hello

Using accordion, I want to open it (only one section) when I hover over the header and close it when I leave the header with my mouse.

Ive been able to get it to work 50% but when I hover my mouse over the header if it is open, it closes. If it is closed, it opens.

I only want it to open when I hover and automatically close when I stop hovering.

Here is code I have:

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>jQuery UI Accordion - Open on hoverintent</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<script>
$(function() {
$( "#accordion" ).accordion({
    collapsible: true,
event: "click hoverintent"
});
});
/*
* hoverIntent | Copyright 2011 Brian Cherne
* http://cherne.net/brian/resources/jquery.hoverIntent.html
* modified by the jQuery UI team
*/
$.event.special.hoverintent = {
setup: function() {
$( this ).bind( "mouseover", jQuery.event.special.hoverintent.handler );
},
teardown: function() {
$( this ).unbind( "mouseover", jQuery.event.special.hoverintent.handler );
},
handler: function( event ) {
var currentX, currentY, timeout,
args = arguments,
target = $( event.target ),
previousX = event.pageX,
previousY = event.pageY;
function track( event ) {
currentX = event.pageX;
currentY = event.pageY;
};
function clear() {
target
.unbind( "mousemove", track )
.unbind( "mouseout", clear );
clearTimeout( timeout );
}
function handler() {
var prop,
orig = event;
if ( ( Math.abs( previousX - currentX ) +
Math.abs( previousY - currentY ) ) < 7 ) {
clear();
event = …
riahc3 50 Â Team Colleague

It takes at most 5 minutes to download it and open it up in one browser than another....come on....

riahc3 50 Â Team Colleague

Care to share?

http://www.google.com

pritaeas commented: Really? -3
riahc3 50 Â Team Colleague

Well, since noone helps me, I made my little own dirty hack to solve this.

riahc3 50 Â Team Colleague

Solved by me.

riahc3 50 Â Team Colleague

Hello

Since I can't get something to work, as a temp fix, Im going to do something else but I need this to only happen if it is a Webkit based browser (Safari, Chrome, Android, etc...). How can I detect this?

Thank you

riahc3 50 Â Team Colleague

I need confirmation that this happens on other PCs as well....

riahc3 50 Â Team Colleague

Here is the code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

        "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

    <title>Test of page</title>

    <meta http-equiv="pragma" content="no-cache" />





    <link rel="stylesheet" type="text/css" href="css/main.css">

    <link rel="stylesheet" type="text/css" href="css/colorpicker/colorpicker.css"/>

    <link rel="stylesheet" type="text/css" href="css/colorpicker/layout.css"/>



    <link rel="stylesheet" type="text/css" href="css/highslide.css"/>












</head>

<body>



<div id="mensajes" style="display: none;"></div>

<div id="contenido">

    <div id="panel">



        <canvas id="can" width="550" height="550"></canvas>
        <h1></h1>




             <div id="botones">











    </div>

        <div id="formas" style="position:absolute;margin-left:120px; margin-top:22px;">
            </div>
        <div id="customWidget">



             <div id="colorSelector2" style="cursor:pointer" title="Cambiar Color De Linea">



                <img src="images/botoncolor.png" alt="Cambiar Color De Linea" border="0" />




            </div>



        </div>


            <input type="checkbox" name="enableformas" id="enableformas" style="float: left; margin-left: 100px; margin-top: 27px;">
            <div id="nombrecortediv" style="float:left;margin-top:5px; margin-left:280px;">

            Nombre de corte<br />

            <input type="text" id="nombrecorte" name="nombrecorte" title="Introduce el nombre del dibujo" maxlength=20><br />



            <input type="submit" id="saveAndClose" style="cursor:pointer; cursor:hand;" name="saveAndClose" value="" title="Finalizar y Guardar Dibujo"/>

        </div>






        <div id="tools">














        <div id="acciones">










            </div>





       </div>













        <div id="dibujo" style="display: none;"></div>

    </div>

</div>

</div>

</body>







</html>
riahc3 50 Â Team Colleague

Thats not exactly what I want but Ill try to adapt it...

riahc3 50 Â Team Colleague

Hello

I want to make a dynamic searchable scrollbox using a textbox.....

Lets say I have the following options.....

Ant
Alroy
Antlers
Antldo
Zoo

When I click and open the scrollbox, it should show all options.

In the textbox, if I type A it should show

Ant
Alroy
Antlers
Antldo

If I type Ant it should show

Ant
Antlers
Antldo

Antl would show

Antlers
Antldo

And if I type Antld only show

Antldo

BUT (here is a small catch) if I type Antldoz, since nothing is like that that, it should once again show me:

Ant
Alroy
Antlers
Antldo
Zoo

What is the best method on doing this?

riahc3 50 Â Team Colleague

Hello

I have your standard input box to enter text. I can insert text in that textbox in all browsers except in Google Chrome. Why is this?

riahc3 50 Â Team Colleague

Yes, you can SSH while in a SSH session.

And no, TV without GUI (or WINE) is not possible.

riahc3 50 Â Team Colleague

I never said that the app did not work. I said that the pictures with links (basically buttons) do not show. Do not worry about the app working or not. That is not the issue.

riahc3 50 Â Team Colleague

Then pritaeas's answer is the best for your original question.

That shows me absolutly nothing relevent to the problem. It shows the code being there but it doesnt appear.

There is a reason I posted the code; So you can look at it and see if there is something I am missing :) Also to make sure that it is not only my PC....

riahc3 50 Â Team Colleague

You work at it.
Although icons didn't display in IE... the actual app you have doesn't do anything in Chrome or FireFox. Did you write the code? Do you have a proof-of-concept that draws on the canvas?

Already worked on it a few days.

The app doesnt do anything because the Javascript is missing. I made the code work and of course there are proof-of-concept on it and in FF/CH it does work.

riahc3 50 Â Team Colleague

Welcome to web development :-)

Been a year and something doing this.

So, how do I solve this?

riahc3 50 Â Team Colleague
<canvas id="can" width="550" height="550"></canvas>
<h1>/h1>
<div id="botones"><h1></h1>

This works too....

riahc3 50 Â Team Colleague

Thats SOME progress I guess.....so now what?

riahc3 50 Â Team Colleague

I suspect you have a cross-browser JavaScript issue.

I removed all the Javascript files and it still doesnt show up. Javascript has nothing to do with it.

riahc3 50 Â Team Colleague

Oops lol....

That never mind was that the post I posted is incorrected. I still need help sorry.

Not SOLVED

Can someone remove that post to avoid confusion???

riahc3 50 Â Team Colleague

Never mind

riahc3 50 Â Team Colleague

And let me see if I can upload the ZIP:

riahc3 50 Â Team Colleague

OK, Ive gone ahead and created a ZIP with the page so you guys can take a look and maybe see something I dont....

Javascript has been mostly removed so thats why it may take a second or two to load the page.

First you see the difference:

http://img266.imageshack.us/img266/4234/differenced.png

riahc3 50 Â Team Colleague

Hello

What is the max file size on uploads?
What is the max size width/height?
What file types are supported?

Should say when trying to upload a file...

Thanks

riahc3 50 Â Team Colleague

never mind.

riahc3 50 Â Team Colleague

The developer tools of IE (F12).

Looked before making this thread but it really showed nothing that caught my eye...

riahc3 50 Â Team Colleague
riahc3 50 Â Team Colleague

Hello

For some odd reason, I have a picture with a link and it shows in all browsers except IE8/9/10.

What can I use to debug the problem?

riahc3 50 Â Team Colleague

Liked that so much, its in my sig now :P

riahc3 50 Â Team Colleague

you're repeating code.

In all sincerity, I have never really cared. I perfer repeating code 100 times and program takes up 100MB in memory rather than not repreat code and the program take up 1MB. To me, a program should be made so I can understand and it does what it is suppose to do.

Ive said several times I am not a great programmer, I just program (and dont like it) so....thats my point of view and Im sticking to it.

riahc3 50 Â Team Colleague

As for #1, it looks like it's supposed to be "factorial"; that's what n! usually means. #4 makes sense that way, too.

OK.

riahc3 50 Â Team Colleague

Looks to me like standard assembly. Cant find any documentation on this MARIE....

riahc3 50 Â Team Colleague

The basic for statement executes some initialization code, then executes an Expression, a Statement, and some update code repeatedly until the value of the Expression is false.

What is "some initialization code"? Because that happens before the second step which is making sure the expression is true before entering...

riahc3 50 Â Team Colleague

1- write a java programm which calculate the Faculity of a given numbe n (n!).
2-a) write a java programm which reads a typed number and prints it out : if n neative : "input number is negative"
if n positiv : "input number is positiv" , if n = 0 : "input number is Zero"
2-b) epand your program : if input number n is positiv then : is it odd or even ? ( use if else struct inside the posivie 2-a) )
2-c) expand your program : if the input nuber is between 1 - 7 then print out the corresponding day 1 = Monday .... 7 = sunday ( use Switch construct )
3-a) write a java program that : reads 10 numbers and gives out the max . min , and the Midvalue ( use "for loop")
3-b) implement the program from 3-a) with "while loop"
3-c) implement the program from 3-a) with "do-while-loop" in this case positiv numbers are to be typed as input and as soon as the input number is negative the program will give the results (min , max , midvalue ) and stop .
4- make a java-class which solve Question 1 (n!) with for-loop . the number n is to be typed with the keyboard.

Here we go:

1: No idea what is a Faculity
2a:

Scanner input=new Scanner(System.in);
        try
        {
            do
            {
                System.out.println("Insert a number");
                String …
ddanbe commented: first time I do this -3
riahc3 50 Â Team Colleague

Print "Who?" once? I can't see it looping because i will never be < 2 when it starts at 5. That being said, the only print should be "Who?".

The problem is that it is a "if" before it is actually a "for"...

That "for" loop (according to what you have said) is the same as a while loop saying:
_

int i=5
while (i<2)
{
System.out.println("What?");
}
System.out.println("Who?");
riahc3 50 Â Team Colleague

I agree about being at the top. Rules. Nothing else, should be at the top.

riahc3 50 Â Team Colleague

Hello

Ive come up with a stupid question that just needs a why

What would this do?

for (int i=5; i<2;i++)
{
System.out.println("What?");
}
System.out.println("Who?");
riahc3 50 Â Team Colleague

There are so many JSON Java libraries that would make returned JSON marshaling so easy and simple to do Jackson, Gson, JSON and in 2 months time you didn't come up with something better...

You really did not read the thread did you?

This is a proof of conecept; NOT a real application. It was just made to show how the API interacts with different lanaguages.

This thread was made about 3 months ago and YOU didnt come up with anything, right? So then shut the fuck up :) or make "something better".

riahc3 50 Â Team Colleague

Ill give you a example:

for (int i=0;i<99;i++)
{
    if (i>0)
    {
        break;
    }
    else
    {
    //do whatever you want
    }
}

This makes it loop only once (for whatever reason you want). Do note, that this may or may not apply to your situation.

gusano79 commented: It looks like you didn't even try to understand the question. Also, that code is an example of something nobody should ever write--everything outside the "else" block is meaningless and wasteful. -2