[jQuery] problem with .ajax POST and quotes

2009-11-07 Thread phicarre
Hi all,

Problem with .ajax with type = POST

error: missing ) after argument list

$output .= div style='width:150px;'  a href=\javascript:choice1
($id,;
$output .= ' . $name . ';
$output .= )\;

same error with

$output .= div style='width:150px;'  a href=\javascript:choice1
($id,;
$output .= \ . $name . \;
$output .= )\;

no error but display choice1(99, instead of choice1(99,10)

$output .= div style='width:150px;'  a href='javascript:choice1
($id,;
$output .= ' . $name . ';
$output .= )';

The calling function declares dataType as script

What is the correct formulation ?


[jQuery] A loading image in the centre of the screen

2009-03-09 Thread phicarre

I would like with jQuery to show a loading image in the centre of the
screen that waits for everything to load. And whatever the browser !
Any solutions ? plugins ?


[jQuery] Re: A loading image in the centre of the screen

2009-03-09 Thread phicarre

Ok but it is for a message, not for a loading image

On 9 mar, 19:26, James james.gp@gmail.com wrote:
 Check out the BlockUI plugin:http://malsup.com/jquery/block/

 On Mar 9, 8:21 am,phicarregam...@bluewin.ch wrote:

  I would like with jQuery to show a loading image in the centre of the
  screen that waits for everything to load. And whatever the browser !
  Any solutions ? plugins ?


[jQuery] Re: An animated gif in the middle

2009-03-06 Thread phicarre

I supposed that someone knows a plugin who does that ...

On 6 mar, 00:39, dawnerd dawn...@gmail.com wrote:
 What you are trying is more CSS based than jquery based. You can set
 the images css to margin:0 auto; which will center align it. Then set
 some top padding or margin to vertically align it.

 On Mar 5, 3:33 pm,phicarregam...@bluewin.ch wrote:

  How to show IN THE MIDDLE OF THE SCREEN an animated gif (with jquery
  effects) during a long operation ?
  I tried several methods but never compatible with, at least, FF and
  IE ...


[jQuery] An animated gif in the middle

2009-03-05 Thread phicarre

How to show IN THE MIDDLE OF THE SCREEN an animated gif (with jquery
effects) during a long operation ?
I tried several methods but never compatible with, at least, FF and
IE ...


[jQuery] Re: Calling PHP function with $.ajax()

2009-03-05 Thread phicarre

url: myScript.php,

On 5 mar, 21:10, side1021 derek.pc@gmail.com wrote:
 Hi,

 Is there any way to call a php function directly with $.ajax()?  I did
 some search and the answer I've got varies from impossible to using
 workarounds such as passing query string to the 'data' and let php
 direct which function to call.  I know that with asp.net it's possible
 but i'm not familiar with PHP.  Here is the code that works for me in
 asp.net.

           $.ajax({
                type: POST,
                url: Default.asp/Book,
                contentType: application/json; charset=utf-8,
                data: {},
                dataType: json,
                success: AjaxSucceeded,
                error: AjaxFailed
            });

 Thanks!


[jQuery] Re: How to make a secured login form

2009-02-26 Thread phicarre

I found 2 empty lines in a script previously called. This seems to
disturb the echo function.

On 13 fév, 19:48, James james.gp@gmail.com wrote:
 Do you want a refresh on the current page when the login is
 successful?
 Upon successful login, it will refresh your current page
 (welcome.php), then the script (welcome.php) will see that the user is
 logged in and will display the welcome screen content rather that the
 login content.

 Or would you rather do it more Web 2.0 style without the browser
 refresh, and have the login content disappear, and the welcome content
 display in place?

 What exactly is the client seeing on welcome.php that makes it
 insecure? I don't see the issue.

 On Feb 13, 8:30 am,phicarregam...@bluewin.ch wrote:

  The question was How to call welcome.php from my jquery script in a
  secured manner ? because welcome.php is visible from the client side.

  On 13 fév, 13:19, Rene Veerman rene7...@gmail.com wrote:

   Rene Veerman wrote:
           //    $pwh = md5 ($users-rec[user_password_hash] .
$challenge);

   Ehm, best to use Either sha256 OR md5 for BOTH fields ofcourse ;)
   It was a hasty paste.


[jQuery] Re: jQuery.Form and url

2009-02-24 Thread phicarre

it returns error [object xmlhttprequest]
I also tried /myFolder/login.php
The folder really exists !!! and the php script also !!!

On 23 fév, 19:56, James james.gp@gmail.com wrote:
 What specifically is not working correctly? Maybe the filepath
 'myFolder/login.php' could not be found? Is it not returning anything?
 Use Firebug for Firefox to help debug AJAX issues.

 On Feb 23, 8:36 am,phicarregam...@bluewin.ch wrote:

  This function runs correctly:

  function authentication()
      {
          $('#myForm').ajaxSubmit(
          {
              type:'POST',
              url:'login.php',
              success: function(reponse,status) {  },
              error: function(requete,iderror) {    }
          });
          return false;
       }

  But not this one:

  function authentication()
      {
          $('#myForm').ajaxSubmit(
          {
              type:'POST',
              url:'myFolder/login.php',
              success: function(reponse,status) {  },
              error: function(requete,iderror) {    }
          });
          return false;
       }

  Why ?


[jQuery] Re: jQuery.Form and url

2009-02-24 Thread phicarre

Forgot my question ...
A require path was wrong in my php script !

On 24 fév, 11:38, phicarre gam...@bluewin.ch wrote:
 it returns error [object xmlhttprequest]
 I also tried /myFolder/login.php
 The folder really exists !!! and the php script also !!!

 On 23 fév, 19:56, James james.gp@gmail.com wrote:

  What specifically is not working correctly? Maybe the filepath
  'myFolder/login.php' could not be found? Is it not returning anything?
  Use Firebug for Firefox to help debug AJAX issues.

  On Feb 23, 8:36 am,phicarregam...@bluewin.ch wrote:

   This function runs correctly:

   function authentication()
       {
           $('#myForm').ajaxSubmit(
           {
               type:'POST',
               url:'login.php',
               success: function(reponse,status) {  },
               error: function(requete,iderror) {    }
           });
           return false;
        }

   But not this one:

   function authentication()
       {
           $('#myForm').ajaxSubmit(
           {
               type:'POST',
               url:'myFolder/login.php',
               success: function(reponse,status) {  },
               error: function(requete,iderror) {    }
           });
           return false;
        }

   Why ?


[jQuery] jQuery.Form and url

2009-02-23 Thread phicarre

This function runs correctly:

