conditional page loading PART2

From: Date: Mon, 14 Aug 2000 17:14:46 +0000
Subject: conditional page loading PART2
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-2043@lists.php.net to get a copy of this message
Hello, Thank you for the input. If you don't mind I'd like to ask you some things a little more in-depth concerning header(). I've moved from the login decision as mentioned in my original message. I now have another condition where I must decide which page to load and what variables to pass via urlencoding depending on the decision made. Can I urlencode variables that I'd like to pass along within the header() function? If so, what would be the syntax? If not, do you know how I could do that? Example: I have narrowed what a customer is looking for to one record from a database. I now want to validate the input the customer is sending me. If the input is invalid, I'd like the customer to be able to return to the order page with all the info from the database intact, thus, passing php variables back to the order page after the input validation process. The user inputs into an html form that is posting using a "validate.php" script. Therefore, as far I my understanding goes, the best way to keep the info from the database is to pass via urlencoding. Do you know how to do this with the header() function? I imagine that you use the urlencode() function in conjunction with it. Thank you very much for your time! Greatly appreciated, Uva From: Chad Day <cday@beachassociates.com> To: "'umobiva@ostrichneck.org'" <umobiva@ostrichneck.org>, php-db@lists.php.net Date sent: Fri, 11 Aug 2000 16:28:13 -0400 Subject: RE: [PHP-DB] conditional page loading > Make sure you output no content, and use a Header to jump them to whatever > page you want. > > your query here > if ($num == 1) { > Header("Location: success.php"); > } else { > Header("Location: forgotpw.php"); > } > > > -----Original Message----- > From: umobiva@ostrichneck.org [mailto:umobiva@ostrichneck.org] > Sent: Friday, August 11, 2000 4:21 PM > To: php-db@lists.php.net > Subject: [PHP-DB] conditional page loading > > > Hello, > does anyone know how to make php load a web page based on a > condition or another page based on another condition. > > For example, when a customer logs in, the login button calls > disclaimer.html page. This page connects to a mysql database to search a > customer/password cross reference table. > > This should return 1 row or 0 rows. > > I am grabbing the resulting number of rows like this: > > $num = mysql_numrows($result) > > then I have: > > if ($num == 1) { > <web page to load if this is a valid user> > } > else { > <web page to load if this user is invalid> > } > > I don't know what php uses to accomplish. I've tried looking through the > manual but nothing seems to suit this situation. > > Does anyone know what commands I need to do in the if/else statement to > redirect to one of 2 pages? > > > TIA > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.db (#2043) next »