0Day Forums
Need Help: PHP Not redirecting - Printable Version

+- 0Day Forums (https://0day.red)
+-- Forum: Coding (https://0day.red/Forum-Coding)
+--- Forum: PHP (https://0day.red/Forum-PHP)
+--- Thread: Need Help: PHP Not redirecting (/Thread-Need-Help-PHP-Not-redirecting)



Need Help: PHP Not redirecting - Proyellower888 - 08-28-2017

I was using mysqli in the past and i decided to go and switch everything to PDO on this go around and im having a problem with my header("Location: profile.php"); not redirecting.

root/include/dbc.php
Hidden Content

root/profile.php
Hidden Content

my dbc.php is included into my index.php file where the forms are located any help would be appreciated .. thanks


RE: Need Help: PHP Not redirecting - versate835795 - 08-28-2017

Attempt
Hidden Content
And are you sure everything else runs. I'm on my phone right now. But if the problem still is happening tomorrow I'll poker deeper into it.


RE: Need Help: PHP Not redirecting - hightension270 - 08-28-2017

Quote:(08-28-2017, 06:46 AM)Mystique Wrote:

[To see links please register here]

Attempt
Hidden Content
And are you sure everything else runs. I'm on my phone right now. But if the problem still is happening tomorrow I'll poker deeper into it.


Yeah, I placed a error message in place of header to make sure and it echoes out every time and I var dump sessions in its place works out perfectly every time it’s just like it is ignoring header. I can echo out on either side and display it on the index.php. Thanks for the reply and willingness to help.


RE: Need Help: PHP Not redirecting - diffusor896754 - 08-28-2017

As per the HTTP RFC specification, the Location header won't work if any other data has already been sent. This includes other headers, response content (which sets headers automatically), and (afaik) session tokens, so you may need to figure out a different method of data flow.


RE: Need Help: PHP Not redirecting - warthogs698555 - 09-02-2017

The second validation, if the fetched data and the Post Data are equal is very nice, but i hope that you are escaping SQL-interpretable Signs in the Form Data, because with enough motivation and some Ideas, it is possible to overwrite the User Data.
And without escaping your Query is vulnerable to injection, even with pdo Prepared Statements
// POST DATA
// gamertag=' or 'a'='a'#--'
//gamertag='test' or 'a'='a