function authentication()
{
$('#myForm').ajaxSubmit(
{
type:'POST',
url:'login.php',
success: function(reponse,status) {  },
error: function(requete,iderror) {}
});
return false;
 }

But not this one:

function authentication()
{
$('#myForm').ajaxSubmit(
{
type:'POST',
url:'myFolder/login.php',
success: function(reponse,status) {  },
error: function(requete,iderror) {}
});
return false;
 }

Why ?


[jQuery] Re: How to make a secured login form

2009-02-22 Thread phicarre

Strange behaviour:
I followed your example and I received \r\n1 instead of 1 !
My php code begins by ?php, I mean there is no chars before.

Charset problem ? header problem ?

On 13 fév, 20:07, James james.gp@gmail.com wrote:
 Okay, here's a simple way to understand it. Suppose in your login.php,
 if the user login is successful, you have login.php echo '1'. If not,
 echo something else, like '0'.

 This response will become stored in the 'msg' variable in your success
 function in your ajax.

 success: function(msg)
 {
     if (msg == '1') window.location.href = window.location.href;  //
 refresh page
     else alert('You failed');

 },

 On Feb 13, 8:50 am,phicarregam...@bluewin.ch wrote:

  I tried by doing header(Location:welcome.php) but the page is not
  displayed  ???
  The first module is waiting for an answer. This is probably that
  doesn't run ???
  Show me how you did it 

  On 13 fév, 19:45, Ashit Vora a.k.v...@gmail.com wrote:

   Hey, why dont u redirect to Welcome.php page from the page where u r
   authenticating the user.

   eg. suppose you make ajax request to auth.php for validation, If
   validation succeed, redirect to welcome.php (and the ajax request
   which was waiting for response will die) and if failed, write response
   back and it will be received by Ajax function waiting for it.

   I 'm doing this way.

   and also... If you check session on your welcome.php, and only allow
   user to continue if the user is validated else redirect back to login
   page than it doesnt matter even if user gets to know about your
   welcome.php page

   If I understood your problem properly than this should help you.

   Thanks :)

   On Feb 13, 10:30 am,phicarregam...@bluewin.ch wrote:

The question was How to call welcome.php from my jquery script in a
secured manner ? because welcome.php is visible from the client side.

On 13 fév, 13:19, Rene Veerman rene7...@gmail.com wrote:

 Rene Veerman wrote:
             //    $pwh = md5 ($users-rec[user_password_hash] .
  $challenge);

 Ehm, best to use Either sha256 OR md5 for BOTH fields ofcourse ;)
 It was a hasty paste.


[jQuery] Re: the jquery form plugin and the accents !

2009-02-19 Thread phicarre

If I disable JS then I cannot run my application !

Mike Alsup a écrit :
  Could you reming me how to disable JS with FF3 ?
  I will give you a copy of the code later.
 
   Does it work correctly if you submit the form with JS disabled?  Can
   you post a link?


 Preferences | Content | Enable JS


[jQuery] Re: jquery and the accents

2009-02-19 Thread phicarre

typed in : labels, titles, free texts, etc.

On 19 fév, 00:48, James james.gp@gmail.com wrote:
 If you use utf-8 for everything this issue should not occur.
 Where is the source of your text with accents from? A database? Typed
 in?

 On Feb 18, 1:10 pm,phicarregam...@bluewin.ch wrote:

  But if I set my charset to utf-8 then the other texts or labels with
  accents won't be correctly displayed !

  On 18 fév, 19:54, James james.gp@gmail.com wrote:

   I've never had any issues with charset and jquery.
   You should probably set your charset (META) on your page to utf-8.

   On Feb 18, 8:27 am,phicarregam...@bluewin.ch wrote:

[jquery-1.1.3.js]

client-side: I have a form with text field and file field.    +
iso-8859-1
                 transmission by ajax to the server

server-side: I have a var_dump($_POST);

First test
I enter in one text field the string rené : the dump gives rené
Second test
I enter in one text field the string rené and in the file field
logo.gif : the dump gives rené

That means that jquery changes somewhere the charset ? How can I
manage that cleanly ?


[jQuery] Re: the jquery form plugin and the accents !

2009-02-18 Thread phicarre

Really no ideas ?

On 15 fév, 18:10, phicarre gam...@bluewin.ch wrote:
 I have a problem with the jquery form plugin.

 I submit a form (to test.php) in which there are text fields and one
 file field + enctype='multipart/form-data'.
 The html page has a meta which defines the charset to iso 8859-1

 The test.php module begin with header('content-type:text/
 html;charset=iso-8859-1');
 I read the text fields like this: $nom = htmlspecialchars(addslashes
 ($_POST['nom']));
 I read the upload file like this: $tmp_name = $_FILES['photo']
 ['tmp_name'];

 Here is the problem:
 If my text fields contain accents and the file field is empty then
 $name is correct.
 If my text fields contain accents and the file field is NOT empty then
 $name is NOT correct.
  example: René gives Ren?

 I don't understand the impact of the $_FILES on $_POST.
 Does the jquery plugin changes the charset ?


[jQuery] jquery and the accents

2009-02-18 Thread phicarre

[jquery-1.1.3.js]

client-side: I have a form with text field and file field.+
iso-8859-1
 transmission by ajax to the server

server-side: I have a var_dump($_POST);

First test
I enter in one text field the string rené : the dump gives rené
Second test
I enter in one text field the string rené and in the file field
logo.gif : the dump gives rené

That means that jquery changes somewhere the charset ? How can I
manage that cleanly ?


[jQuery] Re: jquery and the accents

2009-02-18 Thread phicarre

But if I set my charset to utf-8 then the other texts or labels with
accents won't be correctly displayed !

On 18 fév, 19:54, James james.gp@gmail.com wrote:
 I've never had any issues with charset and jquery.
 You should probably set your charset (META) on your page to utf-8.

 On Feb 18, 8:27 am,phicarregam...@bluewin.ch wrote:

  [jquery-1.1.3.js]

  client-side: I have a form with text field and file field.    +
  iso-8859-1
                   transmission by ajax to the server

  server-side: I have a var_dump($_POST);

  First test
  I enter in one text field the string rené : the dump gives rené
  Second test
  I enter in one text field the string rené and in the file field
  logo.gif : the dump gives rené

  That means that jquery changes somewhere the charset ? How can I
  manage that cleanly ?


[jQuery] Re: the french accents and jQuery

2009-02-18 Thread phicarre

But the labels will be wrongs !

On 6 fév, 18:21, Giovanni Battista Lenoci gian...@gmail.com wrote:
 phicarre ha scritto: meta http-equiv=content-type content=text/html;
  charset=iso-8859-1 /

 Use always UTF8 for solving problems related on special chars.

 --
 gianiaz.net - web solutions
 via angelo custode, 10 - 23100 sondrio (so) - italy
 +39 347 7196482


[jQuery] Re: the jquery form plugin and the accents !

2009-02-18 Thread phicarre

Could you reming me how to disable JS with FF3 ?
I will give you a copy of the code later.

On 18 fév, 13:55, Mike Alsup mal...@gmail.com wrote:
  I submit a form (to test.php) in which there are text fields and one
  file field + enctype='multipart/form-data'.
  The html page has a meta which defines the charset to iso 8859-1

  The test.php module begin with header('content-type:text/
  html;charset=iso-8859-1');
  I read the text fields like this: $nom = htmlspecialchars(addslashes
  ($_POST['nom']));
  I read the upload file like this: $tmp_name = $_FILES['photo']
  ['tmp_name'];

  Here is the problem:
  If my text fields contain accents and the file field is empty then
  $name is correct.
  If my text fields contain accents and the file field is NOT empty then
  $name is NOT correct.
   example: René gives Ren?

  I don't understand the impact of the $_FILES on $_POST.
  Does the jquery plugin changes the charset ?

 Does it work correctly if you submit the form with JS disabled?  Can
 you post a link?


[jQuery] Re: How to make a secured login form

2009-02-16 Thread phicarre

Do you have a skeleton ?

On 14 fév, 14:59, EugeneS seuge...@gmail.com wrote:
 location.href (simply redirection) is so called web 2.0 ? :)

 web 2.0 is like a google mail where no redirection at all and all the
 content loaded dynamically.

 simplest realization can look like:
 1) you will have one main script lets name it manager.php to this
 script you will send different values, and depending on them our
 manager will include different modules and return HTML which you will
 insert into some div
 2) every module as usually will check if user logged in or not lets
 say depending on session
 2.1) if logged in then show module content etc
 2.2) if not then return lets say login form ...

 this is the basic concept which will work without page refreshing/
 redirecting etc ...

 On Feb 14, 1:07 pm,phicarregam...@bluewin.ch wrote:

  @james: I forgot to answer to your question ... what I want ? web2.0
  style with a solution as you suggested it

  On 14 fév, 12:03,phicarregam...@bluewin.ch wrote:

   OK. I understood now. Thank's

   On 13 fév, 20:07, James james.gp@gmail.com wrote:

