|
The code looks like it shold work (at least good enough to make an update). How do you check if the record has been updated or not?
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
when record is updated its redirect to to first page thats moderat.asp
but problems is no any updation done
sanjeev
|
|
|
|
|
idsanjeevjha wrote: when record is updated its redirect to to first page thats moderat.asp
but problems is no any updation done
That doesn't make sense. The code doesn't do any redirect, and it doesn't show the updated value anywhere on the page so that you can see if it's updated or not.
If you did show the value, you would not see the change, as you display the values before the code that updates the values. You would have to update the page another time to see the change.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
my problems is to update thats row which display after click on link so click on link it display its row detail and wants select a option from option list and modify its open_flg status so plz help in updation
[code]
<%@language=vbscript%>
<%option explicit%>
<%
If Request.Cookies("userid") = "" Then
Response.Redirect "login.asp"
Else
dim my_conn_stRing, conn,R,R1,R2, sql,Rcount,Rpage,page,i,vopenflg
dim stroutput,reply,repcount,stropt1,vtopid,detail
MY_CONN_STRING = "dsn=oracle;uid=starter;pwd=starter;"
Set Conn = server.createobject("ADODB.Connection")
Conn.open MY_CONN_STRING
set R = Server.CreateObject("ADODB.Recordset")
for each stropt1 in request.QueryString
vtopid = request.QueryString(stropt1)
R.open "Select top_id,top_sub,MSG,open_flg,launch_by,launch_dt from topmaster where top_id="&vtopid&"",conn, adOpenStatic, adLockOptimistic, adCmdText
%>
<title>Vioce Of Baraunians
<% if request.Form("submit") then
dim sqlstr
sqlstr = "update topmaster set open_flg = '"&trim(Request.Form("vopenflg"))&"' where top_id = " & vtopid
response.Write(vopenflg)
conn.execute sqlstr
R.close
response.redirect("moderator1.asp")
conn.close
set conn=nothing
end if
next
%>
TOPIC ID | TOPIC SUBJECT | MESSAGE | POSTED BY | POSTED DATE | Permission | <%=R("top_id")%> | <%Response.Write R("top_sub")%> | <%=R("msg")%> | <%=R("launch_by")%> | <%=R("launch_dt")%> | Apply
Normal
Absue
Close
| topic id <%response.Write(vtopid)%> |
Active user | <%Response.write(Application("visitors"))%> |
|
| hello<%response.Write(vopenflg)%> |
<%end if%>
function moderate()
{
window.location = "moderator1.asp"
}
[/code]
-- modified at 5:01 Tuesday 13th November, 2007
sanjeev
|
|
|
|
|
idsanjeevjha wrote: for each stropt1 in request.QueryString
Why this loop? Your code doesn't work if the loop actually does loop.
idsanjeevjha wrote: vtopid = request.QueryString(stropt1)
Where is the form tag? Do you put the value in the querystring in the action value of the form tag? Otherwise you don't have any querystring values when you post the form.
idsanjeevjha wrote:
Meta tags goes in the header.
idsanjeevjha wrote:
"50%" is not a valid value for the colspan argument.
idsanjeevjha wrote: response.redirect("moderator1.asp")
conn.close
set conn=nothing
You have to close the connection before you do the redirect.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
hi i think you are not understand my question my english is very poor so i try to clear my question ok. T
his loop for call the row detail which linked acording to topid and display only one record thats click if this loop is not used how can call thats row which wants to update so this loop is used and click on which topic it goes to update1.asp and display its row detail then select a option and click on submit button to update record .
[code]
for each stropt1 in request.QueryString
%>
<%
vtopid = request.QueryString(stropt1)
R.open "Select top_id,top_sub,MSG,open_flg,launch_by,launch_dt from topmaster where top_id="&vtopid&"",conn, adOpenStatic, adLockOptimistic, adCmdText
%>
<title>Vioce Of Baraunians
<% if not isempty(request.Form("submit")) then
vopenflg=request.form("vopenflg")
dim sqlstr
sqlstr = "update topmaster set open_flg = '"&request.Form("vopenflg")&"' where top_id = " & vtopid
response.Write(vopenflg)
conn.execute sqlstr
R.close
conn.close
set conn=nothing
end if
next
%>
TOPIC ID | TOPIC SUBJECT | MESSAGE | POSTED BY | POSTED DATE | Permission | <%=R("top_id")%> | <%Response.Write R("top_sub")%> | <%=R("msg")%> | <%=R("launch_by")%> | <%=R("launch_dt")%> | Apply
Normal
Absue
Close
| topic id <%response.Write(vtopid)%> |
Active user | <%Response.write(Application("visitors"))%> |
[/code]
if question is clear then plz guide me in updation thank for your copration.
sanjeev
|
|
|
|
|
When you submit the form, it will be posted to the URL in the action argument in the form tag. As that URL doesn't have any querystring, the Request.QueryString collection will be empty, and the loop will run zero times. You have to add a value to the querystring of the URL, so that you can access it when the form is posted back to the page.
Looping throught the Request.QueryString collection is a bad way of handling querystring values. Just use the name of the value to read it:
vtopid = request.QueryString("SomeNameInTheQueryString")
The form tag goes inside the body tag, and you need a </form> tag to mark the end of the form.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
I have added the script below to my website and if it is in test mode, it works fine - it writes the data to the screen. But when I take it out of test mode, it doesn't email me the data. I have pasted the script along with my code for the form. Can someone please tell me why it's not emailing? (Also, fyi, I do have a .txt file setup for the formatting of the email.) Thank you!
ASP Script named sendmail_cdo.asp
<%
option explicit
'---------------------------------------------------------------------------------------------------
'FORM MAIL SCRIPT
'----------------
'usage:
'<form ACTION="sendmail.asp" ...>
'
'hidden fields:
' redirect - the url to redirect to when the mail has been sent (REQUIRED)
' mailto - the email address of the recipient (separate multiple recipients with commas) (REQUIRED)
' cc - the email address of the cc recipient (separate multiple recipients with commas) (OPTIONAL)
' bcc - the email address of the bcc recipient (separate multiple recipients with commas) (OPTIONAL)
' mailfrom - the email address of the sender (REQUIRED)
' subject - the subject line of the email (REQUIRED)
' message - the message to include in the email above the field values. not used when a template is being used. (OPTIONAL)
' template - specifies a text or html file to use as the email template, relative to the location of the sendmail script. (e.g. ../email.txt)
' A template should reference form fields like this: [$Field Name$]
' html - if this has the value "yes", the email will be sent as an html email. only used if a template is supplied.
' testmode - if this is set to "yes", the email contents will be written to the screen instead of being emailed.
'---------------------------------------------------------------------------------------------------
dim pde : set pde = createobject("scripting.dictionary")
'---------------------------------------------------------------------------------------------------
'PREDEFINED ADDRESSES for the "mailto" hidden field
'if you don't want to reveal email addresses in hidden fields, use a token word instead and specify
'below which email address it applies to. e.g. <input type="hidden" name="mailto" value="%stratdepartment%">
'ALSO, in the same way, you can use %mailfrom% to hide the originating email address
pde.add "%contactform%", "myemail@someaddress.com"
pde.add "%salesenquiry%", "anotheremail@someaddress.com"
'---------------------------------------------------------------------------------------------------
function getTextFromFile(path)
dim fso, f, txt
set fso = createobject("Scripting.FileSystemObject")
if not fso.fileexists(path) then
getTextFromFile = ""
exit function
end if
set f = fso.opentextfile(path,1)
if f.atendofstream then txt = "" else txt = f.readall
f.close
set f = nothing
set fso = nothing
getTextFromFile = txt
end function
dim redir, mailto, mailfrom, subject, item, body, cc, bcc, message, html, template, usetemplate, testmode
redir = request.form("redirect")
mailto = request.form("mailto")
if pde.exists(mailto) then mailto = pde(mailto)
cc = request.form("cc")
bcc = request.form("bcc")
mailfrom = request.form("mailfrom")
if mailfrom = "" then mailfrom = pde("%mailfrom%")
subject = request.form("subject")
message = request.form("message")
template = request.form("template")
testmode = lcase(request.form("testmode"))="yes"
if len(template) > 0 then template = getTextFromFile(server.mappath(template))
if len(template) > 0 then usetemplate = true else usetemplate = false
dim msg : set msg = server.createobject("CDO.Message")
msg.subject = subject
msg.to = mailto
msg.from = mailfrom
if len(cc) > 0 then msg.cc = cc
if len(bcc) > 0 then msg.bcc = bcc
if not usetemplate then
body = body & message & vbcrlf & vbcrlf
else
body = template
end if
for each item in request.form
select case item
case "redirect", "mailto", "cc", "bcc", "subject", "message", "template", "html", "testmode"
case else
if not usetemplate then
if item <> "mailfrom" then body = body & item & ": " & request.form(item) & vbcrlf & vbcrlf
else
body = replace(body, "[$" & item & "$]", replace(request.form(item),vbcrlf,"<br>"))
end if
end select
next
if usetemplate then 'remove any leftover placeholders
dim rx : set rx = new regexp
rx.pattern = "\[\$.*\$\]"
rx.global = true
body = rx.replace(body, "")
end if
if usetemplate and lcase(request.form("html")) = "yes" then
msg.htmlbody = body
else
msg.textbody = body
end if
if testmode then
if lcase(request.form("html")) = "yes" then
response.write "<pre>" & vbcrlf
response.write "Mail to:" & mailto & vbcrlf
response.write "Mail from:" & mailfrom & vbcrlf
if len(cc) > 0 then response.write "Cc:" & cc & vbcrlf
if len(bcc) > 0 then response.write "Bcc:" & bcc & vbcrlf
response.write "Subject:" & subject & vbcrlf & string(80,"-") & "</pre>"
response.write body
else
response.write "<html><head><title>Sendmail.asp Test Mode</title></head><body><pre>" & vbcrlf
response.write "Mail to: " & mailto & vbcrlf
response.write "Mail from: " & mailfrom & vbcrlf
if len(cc) > 0 then response.write "Cc: " & cc & vbcrlf
if len(bcc) > 0 then response.write "Bcc: " & bcc & vbcrlf
response.write "Subject: " & subject & vbcrlf & vbcrlf
response.write string(80,"-") & vbcrlf & vbcrlf & "<span style=""color:blue;"">"
response.write body & "</span>" & vbcrlf & vbcrlf
response.write string(80,"-") & vbcrlf & "**END OF EMAIL**</pre></body></html>"
end if
else
msg.send
response.redirect redir
end if
set msg = nothing
%>
Form page...
<form name="form1" method="post" action="sendmail_cdo.asp">
<div align="left">
<p class="style3">
<input name="redirect" type="hidden" id="redirect" value="surveycomplete.htm">
<input name="mailto" type="hidden" id="mailto" value="melissawaldrop@comcast.net" />
<input name="subject" type="hidden" id="subject" value="New Inquiry">
<input name="template" type="hidden" id="template" value="contactform.txt">
<input name="testmode" type="hidden" id="testmode" value="no">
</p>
<p class="style3">First Name
<input name="FName" type="text" id="FName">
Last Name
<input name="LName" type="text" id="LName">
</p>
<p class="style20"><span class="style3"><span class="style31">Email</span>
<input name="Email" type="text" id="Email">
<span class="style31">Phone </span>
<input name="Phone" type="text" id="Phone">
</span> </p>
<p>
<input type="submit" name="Submit" value="Send">
</p>
</div>
</form>
|
|
|
|
|
hi:
now,i want use javascript to break a table into two tables like below:
<table id="t1">
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
</table>
now,i mean that,i want add html code of "</table><table>" in "</tr><tr>",change the table of "t1" into two tables.
how can i do with javascript?
thx
One is never too old to learn
|
|
|
|
|
You can't. You have to add another table to the page and move the rows into it.
What is it that you are trying to accomplish, really?
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Hi,Guffa,thanks for your answer.maybe i know how to do it.;)
One is never too old to learn
|
|
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
<script type="text/javascript">
function createTable(rows,cols){
var table = document.createElement("TABLE");
var newAttr = document.createAttribute("border");
newAttr.nodeValue = "1px"
table.setAttributeNode(newAttr);
for(var i=0;i<rows;i++){
var row = document.createElement("TR");
for(var j=0;j<cols;j++){
var cell = document.createElement("TD");
cell.innerHTML = "Row : " + i + "Col : " + j;
row.appendChild(cell);
}
table.appendChild(row);
}
showThisInBody(table);
}
function showThisInBody(obj){
document.body.appendChild(obj);
}
</script>
</head>
<body>
<input type="button" onclick="createTable(10,2);" value="createTable(10,2)">
</form>
</body>
</html>
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
Please vote the message if it's useful.. Thanks.
|
|
|
|
|
Hello,
im trying to register a new website under IIS,but when i create DirectoryEntry object like this:
string IISPath = "IIS://" + ConfigurationManager.AppSettings["ServerName"].ToString() + "/W3SVC/1/Root";
DirectoryEntry oDE = new DirectoryEntry(IISPath);
and then try to check if it was created:
DirectoryEntry.Exists(IISPath);
application throws an exception:
Unknown error (0x80005000)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: Unknown error (0x80005000)
i thought this:
http://msdn2.microsoft.com/en-us/library/ms180891(vs.80).aspx would help,but i could do nothing with that primary token maybe i understood it not properly
Can anyone help,plz?
thenk You for attention
|
|
|
|
|
|
thnx,but the code i have is almost the same...but it still throws the exception
|
|
|
|
|
|
thanx,does that mean that smth is wrong with windows on server,not with code?..But i've got win 2003 server there,not 2000..:(So,still have no solution
|
|
|
|
|
Is anyone familiar with seam cropping?
How new is this?
|
|
|
|
|
You mean that seam-carving demo a few months back? Pulling out a minimum-entropy line from an image? AFAIK its within 3 months old. Probably patented up the wazoo too
|
|
|
|
|
Yep thats the one...
And patents for sure. Do you think its possible to seam carve a website to make it smaller but still active and usable??
|
|
|
|
|
Hrmmm. Typically websites are already quite structured. The information isnt usually that "spatial" compared to a photo.
I don't think that seam carving would be the technique to reduce a page's physical size.
If this is your website you could try messing around with an "importance" factor for each piece of content - and then use some kind of dynamic layout algorithm. Laying out content based on importance using a squarified treemap algorithm may have interesting results. Then you can set a minimum importance threshold to reduce the data needed.
|
|
|
|
|
Hi,
I have a demo site up and would like to be certain that if I have the following in my page that it will definately show not show up in a search engne:
What else do I need to add to be 110% sure?
Regards
|
|
|
|
|
I think you can specify the blocked page in robots.txt..
|
|
|
|
|
Create a robots.txt file in your root directory then just write these line in it:
User-agent: *
Disallow: /
This will prevent search engines like Google, Yahoo, Msn and all those who respect Robots.txt Protocol crawling your web site.
Hope it helps !
AliAmjad(MCP)
First make it Run THEN make it Run Fast!
|
|
|
|
|
So what about search engines that do not respect robots. Would it help him to put the website in a password protected area? Or is that too much?
|
|
|
|
|