php - I cant get header("Location: http://www.google.com/") to work :( -
php - I cant get header("Location: http://www.google.com/") to work :( -
i have form points php file. php file redirects user specific page. cannot seem work , im not sure doing wrong.
<form method="post" action="processregister.php"> user name: <input type="text" name="username" maxlength="32"><br> password: <input type="password" name="userpassword" maxlength="32"><br> <input type="submit"> </form>
processregister.php
<?php // processregister.php ////////////////////// header("location: http://www.google.com/"); /* // first include class definition include('userclass.php'); // next, create instance of class $newuser = new user; // phone call registeruser() method, passing in required variables if ($newuser->registeruser($username, $userpassword)) { header('location: www.google.com'); } else { header('location: www.yahoo.com'); } */ ?>
use exit
phone call after using header()
alter locations. not prevent unnecessary processing, prevents potential security holes, if don't exit after changing locations, page processed , sent browser per normal. in cases you're, example, redirecting unauthorized users login page, sensitive content still sent them, , can capture it.
php
Comments
Post a Comment