PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hello all! This is my first post here. Let me also note that I'm very new to PHP but want to learn more because of it's integration with Flash. Anyways, on to my question.
So I'm building a login for my website with Flash. In my sql database I have a table with username, password, and most importantly, for this question, page. This value I'm hoping will allow the user to login and be redirected to this predefined page on my site. So for test purposes my value for "page" on the database is "admin.php."
Here is the portion of my code that redirects:
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Last edited by jamiller on Mon Mar 12, 2007 12:50 pm, edited 2 times in total.
You are going to have to show more code. Specifically where $page is set. Also, stay away from session_register. You should be using the $_SESSION superglobal array to assign session vars.
Everah wrote:You are going to have to show more code. Specifically where $page is set. Also, stay away from session_register. You should be using the $_SESSION superglobal array to assign session vars.
But show some more code.
Ok, I edited the post to show all the code. And thanks for the $_SESSION comment. Will do.
volka wrote:This scripts looks very much like the one in viewtopic.php?t=64851 . Coincidence?
lol. I got this code from a php login tutorial. It appears to be the exact same tutorial except he has changed the session to $_SESSION, which I have not yet done, but will.
volka wrote:In any case this tutorial is outdated and does not care about sql injections.
I suggest looking somewhere else when looking for a tutorial.
Ok. Like I said, I'm very new to PHP. I'm a designer by trade, not a programmer. Got any good links for good tutorials. All PHP looks the same to me at this point. I do want to learn PHP and learn it the right way but I just don't have anything to go on.
As per HTTP spec, the redirect header should always be a full URI, as feyd mentioned earlier.
I'm guessing this is a lost cause. I've done what you said with the full url and still no luck. I just can't figure out how the echo is returning the correct values but my redirect isn't working.