ASP

80K

Solutions

31K

Contributors

Active Server Pages (ASP) is Microsoft’s first server-side engine for dynamic web pages. ASP’s support of the Component Object Model (COM) enables it to access and use compiled libraries such as DLLs. It has been superseded by ASP.NET, but will be supported by Internet Information Services (IIS) through at least 2022.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hi all and hope you can help

I want to create an IF statement for:
When a user visits my site if creates I record the 'main' entry into the DB. eg user demographic details, cookie assigned, sessionID recorded, etc.
When a user revisits my site, if would also create another 'main' entry and record new user demographic details (most likely same as before, unless they have traveled), same cookie (as it has been already assigned, NEW sessionID, etc.

The above INSERT statements are already working, so dont need any work here

The issue Im having is... how to figure out the IF statement, so that the above is not created every time the user goes to a different page within the same sessionID
0
PeopleSoft Has Never Been Easier
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

I have a website that has an iframe which displays a vimeo video.
When I see it locally the iframe is displayed correctly and i can watch the video, but on the server it only shows a blank space.

Is there an IIS setting that could be blocking iframes?  what else should I consider?
0
Hello Experts,

I inherited an ASP application, that is very messy, across multiple of domains, virtual directories, etc... I'm not even able to create a test environment, so I'm making all changes live.

Anyways, here's the situation...

On MSSQL i have a fldEnabled bit set to False

In one common.asp include, I have
Session("bolNightSeason")   = (.Fields("fldEnabled"))

Open in new window


I also tried
Session("bolNightSeason")   = CBool(.Fields("fldEnabled"))

Open in new window


Then, after including common.asp in another file,, I have
bolNightSeason = Session("bolNightSeason")
Response.Write("night = " & bolNightSeason)

Open in new window


Now the issue is in the output...

  • When I first start the browser, I see
  • night=
  • ...
  • expected as i set it to False

  • Then, if i hit Refresh I see
  • night=True
  • ...
  • How is this possible, when the field value in the db is still set it to False?

  • Refreshing remains True, but closing and re-opening the browser goes  back to ""

Can any one spot why the value is changing, or advise on how I can trace the issue?

Any help will be greatly appreciated.

Thank you.
0
Hi there,

My form has the structure shown below:
---------------------------------------------------------------------------------------------------------------------------
<form id="form1" name="form1" method="POST" action="../../Codes_my/confirmScheduling.asp">
      <table class="table table-striped">
                    <tr>
                      <th>Day/Time</th>
                      <th>Mo </th>
                      <th>Tue </th>
                      <th>Wed </th>
                      <th>Thu </th>
                      <th>Fri </th>
                      <th>Sat </th>
                    </tr>
                     <tr>
                      <th>7h30min - 8h20min</th>
                      <td><% If ... Then %>
                      <input name="hiddHorarioID" type="hidden" id="hiddHorario47" value="475_<%= ThisDay(4)%>" size="5" />
                      <button class="btn btn-primary btn-sm" type="submit">five credits</button>
                      <% Else %>
                  <% If ... Then %>
                        <button class="btn btn-info btn-xs disabled" type="submit">reserved</button>
                  <% Else %>      
                       <button class="btn btn-primary btn-xs disabled" type="submit">reserved</button>
                 <% End If %>
                 <% End If %>
                 </td>
                      <td><% If ...  Then %>
                      <input name="hiddHorarioID" type="hidden" id="hiddHorario57" value="575_<%= ThisDay(5)%>" size="5" />
                       <button class="btn btn-primary …
0
I want to remove the '-' character and any spaces ' ' from a string. I am trying to do a double replace but my syntax seems icnorrect.
This seems to work for replacing the '-' but I am not sure what the syntax will be to also remove the spaces

(Replace(a.fieldname,'-','') AS fieldnameclear)

Open in new window

0
Hi there!

The two pieces below "work together"

<input name="hiddScheduleID" type="radio" id="hiddSchedule21" value="218_<%= ThisDay(2)%>" size="5" />
<button class="btn btn-primary btn-xs" type="submit" onclick="javascript:return checkRadio()">Schedule Date</button>

That means: the user has the possibility to check the radio button and right after that, when he/she presses the button, the "action" related to the "form" considered works as expected.

My will : I would like to leave "just the button", but with the radio-button info "inside it", so that when the user presses the button, everything works the same. In other words, take out the radio button without taking out the info it stores, and put the info "inside" the button...  how should that be done?

P.S.: the javascript is for "are you sure you want to..." stuff.  Therefore this part should be kept intact, of course.

Thanks!
0
HI there, a while ago I was helped to create this code below:

Set Header=oConn.Execute("SELECT * FROM site_header WHERE brand_ID='"&SubDomain("sites.brand_ID")&"' AND header_live=TRUE ORDER BY RND(-10000000*TimeValue(Now())*header_ID)")
HeaderImage=Header("header_image")

Open in new window


However I am getting this error:
Microsoft VBScript compilation error '800a03ee'

Expected ')'

Response.Write("<td width="&SiteWidth&" height=300 align=center valign=bottom background="&BrandImageDir&"/"&HeaderImage&" bgcolor="&SubDomain("brand_bg-color")&" rowspan=2 style='background-size:cover;background-position:center,center'>")
------------------------------------------------------------------------------------------------------------^

Open in new window


I cannot figure out why this is the issue

help!?
0
Hi there,

My string ("texto") is always something like that:  texto = 427_7/13/2017

I mean: three digits (none zero), the "_" symbol and a date (of course as a string).

How could I extract from "texto" only the date, that is, the "7/13/2017" in this example, so that I can store this date in a certain field in a table of a database?  

Important: please take into account that the "texto" date might be (for example) texto = 427_12/13/2017 and, in this case, of course I want the extraction to be the full date, I mean, exactly 12/13/2017 .

Thanks!
fskilnik.
0
how to validate if the email format its ok, then do not submit

set conn=Server.CreateObject("ADODB.Connection")
'conn.Provider="Provider=SQLOLEDB"


sql="INSERT INTO comentarios (nombre, email,telefono, producto, comentario)"
sql=sql & " VALUES "
sql=sql & "('" & Request.Form("fname") & "',"
sql=sql & "'" & Request.Form("email") & "',"
sql=sql & "'" & Request.Form("telefono") & "',"
sql=sql & "'" & Request.Form("consultorio") & "',"
sql=sql & "'" & Request.Form("message") & "')"

on error resume next
conn.Execute sql,recaffected
if err<>0 then
  Response.Write("Error, Intente otro metodo de contacto!")
 Response.Write("<a href='http://www.tasasystemasasmx.com/contacaato.html'><h3>Regresar a página de contacto.</h3></a>")
else
 Response.Write("<h3>Nos pondremos en contacto lo antes posible.</h3>")
 Response.Write("<a href='http://www.totalsyssdstems.com/indicase.html'><h3>Regresar a Oncología del Bajío.</h3></a>")
  

end if
conn.close

Open in new window

0
Hello, All.

#1: Submit a form.
#2: Have the content of the div {REFRESH} the data behind it, every 1 second, after the form submit.

I have this code to refresh if I load the page on its own, without a form click.
<script type="text/javascript">
var auto_MediaAff = setInterval(
function()
{
$('#MailID').fadeOut('slow').load('http://192.168.2.12/new_cs/add-ons/Postmaster/2.asp').fadeIn("slow");
}, 1000);
</script>

Open in new window


Any idea's on how to accomplish this after the Form Submit?

Carrzkiss
0
[Webinar] How Hackers Steal Your Credentials
LVL 9
[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Hello experts, I'm trying to develop a code that can manipulate the cursor to transfer from one input text to another. The big problem is that the input text that i have is in the table. The Table is made thru insertRow. Therfore, they are in the same id. So, I try to make an index to determine which of them is being click. I attached the code below to make you (experts) understand of what i am trying to do. Please help me achieve the goal if is possible. My goal is to let the cursor focus from one input text to another by using arrow-up, arrow-down, left and right. Thank you!

<!DOCTYPE html>
<html>
<style>
table,th,td {
  border : 1px solid black;
  border-collapse: collapse;
}
th,td {
  padding: 5px;
}
tfoot {color:red;}
</style>

<table id="Tab1">
<tr>
  <th>Quantity</th>
  <th>Price</th>
  <th>Total</th>
</tr>
</table>

<br/>

<button onclick="return AddNow()">Add row</button>


<script>
function AddNow() {

  var p = parseInt("2.50");
  
  var table = document.getElementById("Tab1");
  var row = table.insertRow(table.rows.length);
  
  var cell1 = row.insertCell(0);
  var cell2 = row.insertCell(1);

  cell1.innerHTML = '<input type="text"  id="qty" class="Qty"  onkeydown="myIndex(this)"/>';
  cell2.innerHTML = '<input type="text" id="rp"  value="' + p + '"' + ' readonly/>'; 

}
</script>


<script>
function myIndex(x)
{
  var h = x.parentElement.parentElement.rowIndex; 
  alert(h);
  // here focus() must transfer to the next row depending on the user choice 

Open in new window

0
Hi experts, I wish to do Full screen event using button, that every time I press the button will do full screen just like the F11 on the keyboard. Help please!

<!DOCTYPE html>
<html>
<body>
<button size="25" onclick="return FullSreen()">F11 - Full Screen</button><br/><br/>
<script>
function FullSreen() 
{
  //Do FullScreen here
}
</script>
</body>
</html>

Open in new window

0
Hi experts, how to make codes that will give information of the browser, client side?

<!DOCTYPE html>
<html>
<body>


<button onclick="GetBrowserName()">Get Browser name</button>

<script>
function GetBrowserName() {
    
    alert("You're browser name is");
}
</script>

</body>
</html>

Open in new window

0
Hello there I have looked through the interweb and cannot seem to find anything except TRIM to remove spaces.

Unfortunately Trim remove pre and post spaces, which I do not require

I was to remove the spaces within a field

eg. Te Awe Awe Gardner --> TeAweAweGardner

Any help would be great
0
Hi Experts,

I am trying to update legacy ASP code amd I am starting out with
<%@ Language=VBScript %>

<%
Session("isLocal") = True

Session("getRates") = ""
Session("getRatesTime") = DateAdd("n", -1, Now())	'DateAdd Intervals: s=secs; n=minutes; h=hrs

Session("Root") = "../"
Session("sourceID") = 1

If (Session("isLocal") = True) Then   
    %>

    <!--  <!-- #include file = "../../CSSN_subdomains/includes/common.asp" -->
    <!--  <!-- #include file = "../../CSSN_subdomains/includes/functions.asp" -->
    <!--  <!-- #include file = "../../CSSN_subdomains/includes/PageSetup.asp" -->

    <%
Else
    %>

    <!--  <!-- #include virtual = "/includes/common.asp" -->
    <!--  <!-- #include virtual = "/includes/functions.asp" -->
    <!--  <!-- #include virtual = "/includes/PageSetup.asp" -->

    <%
End If

Open in new window


However, I am getting the following error despite that Session("isLocal") is True, so lines 23-25 should never be executed.
Active Server Pages error 'ASP 0126'

Include file not found

/CSST_subdomains/cart.citysightseeingtoronto.com/index.asp, line 23

The include file '/includes/common.asp' was not found.

Open in new window


What is going on?

Any help will be greatly appreciated.
0
We've got a few old customers that, believe it or not, still have old classic ASP sites.   We recently began to migrate them from SQL 2012 to Azure SQL Database.  After the database migration, we get the following errors on the sites:

Server Native Client 11.0][SQL Server]The request for procedure '[tablename]' failed because '[tablename]' is a table object.

I figure at this point there has to be a fix for this however I cannot seem to locate it.

Anyone have the magic bullet?
0
<form method="post" action="contact.asp">
                        <b>Envíenos un mensaje</b> <span></span>
                        <input type="text" name="fname" id="fname" value="Nombre">
                        <input type="text" name="email" id="email" value="Dirección de Email">
                        <select name="Consultorio">
                            <option>Elija Consultorio...</option>
                            <option>Queretaro</option>
                            <option>San Miguel</option>
                        </select>
                        <textarea name="message" id="message" cols="30" rows="10">Escriba aquí su mensaje...</textarea>
                        <input type="submit"  name="send" id="send" value="Enviar Mensaje">
                    </form>

how do i set a input name in the select in order to asp read the select option?
regards
0
After this code runs and adds a record to the recordset, I am unable to add any more entries into the record. I believe the record is getting locked by the database since it detected changes, but I'm not sure how to remove that through access. I have verified this code works properly besides the unintended side effect of being unable to repeatedly do it. Does anyone know how to unlock the record so everyone can access it after this runs?

    Set ClientRS = CurrentDb.OpenRecordset("Client Contacts", dbOpenDynaset, dbSeeChanges)
   
    With ClientRS
        .AddNew
        ![id] = ClientID
        ![Full Name] = FullName
        ![Phone Number] = PhoneNumber.Value
        ![Company] = "Other"
        .Update
        .Close
    End With

    Set ClientRS = Nothing
   
    DoCmd.Close acForm, "Add Phone Record", acSavePrompt
End Sub
0
Hi experts, I wish to add 1 day on the edate I have coded below. Something like this (edate + 1). can i do this? Thanks!


Set rs = cn.Execute("Select Proname, REMARK, TheDate, INPro, OUTPro, BALANCE from Stock where PROCODE='" & code & "' And TheDate Between '" & sdate & "' And '" & edate & "' Order by icount")
0
SharePoint Admin?
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Is this even possible?

I have select dropdown A containing - among other things - value x.
I have text input field B which is empty by default.

Now, if x in A is selected I want to check if B has a value. In a perfect scenario I would also want to check if B has a specific value.

Possible? If so - how? I can do the basic validate form stuff, but this turns into a if/and/then scenario that I'm unfamiliar with.

Best regards
Michael
0
I want to create a new asp website with the following tasks: login, signup, and view products after login, the site connect to MSSQL database
and I have to build a mobile application using wml and wmlscript.

I've done this task but I've made my pages mixed (all pages with asp extension have the wml and vb code)
now I should separate the code and publish my asp website and design an android application that connect to this site.

P.S it is a homework, and I should design two mobile applications(one using wml and the other using andriod eclips)

can someone advise me how to separate asp files, I suppose these asp pages should return JSON object  but how I will handle it in wml code,
in the another application I will handle it using java

any hint will help me

Thanks
0
Hi,

We have a login page that saves a cookie so that the username is stored and shows next time the user logs in.
We ran a security scan and got the following alert:

"Cookie without 'httpOnly" flag

Below is the code for setting up the cookie. How can we resolve the issue of the alert?

        function createCookie(name, value, days) {
            if (days) {
                var date = new Date();
                date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
                var expires = "; expires=" + date.toGMTString();
            }
            else var expires = "";
            document.cookie = name + "=" + value + expires + "; path=/";
        }

        function eraseCookie(name) {
            createCookie(name, "", -1);
        }

Open in new window

0
The title pretty much says it all.  I created my array as follows:


' Multidimensional Array
	' arrTransactions(col,row)
	ReDim arrTransactions(6,0) 

	
	' SQL Statement
	strSQLStatement = 	"SELECT transactionNumber, jobNumber, eventName, collateralID, arrivalDate, returnDate, quantity " & _  
						"FROM collateralOut " & _
						"WHERE collateralID  ='" & strCollateralID & "' " & _
						"ORDER BY arrivalDate DESC" 

	' Connection
	Set conn = Server.CreateObject("ADODB.Connection")
	conn.open connectionStr

	' Create our recordset
	set strFilename=Server.CreateObject("ADODB.recordset")
	strFilename.Open strSQLStatement, conn

	If Not strFilename.EOF Then
		strFilename.MoveFirst
		
		noRecord = "False"
		
		i = 0

		While Not strFilename.EOF

			arrTransactions(0,i) = strFilename.Fields("transactionNumber").Value
			arrTransactions(1,i) = strFilename.Fields("jobNumber").Value
			arrTransactions(2,i) = strFilename.Fields("eventName").Value
			arrTransactions(3,i) = strFilename.Fields("collateralID").Value
			arrTransactions(4,i) = strFilename.Fields("arrivalDate").Value
			arrTransactions(5,i) = strFilename.Fields("returnDate").Value
			arrTransactions(6,i) = strFilename.Fields("quantity").Value

			' Counter
			i = i + 1
			
			' Preserve array position
			ReDim Preserve arrTransactions(6,i)

			' Move to the next record
			strFilename.MoveNext
		Wend
		
	Else
		noRecord = "True"
	End If
	
	' Close our connection
	strFilename.Close
	Set strFilename = Nothing

Open in new window



Then I wrote the following to loop through the array but it's not working:
                 <table border="1" cellpadding="5" cellspacing="1" width="80%">
                 	<tr>
                    	<td bgcolor="#eeeff0"><strong>Trans#</strong></td>
                        <td bgcolor="#eeeff0"><strong>Event Name</strong></td>
                        <td bgcolor="#eeeff0"><strong>Event Start</strong></td>
                        <td bgcolor="#eeeff0"><strong>Qty Ordered</strong></td>
                    <tr>
                 	<%
						If NoRecord = "False" Then
							For i=0 to (UBOUND(arrTransactions) - 1)
					%>
					<tr>
                    	<td valign="top"><%= arrTransactions(0,i) %></td>
                  		<td><%= HTMLDecode(arrTransactions(2,i) ) %></td>
                        <td valign="top"><%= arrTransactions(4,i) %></td>
                        <td valign="top" align="center"><%= arrTransactions(6,i) %></td>	
                    </tr>
					<%
							Next
						Else
					%>
					<tr>
                    	<td colspan="5"><strong>No Records Found</strong></td>
					</tr>
					<%
					End If 
					%>
                </table>

Open in new window


When I load the page it only loads 6 records and stops.  There are about 30 records the page should be displaying.  

I have a feeling that this line here is wrong...

For i=0 to (UBOUND(arrTransactions) - 1)

Open in new window


... but I'm not sure how to fix it.  Can someone please help me?
0
I think I know the answer to my question but I am asking it anyway (I know one is file  - xdDoc.Load and one is string xdDoc.LoadXml etc)
I have a variable that contains an XML formatted string.
Normally I would load XML from a file, using the following code:
	set xdDoc = Server.CreateObject("MSXML2.DOMDocument.6.0")
         xdDoc.load(strSource)

Open in new window


But the foregoing code fails when I use a XML string.
The following code works for the XML string and why is that??
AM I using the correct version for "Microsoft.XMLDOM"
I know I am okay with "MSXML2.DOMDocument.6.0"

   set xdDoc = CreateObject("Microsoft.XMLDOM") 
   xdDoc.LoadXml(strSource)

Open in new window

0
I am using a modified HTML form provided by Insightly on a website to capture data, do a Google reCAPTCHA verification, and then POST the data to Insightly. All of the text data is posting correctly, but the checkboxes are not. I am doing this with Classic ASP. The script which sends the data looks like this:

<%	set objXML=server.createobject("MSXML2.ServerXMLHTTP")

	objXML.Open "POST", "https://googleapps.insight.ly/WebToLead/Create", False
	objXML.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
	objXML.Send data

	response.write(objXML.responseText) %>

Open in new window


The HTML checkboxes (as provided by Insightly) look like this:

<label for="insightly_LEAD_FIELD_23">St. Mary's </label><input id="insightly_LEAD_FIELD_23" name="LEAD_FIELD_23" type="checkbox" />

Open in new window


I am capturing the user's input and attempting to post the result to Insightly, however the checkbox data is not passing through. There is no "value" attribute in the checkbox, so I'm not sure what to send.

The value of the "data" variable in the first bit of code above looks like this:

formId=xxx&FirstName=Sample+First+Name&LastName=Sample+Last+Name&email=me%40domain%2Ecom&phone=1234567890&LEAD_FIELD_22=abc%0D%0A123&ResponsibleUser=510943&LeadSource=28860&LEAD_FIELD_16=&LEAD_FIELD_21=&LEAD_FIELD_17=&LEAD_FIELD_23=

I have also tried a variable on that data, which also does not work, like this:

formId=xxx&FirstName=Sample+First+Name&LastName=Sample+Last+Name&email=me%40domain%2Ecom&phone=1234567890&LEAD_FIELD_22=abc%0D%0A123&ResponsibleUser=510943&LeadSource=28860&LEAD_FIELD_16=&LEAD_FIELD_21=&LEAD_FIELD_17=&LEAD_FIELD_23=St+Marys

The variables generally ARE working, such as FirstName, LastNAme, email, etc. Its the LEAD_FIELD_XX fields which I am not able to populate correctly.

Any idea what I could be doing wrong? Thanks!
0

ASP

80K

Solutions

31K

Contributors

Active Server Pages (ASP) is Microsoft’s first server-side engine for dynamic web pages. ASP’s support of the Component Object Model (COM) enables it to access and use compiled libraries such as DLLs. It has been superseded by ASP.NET, but will be supported by Internet Information Services (IIS) through at least 2022.