Component index
Section index

Component websession_sql


Search

	/*
	    We demonstrate a typical session with a login form.
	*/
	<call websession_sql>("test");
	<f exec>
	    <call weblogin>(user,passwd);
	    <f top>
	            tlmpweb_title ("Please log in");
	            /- <center><h2>This is a test, enter foo twice</h2></center>
	    </f>
	    <f setup>
	        // /- <input type=hidden name=test value=newsession>
	        /- <center><table>
	        /- <tr><td>Login ID<td>
	        field_user();
	        /- <tr><td>Password<td>
	        field_pass();
	    </f>
	    <f validate>
	        return strcmp(user,"foo")==0 && strcmp(pass,"foo")==0;
	    </f>
	    <f exec>
	        <call websteps>();
	        <f setstep>
	        </f>
	        <f step1>
	                tlmpweb_title ("Test session");
	                /-<center>
	                url_gotostep (1,"Main menu");
	                /-<p>
	                url_gotostep (2,"Who am I");
	                /-<p>
	                url_gotostep (3,"logout");
	                /-</center>
	        </f>
	        <f step2>
	            tlmpweb_title ("You are");
	            printf ("user=%s<br>\n",user.get());
	            printf ("pass=%s<br>\n",passwd.get());
	        </f>
	        <f step3>
	            glocal.websession_sql___v1.logout();
	            url_gotostep (1,"Main menu");
	        </f>
	        </call>
	    </f>
	    </call>
	</f>
	</call>