clown[NOR] Posted March 30, 2008 Share Posted March 30, 2008 ok basicly what i want to do is the following. In my login script i look for errors such as empty fields etc. now if any errors were found i redirect to errors.php... I want to bringthe array $errors with me from do_login.php to errors.php to show the user what went wrong during the login... how can I do this without using the $_GET[]; ? Link to comment https://forums.phpfreaks.com/topic/98691-bringing-array-variable-over-to-another-page/ Share on other sites More sharing options...
BlueSkyIS Posted March 30, 2008 Share Posted March 30, 2008 sessions pops to mind. but i wouldn't redirect to errors.php, i would put the errors on the same page and allow them to correct the errors instead of making them click back from a total separate errors page. my 2 cents. Link to comment https://forums.phpfreaks.com/topic/98691-bringing-array-variable-over-to-another-page/#findComment-505069 Share on other sites More sharing options...
clown[NOR] Posted March 30, 2008 Author Share Posted March 30, 2008 hehe sessions... ofc! i'm stuid well the login form will also be shown on the errors.php page... it only disapears if the user is loged in.. so on the error page i can also fill in the fields that's correct etc Link to comment https://forums.phpfreaks.com/topic/98691-bringing-array-variable-over-to-another-page/#findComment-505082 Share on other sites More sharing options...
PFMaBiSmAd Posted March 30, 2008 Share Posted March 30, 2008 In general people seem to be redirect-happy. Redirects take extra time (over just putting all of your related code on one page) because the header must be sent to the browser, the browser must stop or finish what it was doing, send the http request back to the server, the server must see the request, do the disk i/o to fetch the new page, invoke the php language engine to parse and execute it, then output any content back to the browser. If you just put all related code on one page, all of that is either skipped or combined for any additional functionality and you would just continue executing any code that uses the results produced earlier on that same page. Link to comment https://forums.phpfreaks.com/topic/98691-bringing-array-variable-over-to-another-page/#findComment-505089 Share on other sites More sharing options...
clown[NOR] Posted March 30, 2008 Author Share Posted March 30, 2008 hmmm not sure how i would aproach that tho.. adding login form, login script and error page in 1 file... maybe later hehe thanks for the info anyways PFMaBiSmAd Link to comment https://forums.phpfreaks.com/topic/98691-bringing-array-variable-over-to-another-page/#findComment-505103 Share on other sites More sharing options...
BlueSkyIS Posted March 30, 2008 Share Posted March 30, 2008 sounds like that's where you're heading (and will eventually end up.) you've already added the form onto the error page; now it's in 2 places. next comes the validation logic in 2 places, then...... Link to comment https://forums.phpfreaks.com/topic/98691-bringing-array-variable-over-to-another-page/#findComment-505111 Share on other sites More sharing options...
clown[NOR] Posted March 30, 2008 Author Share Posted March 30, 2008 no... the form is in login_form.php that's added to the index.php through include Link to comment https://forums.phpfreaks.com/topic/98691-bringing-array-variable-over-to-another-page/#findComment-505115 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.