Force login in ASP - asp-classic

I have make a login page in asp classic named SiteMaster.asp
i have set this page as default page thats work fine , but if an user knows
tha name of the other pages can access without login , example
http://localhost/teste/barra.asp
what i need to add for block this kind o access?
this is the code of my login page
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html><head>
<title>Intranet Novo Macuco </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head><body>
<form name="login" method="post" action="verify.asp" >
<table >
<tr>
<td height="49" colspan="5"><p><img src="imagens/moveisnovomacuco.PNG" width="226" height="95" alt=""/></p>
<p> </p></td>
</tr>
<tr>
<td >Login</td>
<td colspan="3" ><input type="text" name="loginx" id="login"></td>
</tr>
<tr>
<td >Senha</td>
<td colspan="3" ><input type="password" name="passx" id="passwordx"></td>
</tr>
<tr>
<td ><input type="submit" name="submit" id="submit" value="Enviar"></td>
<td colspan="3" ><input type="reset" name="reset" id="reset" value="Limpar">
</td>
</table>
</form>
</body></html>
I need to user session or another object to make this???

Related

Data not getting printed properly

I am writing code in spring mvc. It's very basic like taking the data from one jsp page than after writing post method in controller I want to fetch that details in success page but after writing post method I am getting where it should print the details. I am not understanding where I have gone wrong here. I am pasting the code:
dinInForm.jsp
<%# page language="java" contentType="text/html;
charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%# taglib uri="http://www.springframework.org/tags/form"
prefix="form"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>DineInReservationSystem
</title>
<style>
.error {
color: #ff0000;
font-style: italic;
font-weight: bold;
}
</style>
</head>
<body>
<h2>Dine In Reservation System</h2>
<form:form method="POST" commandName="dineInForm" action="save.do">
<table>
<tr>
<td> Resturant
</td>
<td><form:select path="resturant">
<form:option value="" label="select resturant"></form:option>
<form:options items="${resturantList}"></form:options>
</form:select></td>
<td><form:errors path="resturant" cssClass="error" /></td>
</tr>
<tr>
<td>DIne Type</td>
<td><form:select path="dineType">
<form:option value="lake View" label="lake View"/>
<form:option value="Roof View" label="Roof View"/>
</form:select>
<td><form:errors path="dineType" cssClass="error" /></td>
</tr>
<tr>
<td>Date(DD/MM/yyyy)</td>
<td><form:input path="date"/></td>
<td><form:errors path="date" cssClass="error" /></td>
</tr>
<tr>
<td>TIme(Lunch/Dinner)</td>
<td>
12:00PM<form:radiobutton path="time"/></td>
<td>01:00PM<form:radiobutton path="time"/></td>
</tr>
<tr>
<td></td>
<td>
08:00PM<form:radiobutton path="time"/></td>
<td>09:00PM<form:radiobutton path="time"/></td>
<td><form:errors path="time" cssClass="error" /></td>
</tr>
<tr>
<td>No. Of Guest</td>
<td><form:input path="noOfGuest"/></td>
<td><form:errors path="noOfGuest" cssClass="error" /></td>
</tr>
<tr>
<td>name</td>
<td><form:input path="name"/></td>
<td><form:errors path="name" cssClass="error" /></td>
</tr>
<tr>
<td>Mobile Number</td>
<td><form:input path="mobNo"/></td>
</tr>
<tr>
<td><input type="submit" value="Confirm"></td>
</tr>
</table>
</form:form>
</body>
</html>
Success.jsp
----------------
<%# taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%# taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%# page session="false" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>DineInReservationSystem
</title>
</head>
<body>
<h2>Dine-In reservation system</h2>
<h4>Acknowledgement---------------------------------</h4>
<h3>Thank you for choosing ${dineInForm.resturant} resturant</h3>
<h4>Here are your details</h4>
Customer name : ${name} <br> `enter code here`
No of guest : ${dineInForm.noOfGuest} <br>
Time: ${dineInForm.time}<br>
</body>
</html>
Controller
#RequestMapping(value="/save.do", method=RequestMethod.POST)
public String saveDineInDetail(#Valid DineInForm dineInForm,
BindingResult res,Model model)
{
if(res.hasErrors())
{
return "dinInForm";
}
model.addAttribute("dineInForm",dineInForm);
model.addAttribute("name", dineInForm.getName());
System.out.println(dineInForm.getMobNo());
return "success";
}`
Getting the output in browser like this
Dine-In reservation system
Acknowledgement---------------------------------
Thank you for choosing ${dineInForm.resturant} resturant
Here are your details
Customer name : ${name}
No of guest : ${dineInForm.noOfGuest}
Time: ${dineIn
Form.time}

Input to the arraylist with Thymeleaf

I have simple class that contains 2 Strings, 1 Integer and 1 ArrayList<String>. Using Spring MVC and Thymeleaf I'm trying to craete a form, where I can insert data to create an object. Sadly I have no idea how to handle Arraylist. This is what I've got so far:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<h1>F O R M</h1>
<form th:action="#{/form/person}" th:object="${person}" method="post">
<table>
<tr>
<td>Name:</td>
<td><input type="text" th:field="*{name}"/></td>
<td th:if="${#fields.hasErrors('name')}" th:errors="*{name}">Name error</td>
</tr>
<tr>
<td>Age:</td>
<td><input type="number" th:field="*{age} "/></td>
<td th:if="${#fields.hasErrors('age')}" th:errors="*{age}">Age Error</td>
</tr>
<tr>
<td>City:</td>
<td><input type="text" th:field="*{city}"/></td>
<td th:if="${#fields.hasErrors('city')}" th:errors="*{city}">City Error</td>
</tr>
<tr>
<td><input type="submit" value="Submit"/></td>
<td><input type="reset" value="Reset"/></td>
</tr>
</table>
</form>
</body>
</html>
For example if your list name is city then:
<input type="text" th:field="*{city[__${INDEX}__]}" />
Where INDEX is index in your list. When for example you just put String on the second index then on the first index you will have null.

How do I integrate Woocommerce payment method to my banks checkout page?

i am new to woocommerce and i really need some help...My bank send me a payment checkout code and i wish to integrate it into woocommerce checkout page...
the attached checkout page requires payment parameters from woocommerce such as paymentTotal, referenceNo, currency, purchaseDescription, transactionType..etc
how can i integrate woocommerce checkout to my banks sample checkout page please?
<?php
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Mastercard MIGS VAS Integration demo - checkout page</title>
</head>
<body>
<h1>Example MIGS VAS Server Hosted Merchant Integration - Checkout Page</h1>
<form action="postrequest.php" method="POST">
<div>
<p>Purchase an Item</p>
<table>
<tr>
<td><label for="paymentAmount">Sale Base Units</label></td>
<td><input type="text" id="paymentAmount" name="paymentAmount" value=""></td>
</tr>
<tr>
<td><label for="currency">Currency</label></td>
<td><input type="text" id="currency" name="currency" value="AUD"/></td>
</tr>
<tr>
<td><label for="purchaseDescription">Description</label></td>
<td><input type="text" id="purchaseDescription" name="purchaseDescription"
value="Shiny blue widget"/></td>
</tr>
<tr>
<td><label for="transactionType">Transaction Type</label></td>
<td><select id="transactionType" name="transactionType">
<option>authorise</option>
<option selected>purchase</option>
</select></td>
</tr>
<tr>
<td><label for="referenceNumber">Reference Number</label></td>
<td><input type="text" id="referenceNumber" name="referenceNumber" value=""/></td>
</tr>
<tr>
<td><label for="messageReference">Message Reference</label></td>
<td><input type="text" id="messageReference" name="messageReference" value=""/></td>
</tr>
<tr>
<td><input type="submit" id="checkOut" name="checkOut" value="Check out"/></td>
</tr>
</table>
</div>
</form>
</body>
</html>

Thymeleaf decorator - how to replace footer from layout by custom footer on one particular page

My question is - I have two files:
layout.html:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org"
th:fragment="layout">
<head>
<title >Layout page</title>
</head>
<body>
<header>
<h1>My website</h1>
</header>
<section th:include="this :: content">
<p>Page content goes here</p>
</section>
<footer th:fragment="footer" >
<p>My footer</p>
</footer>
</body>
</html>
And index.html:
<!DOCTYPE html >
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org"
th:include="layout :: layout">
<head>
<title>Index page</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<h2>Hello World!</h2>
<section class="seedstarterlist" th:fragment="content" >
<form action="#" th:action="#{/add}" th:object="${user}" method="post">
<table>
<tbody>
<tr>
<td>name</td>
<td><input type="text" th:field="*{name}" /></td>
</tr>
<tr>
<td>surname</td>
<td><input type="text" th:field="*{surname}" /></td>
</tr>
<tr>
<td>email</td>
<td><input type="text" th:field="*{email}" /></td>
</tr>
<tr>
<td>street</td>
<td><input type="text" th:field="*{street}" /></td>
</tr>
<tr>
<td>postcode</td>
<td><input type="text" th:field="*{postcode}" /></td>
</tr>
<tr>
<td>city</td>
<td><input type="text" th:field="*{city}" /></td>
</tr>
<tr>
<td>district</td>
<td><input type="text" th:field="*{district}" /></td>
</tr>
<tr>
<td>country</td>
<td><input type="text" th:field="*{country}" /></td>
</tr>
<tr>
<td>nationality</td>
<td><input type="text" th:field="*{nationality}" /></td>
</tr>
<tr>
<td>phoneNumber</td>
<td><input type="text" th:field="*{phoneNumber}" /></td>
</tr>
<tr>
<td>avatar</td>
<td><input type="text" th:field="*{avatar}" /></td>
</tr>
<tr>
<td>password</td>
<td><input type="text" th:field="*{password}" /></td>
</tr>
<tr>
<td>status</td>
<td><input type="text" th:field="*{status}" /></td>
</tr>
<tr>
<td>sex</td>
<td><input type="text" th:field="*{sex}" /></td>
</tr>
<tr>
<td>birthdate</td>
<td><input type="text" th:field="*{birthdate}" /></td>
</tr>
<tr>
<td colspan="2">
<button type="submit" name="add">Add User</button>
</td>
</tr>
</tbody>
</table>
</form>
</section>
<footer th:fragment="footer" >
<p>My custom footer</p>
</footer>
I want to have custom footer only on index.html page. Layout works fine, but I want to override footer, on this particular page, and this is not working.
Any help?
The answer is that I needed to change my approach and use ThymeLeaf Layout Dialect. I registered additional template engine in Spring configuration files:
<bean id="templateEngine" class="org.thymeleaf.spring4.SpringTemplateEngine">
<property name="additionalDialects">
<set>
<bean class="nz.net.ultraq.thymeleaf.LayoutDialect"/>
</set>
</property>
</bean>
and change declaration on the top of html to:
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorator="layout.html">
Hope it will help somebody.

How can i call a .Aspx page in HTML page inside the iframe tag

I have a html page and i want to add a aspx page into that html page how can i do this.
i used tag but it is giving the error.
Please tell me what can i do.
my home.html contains the following
<html>
<head>
</head>
<body>
<iframe id="ff" width="546px" height="500px" frameborder="0" scroll="no" src="Default.aspx"></iframe>
</body>
</html>
and default.aspx contains a source code
<%# Page Title="Home Page" Language="C#" AutoEventWireup="true"
CodeBehind="Default.aspx.cs" Inherits="AgrawalPakcers._Default" %>
<HTML>
<HEAD>
<LINK REL="stylesheet" HREF="style1.css" TYPE="text/css" MEDIA="screen">
</head>
<body>
<form id="FORM2" runat="server">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" ALIGN="CENTER"
WIDTH="240">
<TR>
<TD VALIGN="TOP" ALIGN="LEFT">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" ALIGN="CENTER" CLASS="tab2">
<TR>
<TD><B CLASS="c1">Shifting Type :</B><BR>
<IMG SRC="gifs/zero.gif" WIDTH="80" HEIGHT="1"></TD>
<TD><SELECT NAME="Services" STYLE="width:140px;font-size:11px; color:#333;height:20px;border:1px solid #F0D8A1;">
<OPTION VALUE="NA">----- Select Services -----</OPTION>
<OPTION VALUE="LOCAL">LOCAL</OPTION>
<OPTION VALUE="DOMESTIC">DOMESTIC</OPTION>
<OPTION VALUE="INTERNATIONAL">INTERNATIONAL</OPTION></SELECT></TD>
</TR>
<TR>
<TD><B CLASS="c1">Name :</B></TD>
<TD><INPUT NAME="S_name" SIZE="12" MAXLENGTH="40" VALUE="" STYLE="border:1px solid #F0D8A1; width:136px;" ONFOCUS="javascript:RegValue(this);" ONBLUR="javascript:RegValue1(this);" CLASS="txtfa"></TD>
</TR>
<TR>
<TD><B CLASS="c1">Contact No. :</B></TD>
<TD>
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TBODY>
<TR>
<TD><INPUT TYPE="TEXT" NAME="S_mcode" ID="S_mcode" SIZE="5" READONLY="READONLY" STYLE="width:30px;height:15px;" CLASS="txtfn" VALUE=""></TD>
<TD><IMG SRC="gifs/zero.gif" WIDTH="2" HEIGHT="1"></TD>
<TD><INPUT NAME="S_mobile" ID="S_mobile" TYPE="text" ONFOCUS="javascript:CellValue(this);" ONBLUR="javascript:CellValue1(this);" SIZE="15" VALUE="Mobile / Cell Phone Number" CLASS="txtfa" STYLE="width:103px;height:15px;"></TD>
</TR></TBODY>
</TABLE></TD>
</TR>
<TR>
<TD><B CLASS="c1">E-Mail ID :</B></TD>
<TD><INPUT NAME="S_email" MAXLENGTH="48" SIZE="12" VALUE="" STYLE="border:1px solid #F0D8A1;width:136px;" ONFOCUS="javascript:EmailValue(this);" ONBLUR="javascript:EmailValue1(this);" CLASS="txtfa"></TD>
</TR>
<TR>
<TD><B CLASS="c1">From :</B></TD>
<TD><INPUT TYPE="TEXT" NAME="from" SIZE="12" MAXLENGTH="60" VALUE="" STYLE="border:1px solid #F0D8A1;width:136px;" CLASS="txtfa" ONFOCUS="javascript:FromValue(this);" ONBLUR="javascript:FromValue1(this);"></TD>
</TR>
<TR>
<TD COLSPAN="3">
<CENTER><INPUT TYPE="SUBMIT" VALUE="Submit"></CENTER></TD>
</TR>
</body>
</html>
and when i browse home.html
i m getting the following error.
This page contais the following errors:
error on line 1 at column 2 : StartTag: invlid element name
Below is a rendering of the page up to the first error.
I have copy and paste you html and it is working fine, the problem is you have missed the closing tag of table and form. you should close you form and table tag then I think it will work.
have you kept home.html and Default.aspx file in same directory, If you don't then keep it in the same location.

Resources