so thank you to everyone who help this was a great learning experiance.
here is the final output for the php and what needs to be done.
you need the exit in there because other wise it stutter steps the refresh. and you need the refresh becasue when you have the
if(count($error) == 0)
{ require 'bla bla.x';
acording to what i researched it returns anything after that to be false. but because of the emta code, refresh which mab helped with it reshes the page and since your data is there is says go to x page.
good job everyone, this was a great help.