Jump to content

joecool2005

Members
  • Posts

    245
  • Joined

  • Last visited

Posts posted by joecool2005

  1. I have a windows application that is calling a web server. Here is my scenario.

    1) The windows app calls the webserver for authentication. If authenticated, the webserver will send back the session Id to windows app.

    2) Once is authenticated, the windows app will make another call to webserver to get some value by sending the session Id.

    3) The  web server will check if the session Id exists. If yes, that means the windows app was authenticated and the web server can send back the data.

     

    So I need to check if the session ID exists. I don't know how. Any idea?

  2. Hi

    I have this simple code

    <html>
    <head>
        <script>
            function addTable() {
                document.getElementById("one").insertAdjacentHTML('beforebegin', '<table border=1><tr><td>');
                document.getElementById("one").insertAdjacentHTML('afterend', '</td></tr></table>');
            }
        </script>
    </head>
    <body onload="addTable()">
        <div id="one">one</div>
    </body>
    </html>

    When I called insertAdjacentHTML, why it does not do this?

    <table border=1><tr><td>
                    <div id="one">one</div>
        </td></tr></table>

    Thanks,

     

  3. Hi,

    I have an html like this

                               <input type="submit" value="Submit" class="zoom_button" />
                                <span class="zoom_results_per_page">
                                    <label for="zoom_per_page">Results per page:</label>
                                    <select name="zoom_per_page" id="zoom_per_page">
                                        <option selected="selected">10</option>
                                        <option>20</option>
                                        <option>50</option>
                                        <option>100</option>
                                    </select><br /><br />
                                </span>

    I would like to insert the div tag like this

                          <div class="zoom_searchform">
                                <input type="submit" value="Submit" class="zoom_button" />
                                <span class="zoom_results_per_page">
                                    <label for="zoom_per_page">Results per page:</label>
                                    <select name="zoom_per_page" id="zoom_per_page">
                                        <option selected="selected">10</option>
                                        <option>20</option>
                                        <option>50</option>
                                        <option>100</option>
                                    </select><br /><br />
                                </span>
                            </div>

    How can I do that in javascript?

    Thanks

  4. Hi,

     

    In ASP classic, when I call "request.form", my application crashes.

     

    I'm using Windows Server 2012 R2 with IIS 8.5.

     

    But in Windows 7 with IIS 7.5, the same code works.

     

    Here's my code

    <html>
    <head>
    
    <%
     response.write(request.form("fname"))
     response.write(" " & request.form("lname"))
     %>
    </head>
    <body>
    
    <form method="post" action="simpleform.asp">
     First Name: <input type="text" name="fname"><br>
     Last Name: <input type="text" name="lname"><br><br>
     <input type="submit" value="Submit">
    </form>
    
    </body>
    </html>
    
    

    Please help

     

    thanks

     

     

     

     

     

     

     

     

     

     

     

     

  5. Hi,

     

    I have a cookie with specific key like this

    Response.Cookies("user")("firstname")="John"Response.Cookies("user")("Lastname") ="Smith"Response.Cookies("user").Path = "/"&"; HttpOnly"Response.Cookies("user").Secure = TrueResponse.Cookies("user").Expires = DateAdd("m",15,Now())

    How do you use Response.AddHeader when the cookie "user" has multiple keys? I want the cookie in mode HttpOnly and secure=true.

     

    Thanks

     

  6. Hi, In this code

    Dim email As String = "this is a test"		Dim password As String = "YOUR PASSWORD"		Dim URLAuth As String = "http://test.ca/webrequest.asp"		Dim postString As String = "inputEmailHandle=this is a test&inputPassword=" + password		Dim byteArray As Byte() = Encoding.UTF8.GetBytes(postString) 		Const contentType As String = "application/x-www-form-urlencoded"		System.Net.ServicePointManager.Expect100Continue = False		Dim cookies As New CookieContainer()		Dim webRequest__1 As HttpWebRequest = TryCast(WebRequest.Create(URLAuth), HttpWebRequest)		webRequest__1.Method = "POST"		webRequest__1.ContentType = contentType		webRequest__1.CookieContainer = cookies		webRequest__1.ContentLength = byteArray.Length		webRequest__1.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1"		webRequest__1.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"		webRequest__1.AllowAutoRedirect = True		webRequest__1.Referer = "https://www.google.ca/"		Dim requestWriter As Stream = webRequest__1.GetRequestStream()		requestWriter.Write(byteArray, 0, byteArray.Length)		requestWriter.Close()		Dim resp As WebResponse = webRequest__1.GetResponse()		Response.Write(CType(resp, HttpWebResponse).StatusDescription)		requestWriter = resp.GetResponseStream() 		Dim responseReader As New StreamReader(requestWriter)		Dim responseData As String = responseReader.ReadToEnd()		Response.Write(responseData + "---")		responseReader.Close()		requestWriter.Close()		webRequest__1.GetResponse().Close()

    Instead of displaying "this is a test" is displays "thisisatest"Any idea why the spaces are not preserved? Thx

  7. Hi, In global.asa when I create a cookie with HttpOnly like this Response.Cookies("mycookie")("x") = "abc";Response.Cookies("mycookie").Path ="/; HttpOnly") it displayed me this path=/%3B%20HttpOnly How can I fix this in global.asa? ThxJoe

  8. Hi, In the following query

    select o.Price,	 t1.EnglishMessage  from Products p,   OrderItems o   LEFT JOIN TranslateMessage t1 ON p.ProductName= t1.TranslateMessageIDwhere p.ProductID = o.ProductID and	o.OrderId=62

    I got the following errorThe multi-part identifier "p.ProductName" could not be bound. Sounds like it does not like when I use more than one table.Any solution? Thx

  9. Hi,Do you know how to call a web-service?I need to send a ouput stream to a web service. And then the web-service will read as a input stream.Thx for your help.Joe

  10. Hi,Is it possible to submit the file automatically?This how I do manually.-------------------------------------------------------------------<form name="oForm" action="/scripts/cpshost.dll?PUBLISH?<%=Application("PostingAcceptorUploadServerLocation")%>/scripts/charles/addTask.asp" enctype="multipart/form-data" method="post"><input type="file" name="oFile1" size="20"><input type="hidden" name="TargetURL" value="<%=Application("FileAttachments")%>/charles/"><p align="center"><input type="submit" value="Upload File"></p></form>-------------------------------------------------------------------Now I need to do automatically. As soon as the user go the page, the file should be submitted.So I need to assign a value to <input type="file" name="oFile1" size="20">. I don't know how.Thx

  11. Hi,Thanks for your help.I try to execute your code and I have an error on this lineMatches = regex.Execute(data)It says "Wrong number of arguments or invalid property assignment "My data contains a long XML string and there is no newline.thx

  12. Hi,I have a really big string inside a variable "data".When I did Response.Write(data), I was able to display all the string.But when I did objFile.WriteLine(data) to a file, I was not able to write all the string in the file. It was truncated.Why?What should I do?Thx

  13. Thanks for your helpBut unfortunately, the XML code is sent by using a URL.Then I do request.querystring to get the xml code like this data=request.querystring ("xmlCode")When I do Response.Write(data), the white space is removed.So this is my code so far and i'm stuckdata=request.querystring ("xmlCode")dim myXMLDomset myXMLDom = server.CreateObject("Microsoft.XMLDOM")myXMLDom.async = falsemyXMLDom.preserveWhiteSpace = truemyXMLDom.loadXML(Data)....(I don't know what to do after to display the code)Thx

  14. Hi,I'm not familiar with XML.I have a code like this:dim myXMLDomset myXMLDom = server.CreateObject("Microsoft.XMLDOM")myXMLDom.async = falsemyXMLDom.loadXML(Data)How can I display all the XML code?I have tried this but it does not workResponse.Write(myXMLDom.xml)

×
×
  • Create New...