Showing Only Part Of Data In Dynamic Field
I have an asp page that shows dynamic data from the db, I only want to show
the first 3 letters / digits from the db on the ASP page.
I have an asp page that shows dynamic data from the db, I only want to show
the first 3 letters / digits from the db on the ASP page.
I would like to use the last 10 characters of a Session object. Is this possible in active server pages. I am familiar with the user of Right$ in visual basic but I after trying serveral conatations I have had to give up.
View Replies View RelatedIs there a way in asp to retrieve part of the URL and use it
say the url was
http://localhost/site/craig/default.asp
or
http://localhost/site/craig/test.asp
or
http://localhost/site/craig/roger.asp?dan=1
is there anyway of retrieving the word craig so to use it in the page, I just want the word Craig
This is because i could have other addresses that are for example
http://localhost/site/jon/default.asp
or
http://localhost/site/jon/test.asp
or
http://localhost/site/jon/roger.asp
where i need to retrieve the word jon
at the moment i use the code
strURL = Replace(Request.ServerVariables("URL"), "/default.asp", "")
intStart = instrRev(strURL, "/") + 1
strName = mid(strURL, intStart)
this worked fine until new pages are added ie a page that isnt default.asp
Obviously i cant use strURL = Replace(Request.ServerVariables("URL"), "/default.asp", "") because default.asp will change...
I am using SQL 2000 database and MS Server 2003.
I am pulling in data from a sql table. For some reason, when I include
the following line:
<tr><td><b><%if rs("Street_dir")<> "" then response.write
rs("Street_dir") & " " end if%>
<%=rs("Street_num")%> <%=rs("Street_name")%> <%=rs("Street_suf
fix")%></b></td></tr>
then the following line does not display:
<tr><td><%=rs("remarks")%></td></tr>
The REMARKS data is blank. But, if I remove the upper address line, then
the REMARKS appears. The address is 1111 Main so that does not seem to
be the issue. The address information is VARCHAR fields, 255 characters.
This works fine on another server where my files used to be, but I just
moved to a new server.
I would like to show my data in a ASP table. I do not want a sort of record selector on that page. So I did the following: Please be as kind and look the attachment
I would like to see a table header like "tradeid,clearingnumber" etc - and underneath the list of records.
can someone tell me how to get this because in the moment I only see one record always it's not continuing writing the list.
I've been setting up an online payment system for our site, and it all works fine except for one part. When it submits to the merchant's site, the customer is greeted with a blank page for a few seconds while it verifies the card. Then it redirects to our site.
Is there any way to do a form POST to another site without actually making the browser go to that page?
Im comparing values in a field while doing a loop if sAct<>myData(5,i) then At the end of the loop I make the value of sAct equal the current myData
This will work when comparing other fields withing my recordset (so I know the statement works) but it will not work for the field I want to compare. The only difference with this field is that it has null values. Could this be the problem? if so, how do I deal with nulls?
Is it valid to get information from a request.form assign that to a value then use that value to get other content on the requested page.
I return a large rs with multiple feild names. I can't use a static feild def because they would overwrite each other on the loop, SO i create dynamic field names then pass the id back to the next page via javascript. I then use that id to add to the feild name to make sure I get the right feild.
Id = Request.Form("Id")
SQL STUFF
CheckedID=Request.Form("Name_"&Id)
I would like to create a page of hyperlinks that are constructed from the contents of a database field. When the user clicks the link they are taken to a page that will display all fields from that particular record.
I already have the page structures in place. There are two pages, one with the links and the other to display the record. Code:
I have a page where a user can edit the meta tags for the page which are
then written dynamically at the time of the page being redendered.
I was wondering today whether this actually works or not? ie, if a search
engine (google or whatever) is trawling a site, does it only read html
pages? What happens when it encounters an .asp? Surely it wouldn't execute
it and therefore be able to read the meta data correctly?
Any info on this would be appreciated, if my current way of doing it is not
appropriate I will need to invest some time into changing it.
I've created a page that has a dropdown listbox with values derived from a recordset. That is working fine. What I want to do is take a value selected from the dropdown listbox and pass it to another page that is pulling a report based on the parameter I'm selecting in the dropdown listbox.
I'm able to do this with a textbox being used to accept the parameter, but I want the client to select from a list of actual values, which will then "filter" their report.
I am trying to generate an email from the webpage using code below, which
works fine. However I want to be able to include some dyanmic data how do I
go about it ?can anybody point me in the direction of some sample code ?
<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<%
Dim myMail
Dim HTML
Set myMail = CreateObject("CDONTS.NewMail")
HTML = "<!DOCTYPE HTML PUBLIC""-//IETF//DTD HTML//EN"">"
HTML = HTML & "<html>"
HTML = HTML & "<head>"
HTML = HTML & "<meta http-equiv=""Content-Type"""
HTML = HTML & "content=""text/html; charset=iso-8859-1"">"
HTML = HTML & "<meta name=""GENERATOR"""
HTML = HTML & " content=""Microsoft Visual Studio 6.0"">"
HTML = HTML & "<title>HTMLMail</title>"
HTML = HTML & "</head>"
HTML = HTML & "<body bgcolor=""FFFFFF"">"
HTML = HTML & "<IMG SRC=""http://www.microsoft.com/library/"
HTML = HTML & "images/gifs/homepage/microsoft.gif"" BORDER=0 "
HTML = HTML & "WIDTH=167 HEIGHT=36 ALT=""Microsoft Corporation"">"
HTML = HTML & "<p><font size =""3"" face=""Arial""><strong>"
HTML = HTML & "Microsoft Exchange CDONTS Example</strong></p>"
HTML = HTML & "<p><font size =""2"" face=""Tahoma"">"
HTML = HTML & "CDO for NTS allows an easy way to send mail.<br>"
HTML = HTML & "This example shows how the content can be "
HTML = HTML & "an HTML page<br>"
HTML = HTML & "which allows you to send rich text and"
HTML = HTML & "inline graphics.</p>"
HTML = HTML & "</body>"
HTML = HTML & "</html>"
myMail.From="someone@microsoft.com"
myMail.To="someone@microsoft.com"
myMail.Subject="Sample CDONTS HTML Message"
myMail.BodyFormat=0
myMail.MailFormat=0
myMail.Body=HTML
myMail.Send
set mymail=nothing
Response.Write "Message Sent"
%>
</HEAD>
<BODY>
</BODY>
</HTML>
Ok, given a string such as this -
203_2_0_0_1_5_0_234_0_8_22_2_0_3_345_2_3_0_0_0_9
Each three digit number in the string represents a unique ID of a file in a database. Following each ID are six digits, all seperated by a "_" . Each file will ALWAYS have six subsequent integers, such as above ID "234" has "_0_8_22_2_0_3_" following it.
What I am trying to figure out is given a string of any length of this specific pattern, how to decarle a multi dimensional array that would hold each ID and its corresponding digits.
To clarify a little further, this is from a shopping cart for a photographer. Each "ID" represents an image, each of the six corresponding numbers for each ID represents a qty for an image print size, ie., 4 4x6's, 5 5x7s, 0 8x10s, 1 16x20, 23 20x30's, 48 wallets. Oh, and the image ID's are not necessarily always going to be 3 digits, they could be of any lenght integer...
I have a Dynamic product page that displays the items using "DO UNTIL rs.EOF" and I have assigned form input type to be hidden(for some) for information that I would like to retrieve. On the product page I have a "Add to Cart" button which points to my "addCart.asp".
addCart.asp is where I would insert the items into a Table called "cartItems" in the Database when the user clicks on the "Add to Cart" button.
My "addCart.asp" now generates a "Syntax error in INSERT INTO statement." which I think is caused by my inability to filter for the values from the product page and insert it into the "cartItems" table. Code:
I am having some problems with setting this up. Included in my main index.asp page is an iframe like below:
<iframe src="iframes/iframe.asp" width="425" height="225" frameborder="0" scrolling="auto"></iframe>
Basically I want the text in the iframe to change depending on the pid value. (pageID), I have all this set-up previously in my functions page. Except the only way I can see any action is by running the iframe directly and passing the querystring like iframe/iframe.asp?pid=4 and this works fine, but in my main window index.asp it does not change.
I have an idea that when i type index.asp?pid=3 its trying to get the querystringbased on the index.asp not the iframe.asp, so does anyone know how I connect these two up so that my content will change in the iframe held within the index.asp page.
I am am trying to write some code to perform a INSERT in SQL table using
a loop. What would be great is a way of dynamically entering in data in a
requaest.form ie the final code should look something like:
if Request.Form("type1") = "1" then
where the 1 in "type1" is dynamic so the code would look something like
Request.Form("type" & Rs.("fld_type_id") & ") = "1" then
But not sure how to form this or whether it would work, anyone have any
idea?
i want to have a bubble pop up on hover but in that bubble have data from a database populate it. has anyone else done this , if so how? Also i would like to try to stick to vb/asp/html if possible.
View Replies View RelatedI am looking for a software that can generate a tree of data. For example, I am trying to track real estate relationships like a lessor, tenant, general contractor, and subcontractors. I would like a visual representation of this relationship based on the values in my database showing the hierarchy much like a site map or family tree. Can anyone recommend how I could do this or suggest a software?
View Replies View RelatedI have sent form data through email using .asp before but I have never done it when you are using a form that has createelements involved. I have a form w/ 3 inputs, two text inputs and one select combo box. if i click an add user button it will appear with another row of 2 text boxes and a combo box, and you can repeat up to as many as you need. I am trying to figure out how to mail all of those values to someone. Is there an easy way. Below I will attach the code that I use to name the fields when they are generated maybe it will help....
<SCRIPT language="javascript">
counter = 1
function addRow(id){
var tbody = document.getElementById(id).getElementsByTagName("TBODY")[0];
var row = document.createElement("TR");
row.setAttribute("id","tr"+counter);
var td2 = document.createElement("TD");
var input2 = document.createElement("INPUT");
input2.setAttribute("type","text");
input2.setAttribute("name","pName"+counter);
input2.setAttribute("id","name"+counter);
td2.appendChild(input2);
var td3 = document.createElement("TD");
var input3 = document.createElement("INPUT");
input3.setAttribute("type","text");
input3.setAttribute("name","userName"+counter);
input3.setAttribute("id","prc"+counter);
td3.appendChild(input3);
var td4 = document.createElement("TD");
var input4 = document.createElement("select");
input4.name = "Role"+counter;
input4.id = "Role"+counter;
option = document.createElement("OPTION");
option.value ="Admin";
option.text = "Admin";
input4.add(option);
option = document.createElement("OPTION");
option.value ="Read";
option.text = "Read";
input4.add(option);
option = document.createElement("OPTION");
option.value ="Read/Write";
option.text = "Read/Write";
input4.add(option);
td4.appendChild(input4);
row.appendChild(td2);
row.appendChild(td3);
row.appendChild(td4);
tbody.appendChild(row);
counter++;
}
</SCRIPT>
Does anyone know how I can insert daynamic text box data into a SQL Server database? I have text boxes that are being generated dynamically and I want each of those values inserted into the database that hold the results. I'm not sure how to write my loop statement.
View Replies View RelatedI am trying to test a sql statement in Access which gives me
the error as stated in the heading.
The sql statement is built as a part of asp login verification,
where the userid and password are input in login screen.
The password in the database is a number field.
I am writing the dynamic sql statement as follows below. I believe
I am going wrong in the password section of the code:
I tried to Display data from field DB (mysql) into a Textarea to edit the text. The code I used is : Code:
<textarea name="warranty" cols="90" rows="6" class="style55" value="<%=WARRANTY%>" type="text"></textarea>
And it does not displays the data.?
I'm trying to select all the records of a Database that have the value of the "giorno" ( giorno = day in english.. i'm italian) field bigger than today.... but there's something wrong in my query. The date is in the format dd/mm/yyyy Code:
View Replies View RelatedI have an ASP variable called IRNvar:
If IRNvar(0,num) = "True" then
IRNvar(0,num) = 1
else
IRNvar(0,num) = 0
end if
In my sql database I have a True/False field called VariantFlag which is a bit data type. The IRNvar value is numeric. I am trying to insert the 1 or 0 into the database so that the field shows true or false accordingly but I get a 'Type Mismatch' error. Here's the insert statement:
SQL = "INSERT INTO Documents (CNID, DocumentPrefix, DocCategory, DocumentName, VariantFlag, PartNo, PartDesc, NewIssue, StatusID) VALUES ('" & CNID & "', '" & IRNprefix & "', '" & IRNcat & "', '" & IRNnumber & "', " & IRNvar & ", '" & PartNum & "', '" & IRNDesc(0,num) & "', 'A', '5')"
Is there a way to convert the number to the right data type? Am I doing something wrong? I'm quite new to all this so it's probably something silly.
I am designing a shopping site, in the picture the #1 section is a check box behind product name that customer can select that product to buy in #2 section the customer can set quantity of the selected product ok now codes this is the code which I have used to pull out produts and categoris from database and show them on the page Code:
View Replies View RelatedI have a page that adds data to an Access DB. When an employee adds a record I want to compare the phone number from the data they inputted to all of the phone numbers that are currently in the database for that field.
If the new phone number currently matches any record in the DB I want to have an alert that notifies the employee that a record with that phone number exists with the date that the first record was inputted and ask whether they want to continue and add the the new record or cancel the addition of the new record. Otherwise, I want the data to just be added. At this point I have a Case statement that will add the record after a submit button click.
i am trying to create a html form which you can enter the course data into the form and it will add it to the database, but i want the form so when you select the course name from the dropdown box it automatically finds the id from a different table which the id is specified as an autonumber. the tables i have are courses_data with all the data in and course_title which hold the course titles and thier unique ids.
View Replies View RelatedI currently have a web page that pulls in job vacancies from a search form all written in asp and the database is in access. I will be placing an extra field which will say "apply now" and on selecting this you will be taken to a new page where you can fill in your details and email them to the employer.
My problem is I need to know how to get a field in the form that will automatically fill in the title of the vacancy being applied for from the database.
I'm trying to pass a hidden parameter from a form and when the data contains a (') or ("), it bombs. How can I remove the quotes if they exist in the data before passing the parameter?
View Replies View RelatedI use dreamweaver and i have a combobox named country and a text field named email. I want the user choose a country from the combobox and the email for this country go to a text field. Lets say the user choose England from the combobox and an email will be puted in text box. I use PHP or ASP. This is my form:
<td><select name="country" id="country">
<option>1</option>
<option>2</option> </select>
<input name="email" type="text" id="email" value="email for the country in combo box"> </td>
I have a hyper link field in access 2003. when I present the information in my form(after retrieving it from a recordset) the link appears like this:
c#http://c#
even though the actual field in the database contains only the letter "c". this is the same for every value I insert in the field..
What i am trying to do is Update data in a table with data in another table but i want to update 2 fields in the destination table with data from 1 field in another table.
These are the table i have and their fields:
*CUPFirstRound* - Table1
GameId
GameDate
Home
Away
HomeScore
AwayScore
Winner
There are 8 rows in this table, thereofre the GameID's go from 1 to 8 Code:
i have field company_name and what im trying to do is
A
Abrahams Company Alexs company AZ''x Company
Adams company Adrians Company
B
Bills company
Bobs Compay
I want the names spread over 3 columns and by alphebet category. can yous ee by the example what i mean? and is this easy to achieve?