Re: URL Opening

From: Date: Sat, 19 Oct 2002 10:05:11 +0000
Subject: Re: URL Opening
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-120594@lists.php.net to get a copy of this message
You can redirect users to page with header("Locations: login.htm"); If you don't want to show the full url in the address bar the easiest thing is to put everything in a frame. Making the index page one frameset with one frame with width & height 100%. /peter a At 2002-10-19 10:28, Vivek wrote: >Hi Fellows, > >Here is my script that authenticates user by a simple login page 7 >validating user name and password from a mysql database/table. All I >wish is when a user is found Valid my script should open a page in the >browser without showing its URL in the address bar. E.g. If user is >authenticated he should be sent to >"http://callmgmt.org/menu.htm" and if >he is not a valid user then he should be redirected to >"http://callmgmt.org/login.htm" without showing >menu.htm or login.htm in >the address bar. The address bar should show constantly only >"http://callmgmt.org" so that user does not know to >which page he is >redirected. > > ><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> ><?php include("phpdbform_form.php"); mysql_connect("vivek", >"callmgmt", "1") or die("Couldnt connect to database"); >mysql_select_db(callmgmt) or die("Couldnt select database"); $result = >mysql_query("SELECT username,userpw FROM users "); $row = >mysql_fetch_array($result); echo " >"; $form = new phpform("form1"); $form->add_textbox( "name", " >User Name ", 20, 20 ); $form->add_password( "passwd", " Password ", 20, >20 ); //$form->fields["name"]->onblur = "TestLen(this,5,20);"; >//$form->fields["passwd"]->onblur = "TestLen(this,4,10);"; $processed = >$form->process(); $form->draw(); echo " >"; echo " > >---------- >"; // I put remarks so that can check if this script works without importing form fields >into variables. // @reset( $HTTP_POST_VARS ); //while( $k = @each( $HTTP_POST_VARS ) ) //{ // echo >$k[0] . " - " . $k[1] . " >"; //} if ( $form1_name == $row[0] && $form1_passwd == $row[1]) // Here I wish to >redirect the user to a Page echo " >Matched >"; else // Here I wish to redirect the user to the login page again echo " >Incorrect User Name or Password >"; ?> > > >Regards, >Vivek > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#120594) next »