Okay, here's a simple way to understand it. Suppose in your login.php,
if the user login is successful, you have login.php echo '1'. If not,
echo something else, like '0'.

This response will become stored in the 'msg' variable in your success
function in your ajax.

success: function(msg)
{
    if (msg == '1') window.location.href = window.location.href;  //
refresh page
    else alert('You failed');

},

On Feb 13, 8:50 am,phicarregam...@bluewin.ch wrote:

 I tried by doing header(Location:welcome.php) but the page is not
 displayed  ???
 The first module is waiting for an answer. This is probably that
 doesn't run ???
 Show me how you did it 

 On 13 fév, 19:45, Ashit Vora a.k.v...@gmail.com wrote:

  Hey, why dont u redirect to Welcome.php page from the page where u r
  authenticating the user.

  eg. suppose you make ajax request to auth.php for validation, If
  validation succeed, redirect to welcome.php (and the ajax request
  which was waiting for response will die) and if failed, write 
  response
  back and it will be received by Ajax function waiting for it.

  I 'm doing this way.

  and also... If you check session on your welcome.php, and only allow
  user to continue if the user is validated else redirect back to 
  login
  page than it doesnt matter even if user gets to know about your
  welcome.php page

  If I understood your problem properly than this should help you.

  Thanks :)

  On Feb 13, 10:30 am,phicarregam...@bluewin.ch wrote:

   The question was How to call welcome.php from my jquery script 
   in a
   secured manner ? because welcome.php is visible from the client 
   side.

   On 13 fév, 13:19, Rene Veerman rene7...@gmail.com wrote:

Rene Veerman wrote:
            //    $pwh = md5 
 ($users-rec[user_password_hash] .
 $challenge);

Ehm, best to use Either sha256 OR md5 for BOTH fields ofcourse 
;)
It was a hasty paste.


[jQuery] the jquery form plugin and the accents !

2009-02-15 Thread phicarre

I have a problem with the jquery form plugin.

I submit a form (to test.php) in which there are text fields and one
file field + enctype='multipart/form-data'.
The html page has a meta which defines the charset to iso 8859-1

The test.php module begin with header('content-type:text/
html;charset=iso-8859-1');
I read the text fields like this: $nom = htmlspecialchars(addslashes
($_POST['nom']));
I read the upload file like this: $tmp_name = $_FILES['photo']
['tmp_name'];

Here is the problem:
If my text fields contain accents and the file field is empty then
$name is correct.
If my text fields contain accents and the file field is NOT empty then
$name is NOT correct.
 example: René gives Ren?

I don't understand the impact of the $_FILES on $_POST.
Does the jquery plugin changes the charset ?




[jQuery] Re: How to make a secured login form

2009-02-14 Thread phicarre

OK. I understood now. Thank's

On 13 fév, 20:07, James james.gp@gmail.com wrote:
 Okay, here's a simple way to understand it. Suppose in your login.php,
 if the user login is successful, you have login.php echo '1'. If not,
 echo something else, like '0'.

 This response will become stored in the 'msg' variable in your success
 function in your ajax.

 success: function(msg)
 {
     if (msg == '1') window.location.href = window.location.href;  //
 refresh page
     else alert('You failed');

 },

 On Feb 13, 8:50 am,phicarregam...@bluewin.ch wrote:

  I tried by doing header(Location:welcome.php) but the page is not
  displayed  ???
  The first module is waiting for an answer. This is probably that
  doesn't run ???
  Show me how you did it 

  On 13 fév, 19:45, Ashit Vora a.k.v...@gmail.com wrote:

   Hey, why dont u redirect to Welcome.php page from the page where u r
   authenticating the user.

   eg. suppose you make ajax request to auth.php for validation, If
   validation succeed, redirect to welcome.php (and the ajax request
   which was waiting for response will die) and if failed, write response
   back and it will be received by Ajax function waiting for it.

   I 'm doing this way.

   and also... If you check session on your welcome.php, and only allow
   user to continue if the user is validated else redirect back to login
   page than it doesnt matter even if user gets to know about your
   welcome.php page

   If I understood your problem properly than this should help you.

   Thanks :)

   On Feb 13, 10:30 am,phicarregam...@bluewin.ch wrote:

The question was How to call welcome.php from my jquery script in a
secured manner ? because welcome.php is visible from the client side.

