93

I am working on another developer's PHP code, and I found a new way that he done the redirect after the login with PHP!

Comments
  • 0
    😂
  • 8
    Sure everyone has done silly stuff like that when learning.
  • 21
    when a front end developer just goes for it lol
  • 27
    Needs more jQuery 😂😂
  • 11
    also setting true as a string
  • 10
    I'd guess the headers are already sent and he can't redirect with header()
  • 2
    This is gold, Haha :)
  • 6
    Also, language="javascript"?
  • 4
    @juzles ob_start would handle that
  • 2
    This makes me smile 😂
  • 1
    there there!
  • 2
    I'd do some React, redux, components states, babel, es6 and what not.
  • 1
    @sgorneau I didn't say he is right just tried to guess why he would do that ☺
  • 2
    well .. i'm still a newbie to the backend development ... and I still use similar code ... what's so weird about it btw??
  • 7
    @Jovial PHP generated a javascript snippet for redirect, when PHP is already able to perform redirect alome.
    The problem is that if a user has javascript disabled, he or she will see only a blank page
  • 1
    Ohh sorry.. I missed the point ... I thought their b something wrong with the "Logged In" conditions 😂 ... Thanks @crisz
  • 2
    better JavaScript than PHP, lol
  • 5
    That's not how it works. That's not how any of this works.
  • 4
    Guess I'm not the worst developer after all :)
  • 1
    He is legend , he silly mistakes brought smile on others face ✌
    Be like him
    be a silly developer 😂
  • 1
    @huszerldani where are you man?
  • 0
    This has made me feel better about myself :)
  • 0
    You cant use Header(Loaction: ); when you already have printed stuff to the Frontend.

    Thus this method is usable. Shouldve added an "If your browser doesnt redirect you click here"
  • 0
    "another developer" - are you sure it is not you 6 months ago when your boss is breathing down in your neck?
  • 0
    But why?
  • 0
    I also found that shitty redirection method on one of codecanyon php script that I've tested lol.
  • 0
    @Jovial you are basically telling php to render and use excess resource before redirecting and also this will be a problem if js is turned off lol
  • 0
    guilty
  • 1
    @palonE yes you can, ob_start()
  • 0
Add Comment