Ok, will do your suggestion,
but to clarify how I am working on php side, I send the ip my php
check if the ip exists in the database table banned if it is there,
then the code returns 1 , and nothing for not match..
so if the response from request.getContent i get a 1 then result != ""
and run the inside code of if and return 0; if it has nothing then
goes to the else and return all the other code...
Let me know if I am totally wrong since my expertise its almost null.

On Jan 23, 1:37 pm, Erick Romero <err...@gmail.com> wrote:
> Try
>
> request.getContent(function(result){
>
>         Ape.log('Result: "' + result + '"');
>
>         if(result == 0){
>                 Ape.log('- Gandalf: You will not past..");
>                 cmd.sendResponse('ERR', {'code': 1001, 'value':'User 
> BANNED'});
>                 return 0;
>         }
>         else {
>                 Ape.log('- Frodo: Run away!!");
>                 cmd.user.setProperty('name', params.name);
>                 cmd.user.setProperty('ip', cmd.ip);
>                 return 1;
>         }
>
> }).bind(this);
>
> Modify your PHP file to output manually the result and make two test:
>
> First
> <?php echo '0' ?>
>
> Second
> <?php echo '1' ?>
>
> And let me know what your are getting in your APE log for each test.
>
> Note:
> I don't know if you are missing the point, but in your function copied
> below you are including
>
> if(result != ""){
>
> that means that php is sending something, so in good theory the
> if-inside  logic should allow to past instead of send the sendResponse error
>
> On 01/23/2012 03:12 PM, utan wrote:
>
>
>
>
>
>
>
> > Erick
>
> > I have it just like you suggested and still let me go all the way..
>
> > request.getContent(function(result){
> >    if(result != ""){
> >            Ape.log(result);
> >            cmd.sendResponse('ERR', {'code': 1001, 'value':'User BANNED'});
> >                    return 0;
> >                    }else{
> >            cmd.user.setProperty('name', params.name);
> >            cmd.user.setProperty('ip', cmd.ip);
>
> >            return 1;
> >                    }
> >    }).bind(this);
> > the only differences there is , is that your have a more recent build
> > than me, I think I have 111 or something along those lines..
> > I am frustrated..

-- 
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to ape-project@googlegroups.com
To unsubscribe from this group, send email to
ape-project+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/ape-project?hl=en
---
APE Project (Ajax Push Engine)
Official website : http://www.ape-project.org/
Git Hub : http://github.com/APE-Project/

Reply via email to