On 13 fév, 13:19, Rene Veerman rene7...@gmail.com wrote:

 Rene Veerman wrote:
             //    $pwh = md5 ($users-rec[user_password_hash] .
  $challenge);

 Ehm, best to use Either sha256 OR md5 for BOTH fields ofcourse ;)
 It was a hasty paste.


[jQuery] Re: How to make a secured login form

2009-02-14 Thread phicarre

@james: I forgot to answer to your question ... what I want ? web2.0
style with a solution as you suggested it

On 14 fév, 12:03, phicarre gam...@bluewin.ch wrote:
 OK. I understood now. Thank's

 On 13 fév, 20:07, James james.gp@gmail.com wrote:

  Okay, here's a simple way to understand it. Suppose in your login.php,
  if the user login is successful, you have login.php echo '1'. If not,
  echo something else, like '0'.

  This response will become stored in the 'msg' variable in your success
  function in your ajax.

  success: function(msg)
  {
      if (msg == '1') window.location.href = window.location.href;  //
  refresh page
      else alert('You failed');

  },

  On Feb 13, 8:50 am,phicarregam...@bluewin.ch wrote:

   I tried by doing header(Location:welcome.php) but the page is not
   displayed  ???
   The first module is waiting for an answer. This is probably that
   doesn't run ???
   Show me how you did it 

   On 13 fév, 19:45, Ashit Vora a.k.v...@gmail.com wrote:

Hey, why dont u redirect to Welcome.php page from the page where u r
authenticating the user.

eg. suppose you make ajax request to auth.php for validation, If
validation succeed, redirect to welcome.php (and the ajax request
which was waiting for response will die) and if failed, write response
back and it will be received by Ajax function waiting for it.

I 'm doing this way.

and also... If you check session on your welcome.php, and only allow
user to continue if the user is validated else redirect back to login
page than it doesnt matter even if user gets to know about your
welcome.php page

If I understood your problem properly than this should help you.

Thanks :)

On Feb 13, 10:30 am,phicarregam...@bluewin.ch wrote:

 The question was How to call welcome.php from my jquery script in a
 secured manner ? because welcome.php is visible from the client side.

 On 13 fév, 13:19, Rene Veerman rene7...@gmail.com wrote:

  Rene Veerman wrote:
              //    $pwh = md5 ($users-rec[user_password_hash] .
   $challenge);

  Ehm, best to use Either sha256 OR md5 for BOTH fields ofcourse ;)
  It was a hasty paste.


[jQuery] Re: How to make a secured login form

2009-02-13 Thread phicarre

It is a little bit different because with ajax we come back to the
first module:
data introduction - send to server - check - return to first module
- goto welcome
Without ajax/jquery:
data introduction - send to server - check - goto welcome

On 12 fév, 20:09, James james.gp@gmail.com wrote:
 Well... if your module properly checks that the user is logged in then
 there shouldn't really be a problem, provided you're making sessions
 properly and not easy to crack. Other than that, if all the checking
 is done server-side, then your login method is really no different
 whether you're doing it with AJAX or without. You're still going
 through HTTP and sending the same data across. You can make it more
 secure to data-sniffing if you use SSL, but that's a different story.

 On Feb 12, 8:53 am,phicarregam...@bluewin.ch wrote:

  How to secure this jquery+php+ajax login procedure ?

  $('#myform').submit( function()
          {
              $(this).ajaxSubmit( {
                  type:'POST', url:'login.php',
                  success: function(msg)
                  {
                       login ok : how to call the welcome.php ***
                  },
                  error: function(request,iderror)
                  {
                      alert(iderror +   + request);
                  }
              });
              return false;
          })

  form id=myForm action= 

          Name : input type='text' name='login' size='15' /
          divPassword : input type='password' name='passe' size='15' 
  //div

          input type=submit value=login class=submit /

  /form

  Login.php check the parameters and reply by echo ok or echo ko

  Logically if the answer is ok we must call a welcome.php module BUT,
  if someone read the client code, he will see the name of the module
  and can hack the server.
  May I wrong ? how to secure this code ?


[jQuery] Re: How to make a secured login form

2009-02-13 Thread phicarre

The question was How to call welcome.php from my jquery script in a
secured manner ? because welcome.php is visible from the client side.

On 13 fév, 13:19, Rene Veerman rene7...@gmail.com wrote:
 Rene Veerman wrote:
             //    $pwh = md5 ($users-rec[user_password_hash] .
  $challenge);

 Ehm, best to use Either sha256 OR md5 for BOTH fields ofcourse ;)
 It was a hasty paste.


[jQuery] Re: How to make a secured login form

2009-02-13 Thread phicarre

I tried by doing header(Location:welcome.php) but the page is not
displayed  ???
The first module is waiting for an answer. This is probably that
doesn't run ???
Show me how you did it 

On 13 fév, 19:45, Ashit Vora a.k.v...@gmail.com wrote:
 Hey, why dont u redirect to Welcome.php page from the page where u r
 authenticating the user.

 eg. suppose you make ajax request to auth.php for validation, If
 validation succeed, redirect to welcome.php (and the ajax request
 which was waiting for response will die) and if failed, write response
 back and it will be received by Ajax function waiting for it.

 I 'm doing this way.

 and also... If you check session on your welcome.php, and only allow
 user to continue if the user is validated else redirect back to login
 page than it doesnt matter even if user gets to know about your
 welcome.php page

 If I understood your problem properly than this should help you.

 Thanks :)

 On Feb 13, 10:30 am,phicarregam...@bluewin.ch wrote:

  The question was How to call welcome.php from my jquery script in a
  secured manner ? because welcome.php is visible from the client side.

  On 13 fév, 13:19, Rene Veerman rene7...@gmail.com wrote:

   Rene Veerman wrote:
           //    $pwh = md5 ($users-rec[user_password_hash] .
$challenge);

   Ehm, best to use Either sha256 OR md5 for BOTH fields ofcourse ;)
   It was a hasty paste.


[jQuery] How to make a secured login form

2009-02-12 Thread phicarre

How to secure this jquery+php+ajax login procedure ?

$('#myform').submit( function()
{
$(this).ajaxSubmit( {
type:'POST', url:'login.php',
success: function(msg)
{
 login ok : how to call the welcome.php ***
},
error: function(request,iderror)
{
alert(iderror +   + request);
}
});
return false;
})


form id=myForm action= 

Name : input type='text' name='login' size='15' /
divPassword : input type='password' name='passe' size='15' /
/div
input type=submit value=login class=submit /

/form

Login.php check the parameters and reply by echo ok or echo ko

