<?php

	include "library.php";

	$cxn = start_code();

	
			/* get variables */

	$id = val( $_SESSION, 'id' );

	$id1 = val( $_GET, 'id1' );

	$id2 = val( $_GET, 'id2' );


		/* if the user is not logged in them direct them to the login page then back to here */

	if ($id == "")
	{
		$_SESSION['nextpage'] = url_encode( "chat_request_check.php", "id1", $id1, "id2", $id2 );

		jump_to_page( "login.php" );	/* must happen before print output */

		exit();
	}

	page_header( "", $cxn );


		/* check the parameters */

	crash_if_missing( $id1, "id1 missing in chat_request_check", $cxn );

	crash_if_missing( $id2, "id2 missing in chat_request_check", $cxn );


		/* prompt the user */

	echo red( "<br>Are you sure that you want to chat with this member?<br><br>" );

		
		/* yes  */

	echo sp(2);

	show_button_h( "yes", "chat.php", "chat", "yes", "id1", $id1, "id2", $id2, "newchat", "true" );


		/* no */

	echo sp(2);

	show_button_h( "no", "chat.php", "chat", "no", "id1", $id1, "id2", $id2, "newchat", "true" );

?>
