Hi Pete, I think I'm confused now. if all you need to do is pass the code for a query then clean up the $_GET['C'] or $_POST['C'] and use it in your query. no need to store it if is a temporary variable. If you need to store it for future use then set $_SESSION['s_C'].
Maybe I'm messing something about just what you are trying to do other than pass the code and look up something. Mike -- Mike Brandonisio * Web Hosting Tech One Illustration * Database Applications tel (630) 759-9283 * e-Commerce [EMAIL PROTECTED] * http://www.jikometrix.net JIKOmetrix - Reliable web hosting on 5/1/05 12:41 PM, Pete at [EMAIL PROTECTED] scribbled: > In message <[EMAIL PROTECTED]>, Mike Brandonisio > <[EMAIL PROTECTED]> writes >> Hi, >> >> You really only need to set $_SESSION['s_C'] to $_GET['C'] if you need to >> know what $_GET['C'] was passed from the URL in another script using >> sessions. > > It may have been set some pages ago, via a POST (and now via a SESSION). > It may have been set on the previous page via a POST. > It may be in the URL in a deep-link, so via a GET. > > And it may be required in consequent pages. > > I need to cover all possibilities, because they all occur at some time > or other... > > > > >> If you are only interested in setting a local variable for use in >> the current script then I'd do this: >> >> session_start(); >> header("Cache-control: private"); // IE 6 Fix. >> >> // Has C been passed in the URL? >> // If so, change it. >> if ( isset($_GET['C']) ) { >> $C = htmlspecialchars(trim($_GET['C'])); >> } >> >> // if needed >> $_SESSION['s_C'] = $C; >> >> Mike Community email addresses: Post message: [email protected] Subscribe: [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] List owner: [EMAIL PROTECTED] Shortcut URL to this page: http://groups.yahoo.com/group/php-list Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/php-list/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