Logically if the answer is ok we must call a welcome.php module BUT,
if someone read the client code, he will see the name of the module
and can hack the server.
May I wrong ? how to secure this code ?


[jQuery] Re: modify from server two jquery elements in the same time

2009-02-10 Thread phicarre

Thank you for your solutions.
Are we obliged to use jason ? Is it possible to stay html ?

On 9 fév, 19:42, Ryan zen...@gmail.com wrote:
 What? Sorry, but this is hard to understand. I believe you're trying
 to set element data from a value in a php file, right? If so, that's
 pretty easy using JSON.

 In PHP, json_encode() converts an array or object into a string, and
 in Javascript it takes that string and converts it to an object. Using
 the json dataType in jQuery.ajax, the success param will be the object
 converted from string to an object. The object keys will be the values
 from the PHP array.

 jQuery:

 $.ajax({
         type: 'POST',
         url: 'ajax.php',
         dataType: 'json',
         success: function(jdata){
                 $('#element1').text(jdata.value1);
                 $('#element2').text(jdata.value2);
         }

 });

 PHP:

 echo json_encode(array('value1' = 'i\'m value 1', 'value2' = 'i\'m
 value 2'));

 On Feb 9, 1:27 pm,phicarregam...@bluewin.ch wrote:

  I would like to modify two jquery elements in the same time from PHP
  module. The PHP module is called by .ajax

  $.ajax(
      {
          type: POST,
          url:'my_module.php',
          dataType: 'html',
           success: function(resultat) { * ? *},
          error: function(requete,iderror) {alert(iderror);}
      })

  }

  div id=field1...
  div id=field2...

  PHP code:

  echo  ***new value for field1  new value for field2 *** 

  How to formulate the success function AND the echo instruction ?


[jQuery] Re: modify from server two jquery elements in the same time

2009-02-10 Thread phicarre

... You supposed that the elements have a text field !
I wrote this:

div id=field1/div
div id=field2/div

On 10 fév, 12:11, phicarre gam...@bluewin.ch wrote:
 Thank you for your solutions.
 Are we obliged to use jason ? Is it possible to stay html ?

 On 9 fév, 19:42, Ryan zen...@gmail.com wrote:

  What? Sorry, but this is hard to understand. I believe you're trying
  to set element data from a value in a php file, right? If so, that's
  pretty easy using JSON.

  In PHP, json_encode() converts an array or object into a string, and
  in Javascript it takes that string and converts it to an object. Using
  the json dataType in jQuery.ajax, the success param will be the object
  converted from string to an object. The object keys will be the values
  from the PHP array.

  jQuery:

  $.ajax({
          type: 'POST',
          url: 'ajax.php',
          dataType: 'json',
          success: function(jdata){
                  $('#element1').text(jdata.value1);
                  $('#element2').text(jdata.value2);
          }

  });

  PHP:

  echo json_encode(array('value1' = 'i\'m value 1', 'value2' = 'i\'m
  value 2'));

  On Feb 9, 1:27 pm,phicarregam...@bluewin.ch wrote:

   I would like to modify two jquery elements in the same time from PHP
   module. The PHP module is called by .ajax

   $.ajax(
       {
           type: POST,
           url:'my_module.php',
           dataType: 'html',
            success: function(resultat) { * ? *},
           error: function(requete,iderror) {alert(iderror);}
       })

   }

   div id=field1...
   div id=field2...

   PHP code:

   echo  ***new value for field1  new value for field2 *** 

   How to formulate the success function AND the echo instruction ?


[jQuery] Re: file upload field and standard fields

2009-02-10 Thread phicarre

The solution: to put a delay before to close the dialog.

On 2 fév, 14:11, phicarre gam...@bluewin.ch wrote:
 ... and $_POST is empty when $_FILES is full !!!

 On 2 fév, 14:07,phicarregam...@bluewin.ch wrote:

  Yes I know ! read the first message for the problem !!
  $_FILES is always empty when $_POST is full

  On 2 fév, 13:14, jQuery Lover ilovejqu...@gmail.com wrote:

   Well, it seems you are getting your 'nom' and 'phenom' text fields...
   and yes, domb is right, file information data is stored in $_FILES
   array...

   
   Read jQuery HowTo Resource  -  http://jquery-howto.blogspot.com

   On Mon, Feb 2, 2009 at 3:35 PM,phicarregam...@bluewin.ch wrote:

No explanation ;-(

On 30 jan, 17:10,phicarregam...@bluewin.ch wrote:
I replace my code by this one:
?
echo VAR DUMP:p /;
  var_dump($_POST);
?

and the result is:

VAR DUMP:p /array(3) {
  [nom]=
  string(0) 
  [prenom]=
  string(0) 
  [MAX_FILE_SIZE]=
  string(6) 10}

File: 2.gif (6160 bytes)VAR DUMP:p /array(3) {
  [nom]=
  string(0) 
  [prenom]=
  string(0) 
  [MAX_FILE_SIZE]=
  string(6) 10}

File: 2.gif (6160 bytes)VAR DUMP:p /array(3) {
  [nom]=
  string(0) 
  [prenom]=
  string(0) 
  [MAX_FILE_SIZE]=
  string(6) 10}

File: 2.gif (6160 bytes)

On 30 jan, 01:34, l...@onsight.ie wrote:

 Might just be a typo, but just in case - it should be $_POST

  What does the error field say? And I'm pretty sure that 
  MAX_FILE_SIZE
  must come immediately before your file input element.

  Also, are you sure the file is within your upload limit?

  On Thu, Jan 29, 2009 at 1:01 PM,phicarregam...@bluewin.ch wrote:

  jquery.form.js v2.18

  I have a form with a lot of fields and one upload file field:

  form action='' id='form1' enctype='multipart/form-data' 
  style='font-
  size:85%'
     input type=hidden name=MAX_FILE_SIZE value=10 /

     table 
         trtdNom: /tdtdinput type='text' size='30' id='nom'
  name='nom' //td/tr
         trtdPrénom: /tdtdinput type=text size=30
  id=prenom name=prenom //td/tr
         trtdPhoto: /tdtdinput type=file size=40
  id=photo name=photo //td/tr
     /table
  /form
  /div

  $('#form1').ajaxSubmit(
     {
         type: 'POST',
         url: 'create.php',
         beforeSubmit: showRequest ,
         success: function(msg) {},
         error: function(requete,iderror) {alert(iderror);}
     }
     );

  In create.php, the $_FILES is correct  (name,size,type,tmp 
  name,error)
  BUT the $POST is empty !
  Why ?


[jQuery] modify from server two jquery elements in the same time

2009-02-09 Thread phicarre

I would like to modify two jquery elements in the same time from PHP
module. The PHP module is called by .ajax

$.ajax(
{
type: POST,
url:'my_module.php',
dataType: 'html',
 success: function(resultat) { * ? *},
error: function(requete,iderror) {alert(iderror);}
})
}

div id=field1...
div id=field2...

PHP code:

echo  ***new value for field1  new value for field2 *** 

How to formulate the success function AND the echo instruction ?


[jQuery] the french accents and jQuery

2009-02-06 Thread phicarre

This is the sketeton of my HTMP page:

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;
html xmlns=http://www.w3.org/1999/xhtml; xmlns:v=urn:schemas-
microsoft-com:vml lang=fr xml:lang=fr
head
...
meta http-equiv=content-type content=text/html;
charset=iso-8859-1 /
...
script src=jquery/jquery-1.3.1.js type=text/javascript/script
script type=text/javascript src=jquery/jquery-ui-
personalized-1.6rc6.js/script
script src=jquery/jquery.form.js type=text/javascript/script
...

$('#form1').ajaxSubmit(
{
type: 'POST',
url: 'test.php',
beforeSubmit: function(f,j,o) {

var queryString = $.param(f);
alert('About to submit: \n\n' + queryString);
},
success: function(msg) {
alert(msg);
},
error: function(requete,iderror) {
alert(iderror +   + requete);
}
});

return false;
}



form enctype='multipart/form-data' action='' id='form1' 
table 
trtdNom: /tdtdinput type='text' size='30' id='nom'
name='nom' //td/tr
trtdPrénom: /tdtdinput type=text size=30
id=prenom name=prenom //td/tr
trtdPhoto: /tdtdinput type=file size=40
id=photo name=photo //td/tr
/table
/form

If I enter a name with french accents then the queryString display
wrong chars.
How to pass correct strings to my test.php module ?


[jQuery] Re: Form Plugin with file upload

2009-02-02 Thread phicarre

If I resume the situation :

text fields file field $_POST
$_FILES Remark
--
filledfilled  empty
filled  abnormal
- filled  empty
filled   normal
filled-   filled
empty normal
- -   empty
empty  normal


On 30 jan, 19:06, phicarre gam...@bluewin.ch wrote:
 Hi Mike,

 This thread seems to be similar to my problem submitted by email
 (subjet: about url) 

 On 30 jan, 18:37, Mike Alsup mal...@gmail.com wrote:

   No, you are not supposed to do anything at all with the iframe.  The
   plugin handles all of that for you.  I'll try to take a look at your
   page tomorrow.

  Well, I have to admit that I'm not sure why your page isn't working.
  However, I did create a very simple test case here:

 http://jquery.malsup.com/form/file-test3.html

  This page has a file input and a text input and the form is submitted
  to

 http://jquery.malsup.com/form/test-xml.php

  which you can see returns the exact same response as your server (I
  think).

  Could you create a simple test case like this and run it on your
  server?

  Mike


[jQuery] Re: file upload field and standard fields

2009-02-02 Thread phicarre

... and $_POST is empty when $_FILES is full !!!

On 2 fév, 14:07, phicarre gam...@bluewin.ch wrote:
 Yes I know ! read the first message for the problem !!
 $_FILES is always empty when $_POST is full

 On 2 fév, 13:14, jQuery Lover ilovejqu...@gmail.com wrote:

  Well, it seems you are getting your 'nom' and 'phenom' text fields...
  and yes, domb is right, file information data is stored in $_FILES
  array...

  
  Read jQuery HowTo Resource  -  http://jquery-howto.blogspot.com

  On Mon, Feb 2, 2009 at 3:35 PM, phicarre gam...@bluewin.ch wrote:

   No explanation ;-(

   On 30 jan, 17:10, phicarre gam...@bluewin.ch wrote:
   I replace my code by this one:
   ?
   echo VAR DUMP:p /;
     var_dump($_POST);
   ?

   and the result is:

   VAR DUMP:p /array(3) {
     [nom]=
     string(0) 
     [prenom]=
     string(0) 
     [MAX_FILE_SIZE]=
     string(6) 10}

   File: 2.gif (6160 bytes)VAR DUMP:p /array(3) {
     [nom]=
     string(0) 
     [prenom]=
     string(0) 
     [MAX_FILE_SIZE]=
     string(6) 10}

   File: 2.gif (6160 bytes)VAR DUMP:p /array(3) {
     [nom]=
     string(0) 
     [prenom]=
     string(0) 
     [MAX_FILE_SIZE]=
     string(6) 10}

   File: 2.gif (6160 bytes)

   On 30 jan, 01:34, l...@onsight.ie wrote:

Might just be a typo, but just in case - it should be $_POST

 What does the error field say? And I'm pretty sure that MAX_FILE_SIZE
 must come immediately before your file input element.

 Also, are you sure the file is within your upload limit?

 On Thu, Jan 29, 2009 at 1:01 PM,phicarregam...@bluewin.ch wrote:

 jquery.form.js v2.18

 I have a form with a lot of fields and one upload file field:

 form action='' id='form1' enctype='multipart/form-data' 
 style='font-
 size:85%'
    input type=hidden name=MAX_FILE_SIZE value=10 /

    table 
        trtdNom: /tdtdinput type='text' size='30' id='nom'
 name='nom' //td/tr
        trtdPrénom: /tdtdinput type=text size=30
 id=prenom name=prenom //td/tr
        trtdPhoto: /tdtdinput type=file size=40
 id=photo name=photo //td/tr
    /table
 /form
 /div

 $('#form1').ajaxSubmit(
    {
        type: 'POST',
        url: 'create.php',
        beforeSubmit: showRequest ,
        success: function(msg) {},
        error: function(requete,iderror) {alert(iderror);}
    }
    );

 In create.php, the $_FILES is correct  (name,size,type,tmp 
 name,error)
 BUT the $POST is empty !
 Why ?


[jQuery] Re: file upload field and standard fields

2009-02-02 Thread phicarre

Yes I know ! read the first message for the problem !!
$_FILES is always empty when $_POST is full

On 2 fév, 13:14, jQuery Lover ilovejqu...@gmail.com wrote:
 Well, it seems you are getting your 'nom' and 'phenom' text fields...
 and yes, domb is right, file information data is stored in $_FILES
 array...

 
 Read jQuery HowTo Resource  -  http://jquery-howto.blogspot.com

 On Mon, Feb 2, 2009 at 3:35 PM, phicarre gam...@bluewin.ch wrote:

  No explanation ;-(

  On 30 jan, 17:10, phicarre gam...@bluewin.ch wrote:
  I replace my code by this one:
  ?
  echo VAR DUMP:p /;
    var_dump($_POST);
  ?

  and the result is:

  VAR DUMP:p /array(3) {
    [nom]=
    string(0) 
    [prenom]=
    string(0) 
    [MAX_FILE_SIZE]=
    string(6) 10}

  File: 2.gif (6160 bytes)VAR DUMP:p /array(3) {
    [nom]=
    string(0) 
    [prenom]=
    string(0) 
    [MAX_FILE_SIZE]=
    string(6) 10}

  File: 2.gif (6160 bytes)VAR DUMP:p /array(3) {
    [nom]=
    string(0) 
    [prenom]=
    string(0) 
    [MAX_FILE_SIZE]=
    string(6) 10}

  File: 2.gif (6160 bytes)

  On 30 jan, 01:34, l...@onsight.ie wrote:

   Might just be a typo, but just in case - it should be $_POST

What does the error field say? And I'm pretty sure that MAX_FILE_SIZE
must come immediately before your file input element.

Also, are you sure the file is within your upload limit?

On Thu, Jan 29, 2009 at 1:01 PM,phicarregam...@bluewin.ch wrote:

jquery.form.js v2.18

I have a form with a lot of fields and one upload file field:

form action='' id='form1' enctype='multipart/form-data' style='font-
size:85%'
   input type=hidden name=MAX_FILE_SIZE value=10 /

   table 
       trtdNom: /tdtdinput type='text' size='30' id='nom'
name='nom' //td/tr
       trtdPrénom: /tdtdinput type=text size=30
id=prenom name=prenom //td/tr
       trtdPhoto: /tdtdinput type=file size=40
id=photo name=photo //td/tr
   /table
/form
/div

$('#form1').ajaxSubmit(
   {
       type: 'POST',
       url: 'create.php',
       beforeSubmit: showRequest ,
       success: function(msg) {},
       error: function(requete,iderror) {alert(iderror);}
   }
   );

In create.php, the $_FILES is correct  (name,size,type,tmp name,error)
BUT the $POST is empty !
Why ?


[jQuery] Re: file upload field and standard fields

2009-02-02 Thread phicarre

No explanation ;-(

On 30 jan, 17:10, phicarre gam...@bluewin.ch wrote:
 I replace my code by this one:
 ?
 echo VAR DUMP:p /;
   var_dump($_POST);
 ?

 and the result is:

 VAR DUMP:p /array(3) {
   [nom]=
   string(0) 
   [prenom]=
   string(0) 
   [MAX_FILE_SIZE]=
   string(6) 10}

 File: 2.gif (6160 bytes)VAR DUMP:p /array(3) {
   [nom]=
   string(0) 
   [prenom]=
   string(0) 
   [MAX_FILE_SIZE]=
   string(6) 10}

 File: 2.gif (6160 bytes)VAR DUMP:p /array(3) {
   [nom]=
   string(0) 
   [prenom]=
   string(0) 
   [MAX_FILE_SIZE]=
   string(6) 10}

 File: 2.gif (6160 bytes)

 On 30 jan, 01:34, l...@onsight.ie wrote:

  Might just be a typo, but just in case - it should be $_POST

   What does the error field say? And I'm pretty sure that MAX_FILE_SIZE
   must come immediately before your file input element.

   Also, are you sure the file is within your upload limit?

   On Thu, Jan 29, 2009 at 1:01 PM,phicarregam...@bluewin.ch wrote:

   jquery.form.js v2.18

   I have a form with a lot of fields and one upload file field:

   form action='' id='form1' enctype='multipart/form-data' style='font-
   size:85%'
      input type=hidden name=MAX_FILE_SIZE value=10 /

      table 
          trtdNom: /tdtdinput type='text' size='30' id='nom'
   name='nom' //td/tr
          trtdPrénom: /tdtdinput type=text size=30
   id=prenom name=prenom //td/tr
          trtdPhoto: /tdtdinput type=file size=40
   id=photo name=photo //td/tr
      /table
   /form
   /div

   $('#form1').ajaxSubmit(
      {
          type: 'POST',
          url: 'create.php',
          beforeSubmit: showRequest ,
          success: function(msg) {},
          error: function(requete,iderror) {alert(iderror);}
      }
      );

   In create.php, the $_FILES is correct  (name,size,type,tmp name,error)
   BUT the $POST is empty !
   Why ?


[jQuery] Re: Problems understanding jQueryUI and Dialogs

2009-02-01 Thread phicarre

Hide it with autoOpen:false, style=display: none is unnecessary
Think jQuery, not Javascript !

On 1 fév, 16:56, Raymond  Camden rcam...@gmail.com wrote:
 Ok, I'm probably missing the obvious here, but I'm having a very
 difficult time understanding how to use a jQuery UI dialog with a
 simple theme.

 First off, I began with the following code:

 html

 head
 script src=js/jquery.js/script
 script src=js/ui/ui.core.js/script
 script src=js/ui/ui.dialog.js/script
 script
 function showDialog(){
         $(#example).dialog();
         return false;}

 /script
 /head

 body

 p
 a href= onclick=return showDialog()Show the Dialog/a
 /p

 div id=example class=flora title=This is my titleI'm in a
 dialog!/div

 /body
 /html

 This is a small modification of the code here:http://docs.jquery.com/UI/Dialog
 All I changed was switching from the document ready code to showDialog
 so I could manually load the dialog. This works, but the dialog is
 visible on page load. I would have assumed that would be something the
 basic docs would cover. I had to dig a bit and finally found that I
 would just hide it with CSS:

 div style=display: none; id=example class=flora title=This is
 my titleI'm in a dialog!/div

 Ok, so no big deal, but why didn't the basic demo mention this? I'm
 still a bit rough w/ CSS so if I had not found this on some other
 demo, I would have been out of luck.

 Anyway, at this point it works, but it has no skin at all. I went on
 to the dialog theming page (http://docs.jquery.com/UI/Dialog/Theming),
 and it showed this example:

 div class=ui-dialog ui-widget ui-widget-content ui-corner-all
 undefined ui-draggable ui-resizable
    div class=ui-dialog-titlebar ui-widget-header ui-corner-all ui-
 helper-clearfix
       span id=ui-dialog-title-dialog class=ui-dialog-titleDialog
 title/span
       a class=ui-dialog-titlebar-close ui-corner-all href=#span
 class=ui-icon ui-icon-closethickclose/span/a
    /div
    div style=height: 200px; min-height: 109px; width: auto;
 class=ui-dialog-content ui-widget-content id=dialog
       pDialog content goes here./p
    /div
 /div

 So I replaced my div with that code. Right away I see that the dialog
 is no longer hidden. Ok, no big deal, I can fix that later I assume.
 There is no ID on the div though so I have no way of showing it.

 I added id=example to the top level div:

 div class=ui-dialog ui-widget ui-widget-content ui-corner-all
 undefined ui-draggable ui-resizable id=example

 Now when I click on the link to show the dialog, it does pop the
 dialog up, but with multiple title bars. Well, one title, but 2 Xs.
 Almost like jquery re-wrapped the div. There is a thick white border
 around the item.

 I'm pretty frustrated. I've looked around at the demos and docs, but I
 can't seem to find a very simple _minimal_ example. Any help please?


[jQuery] Re: [jquery.form.js v2.18] file upload field and standard fields

2009-01-30 Thread phicarre

I replace my code by this one:
?
echo VAR DUMP:p /;
  var_dump($_POST);
?

and the result is:

VAR DUMP:p /array(3) {
  [nom]=
  string(0) 
  [prenom]=
  string(0) 
  [MAX_FILE_SIZE]=
  string(6) 10
}
File: 2.gif (6160 bytes)VAR DUMP:p /array(3) {
  [nom]=
  string(0) 
  [prenom]=
  string(0) 
  [MAX_FILE_SIZE]=
  string(6) 10
}
File: 2.gif (6160 bytes)VAR DUMP:p /array(3) {
  [nom]=
  string(0) 
  [prenom]=
  string(0) 
  [MAX_FILE_SIZE]=
  string(6) 10
}
File: 2.gif (6160 bytes)

On 30 jan, 01:34, l...@onsight.ie wrote:
 Might just be a typo, but just in case - it should be $_POST



  What does the error field say? And I'm pretty sure that MAX_FILE_SIZE
  must come immediately before your file input element.

  Also, are you sure the file is within your upload limit?

  On Thu, Jan 29, 2009 at 1:01 PM,phicarregam...@bluewin.ch wrote:

  jquery.form.js v2.18

  I have a form with a lot of fields and one upload file field:

  form action='' id='form1' enctype='multipart/form-data' style='font-
  size:85%'
     input type=hidden name=MAX_FILE_SIZE value=10 /

     table 
         trtdNom: /tdtdinput type='text' size='30' id='nom'
  name='nom' //td/tr
         trtdPrénom: /tdtdinput type=text size=30
  id=prenom name=prenom //td/tr
         trtdPhoto: /tdtdinput type=file size=40
  id=photo name=photo //td/tr
     /table
  /form
  /div

  $('#form1').ajaxSubmit(
     {
         type: 'POST',
         url: 'create.php',
         beforeSubmit: showRequest ,
         success: function(msg) {},
         error: function(requete,iderror) {alert(iderror);}
     }
     );

  In create.php, the $_FILES is correct  (name,size,type,tmp name,error)
  BUT the $POST is empty !
  Why ?


[jQuery] Re: Form Plugin with file upload

2009-01-30 Thread phicarre

Hi Mike,

This thread seems to be similar to my problem submitted by email
(subjet: about url) 

On 30 jan, 18:37, Mike Alsup mal...@gmail.com wrote:
  No, you are not supposed to do anything at all with the iframe.  The
  plugin handles all of that for you.  I'll try to take a look at your
  page tomorrow.

 Well, I have to admit that I'm not sure why your page isn't working.
 However, I did create a very simple test case here:

 http://jquery.malsup.com/form/file-test3.html

 This page has a file input and a text input and the form is submitted
 to

 http://jquery.malsup.com/form/test-xml.php

 which you can see returns the exact same response as your server (I
 think).

 Could you create a simple test case like this and run it on your
 server?

 Mike


[jQuery] [jquery.form.js v2.18] file upload field and standard fields

2009-01-29 Thread phicarre

jquery.form.js v2.18

I have a form with a lot of fields and one upload file field:

form action='' id='form1' enctype='multipart/form-data' style='font-
size:85%'
input type=hidden name=MAX_FILE_SIZE value=10 /

table 
trtdNom: /tdtdinput type='text' size='30' id='nom'
name='nom' //td/tr
trtdPrénom: /tdtdinput type=text size=30
id=prenom name=prenom //td/tr
trtdPhoto: /tdtdinput type=file size=40
id=photo name=photo //td/tr
/table
/form
/div

$('#form1').ajaxSubmit(
{
type: 'POST',
url: 'create.php',
beforeSubmit: showRequest ,
success: function(msg) {},
error: function(requete,iderror) {alert(iderror);}
}
);

In create.php, the $_FILES is correct  (name,size,type,tmp name,error)
BUT the $POST is empty !
Why ?


[jQuery] Re: [jquery.form.js v2.18] file upload field and standard fields

2009-01-29 Thread phicarre

- error field gives nothing
- i moved max_file_size just before but nothing
- i selected small images

the question is, with jquery and ajax, is it possible to have in the
same form text fields and files field !
with javascript the answer is yes but with this plugin ?


On 30 jan, 00:45, brian bally.z...@gmail.com wrote:
 What does the error field say? And I'm pretty sure that MAX_FILE_SIZE
 must come immediately before your file input element.

 Also, are you sure the file is within your upload limit?

 On Thu, Jan 29, 2009 at 1:01 PM, phicarre gam...@bluewin.ch wrote:

  jquery.form.js v2.18

  I have a form with a lot of fields and one upload file field:

  form action='' id='form1' enctype='multipart/form-data' style='font-
  size:85%'
     input type=hidden name=MAX_FILE_SIZE value=10 /

     table 
         trtdNom: /tdtdinput type='text' size='30' id='nom'
  name='nom' //td/tr
         trtdPrénom: /tdtdinput type=text size=30
  id=prenom name=prenom //td/tr
         trtdPhoto: /tdtdinput type=file size=40
  id=photo name=photo //td/tr
     /table
  /form
  /div

  $('#form1').ajaxSubmit(
     {
         type: 'POST',
         url: 'create.php',
         beforeSubmit: showRequest ,
         success: function(msg) {},
         error: function(requete,iderror) {alert(iderror);}
     }
     );

  In create.php, the $_FILES is correct  (name,size,type,tmp name,error)
  BUT the $POST is empty !
  Why ?


[jQuery] [jquery.form] How to structure url parameter ?

2009-01-27 Thread phicarre

jquery.form.js v2.18

How to structure the url parameter in order to use a function
localized in a php file ?

include ('myPHP_file.php');

$('#form1').ajaxSubmit(
{target:'#output',
type: 'post',
url:'myFunction',
success: showResponse
});

myPHP_file.php:
?
function myFunction()
{
...
}
?
This gives an 404 error