Programming Thread

Started by the-pi-guy, Mar 13, 2016, 10:39 PM

previous topic - next topic

0 Members and 2 Guests are viewing this topic.

Go Down

Legend

Ugh.
Now I don't get that error anymore.  I'm not even sure why. Rolled back the code, still don't get that error anymore.  

Instead I have another problem now

The verifyid token isn't returning anything.

I'm trying to use a hardcoded value, and a passed in value.  PHP says they're the same, but for some reason, it works with the hard coded value, but not the passed in value.  



Like within php it returns true with ===?

Programming is supposed to be logical! That does not make sense lol.

the-pi-guy

Like within php it returns true with ===?

Programming is supposed to be logical! That does not make sense lol.

Yes. That is what it does.   :-\

None of this makes any sense.

the-pi-guy

My leading theory right now (and I don't think it's even a good one), is that there is some formatting issue with the input string.

The two strings have the same contents, but perhaps with different encoding, so === says they're the same because they have the same content, but Google's verify method ends up doing some kind of special hashing or other function that makes a difference.  

My secondary theory is that there is some weird pass by value/pass by reference business going on.  But it seems PHP passes by value, unless you specify it to do otherwise.

the-pi-guy


Legend

@Legend

Any ideas?
Have you tried doing funky things like producing a third string as a mix of the two?

$frankenString=$hardCodedUrl;

$frankenString[3]=$otherUrl[3];


//send off frankenstring


Could see if it works for any swapped character.

Also just double checking, have you been using == not ===? Maybe the user entered string isn't a string.

the-pi-guy

Have you tried doing funky things like producing a third string as a mix of the two?

$frankenString=$hardCodedUrl;

$frankenString[3]=$otherUrl[3];


//send off frankenstring


Could see if it works for any swapped character.

Also just double checking, have you been using == not ===? Maybe the user entered string isn't a string.
I used both == and ===.

The latter evaluates as true, the former returns a 1.

Legend

I used both == and ===.

The latter evaluates as true, the former returns a 1.
Have you tried restarting your computer?

At this point there are pretty much only three options. Php itself is broken on your machine, some other thing on your computer is causing this, you found a glitch in the matrix.

darkknightkryta

I need to get my dog in gear.  I want to make a course website, but where it works out like an RPG.

the-pi-guy

Have you tried restarting your computer?

At this point there are pretty much only three options. Php itself is broken on your machine, some other thing on your computer is causing this, you found a glitch in the matrix.

Guess tomorrow's plan is to reinstall php.  :(

Or maybe set up an ide finally.  

the-pi-guy

May 25, 2020, 04:01 PM Last Edit: May 25, 2020, 04:08 PM by the-pi-guy
I don't use this kind of language often. 


But what the fudge. 


I thought I tried a try catch before this.  I must not have.

I was hoping there'd be some error code that would be caught, instead it works perfectly.  The function now works perfectly with the passed in data.  It doesn't catch any error, it just tries and succeeds. 

I'm literally shaking. I'm not sure if I'm happy or pissed right now.

Google sign in now works front end and back end.

Legend

I don't use this kind of language often.  


But what the fudge.  


I thought I tried a try catch before this.  I must not have.

I was hoping there'd be some error code that would be caught, instead it works perfectly.  The function now works perfectly with the passed in data.  It doesn't catch any error, it just tries and succeeds.  

I'm literally shaking. I'm not sure if I'm happy or pissed right now.

Google sign in now works front end and back end.
Well it works at least!

the-pi-guy

Well it works at least!
But why!?

I am feeling this on a spiritual level right now:


the-pi-guy

On to Facebook's sign in, which is very different.  

Google's sign in, sends you a key, and then you have to authenticate the key to get the information that's needed.
Facebook's sign in sends you the information that's needed, but then they seem to save your sign in session.

So Facebook's is easier to sign in, harder to sign out.

the-pi-guy

My website feels lame.  I really only made like 5 webpages.  
My website isn't actually very lame.  

Some of the other capstone projects are really small.  

One is a flashcard app.  

darkknightkryta

Oh god, I remember having to program Facebook login into apps.  It was a pain in the dog.  We decided to use an all one one solution.  This was 6 years ago, so I don't know what it's like now.

Go Up