|
Request.ServerVariables("AUTH_USER") will have domain name in front of it. i.e. the value should be "<<your domain="">>\ABC"
//Start of joke
Never comment ur code. If it was hard to write, it should be hard to understand !!!
//End of joke
|
|
|
|
|
Bee Master wrote:
Request.ServerVariables("AUTH_USER") will have domain name in front of it. i.e. the value should be "<<your domain="">>\ABC"
I think this goes for NT authentication,
any way i changes the condition to :
if len(Request.ServerVariables("AUTH_PASSWORD"))>0 then
Response.Write "user=" & Request.ServerVariables("AUTH_USER") & vbCrLf
Response.Write "PWD=" & Request.ServerVariables("auth_type")
else
Response.AddHeader "WWW-Authenticate","basic"
Response.Status="401"
Response.End
end if
but still does not work !!!
|
|
|
|
|
Don't forget that the AUTH_PASSWORD and AUTH_USER variables are going to be Base64 Encoded. You will need to unencode them to be able to test them against a value- .Net has some classes in the Texting namespace that should do the trick.
I also notice that you are setting just the Status property. Try setting the StatusCode property and StatusDescription seperatly.
ie. Response.StatusCode = 401; Response.StatusDescription="Unauthorized
"
|
|
|
|
|
Also, I think the header needs to have a realm.
WWW-Authenticate: Basic realm="WallyWorld"
http://www.w3.org/Protocols/HTTP/1.0/draft-ietf-http-spec.html#WWW-Authenticate
Gives more details.
|
|
|
|
|
thank you..
but encoding is sill a coming problem
even if I check for the length of the AUTH_PASSWORD server variable i get 0 !!!
|
|
|
|
|
Hi,
AUTH_USER and AUTH_PASSWORD are populated by IIS if it requested the authentication itself.
You need to check the HTTP_AUTHORIZATION variable. This will be Base64 encoded and will encompass both the username and password. See the specification I posted earlier to figure out how it is put together.
|
|
|
|
|
HTTP_AUTHORIZATION is the answer !!
thanks alot
now the next step is to decode the Base64 encoded string..
wish me luck
|
|
|
|
|
.Net provides a class to do that for you.
Try looking under System.Text
|
|
|
|
|
yes
i know it already exists in .net but i can't use .net for this project.
so i'll have to do it myself
|
|
|
|
|
http://www.freevbcode.com/ShowCode.asp?ID=5248
This should do the trick.
|
|
|
|
|
again (5)
i was going to code it myself .. now i'll reuse the code
many thanks.
|
|
|
|
|
and need not an activex.
the small,the better..
I just found Battleaxe forum,but it is not open now...
thanks.
|
|
|
|
|
There is a PHP port of these message boards, but IMHO they suck a*s...the author uses every bad technique in PHP possible
However you can use it as a template and start from there...
Threaded message boards are not easy...probably the most difficult PHP script I ever wrote...requires crazy recurssion (my design did anyways) and other rocket science type stuff... jk...it's not that bad...
Other than CP I have never seen any nice looking threaded forums...always linear(???)...I imagine becuz it's more efficient, but not as easy on the eyes
How do I print my voice mail?
|
|
|
|
|
You can get the code for the Code Project forums right here.
regards,
Paul Watson
Bluegrass
South Africa
Chris Maunder wrote:
"I'd rather cover myself in honey and lie on an ant's nest than commit myself to it publicly."
Jon Sagara replied:
"I think we've all been in that situation before."
Crikey! ain't life grand?
|
|
|
|
|
I'll hold my hand up now and say ASP is not my strong point, and I'm struggling to get my head around arrays in ASP. I'm currently trying to build a content management system which will allow people to add content to a hierachial structure.
In the database their is a sectionpath stored for each entry which shows the relationship to other items within the table, therefore the string returned could look like this: 0.1.17.30
What I then do is split the string and place in an array and build the a number of select menus as I loop through the array - in this instance 3, which will be labelled section0, section1, section2.
Obviously the sectionpath is different each time and the only way I could think to read the variables passed would be to parse the contents of the Request.Form collection in to a 2d array giving the fieldname and fieldvalue.
My problem is how do I loop through this 2d array and check whether a section has a null value??? Sorry if that was a bit long winded.
Code:
For ix = 1 to Request.Form.Count
fieldName = Request.Form.Key(ix)
fieldValue = Request.Form.Item(ix)
FormArray = Split(fieldValue, ", ", 1) ' split these and place in an array
FormArray = Split(fieldName, ", ", 2)
Next
|
|
|
|
|
A.vb
Class A
{
new class a()
{
// code to print "hello" on the browser
}
}
webform1.aspx.vb
onpageload()
{
dim myobj as new a();
}
what do i neet to write in the class at //?
|
|
|
|
|
Return what you want outputted to the browser. e.g. public string ClassADoSomething() and then from webform1.aspx.vb Response.Write (a.ClassADoSomething()); .
You don't want to bind your classes to the medium unless they are specifically web classes in which case inherit the class as a control.
regards,
Paul Watson
Bluegrass
South Africa
Chris Maunder wrote:
"I'd rather cover myself in honey and lie on an ant's nest than commit myself to it publicly."
Jon Sagara replied:
"I think we've all been in that situation before."
Crikey! ain't life grand?
|
|
|
|
|
Hi, EveryBody,
I want to display pictures stored in a database. First I use the following code(VB6) to save the picture to the database:
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Dim stream As New ADODB.stream
Set cnn = New Connection
cnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=H:\test.mdb;"
cnn.CursorLocation = adUseClient
cnn.Open
Set rst = New Recordset
rst.ActiveConnection = cnn
rst.Open "t1", cnn, adOpenKeyset, adLockOptimistic
rst.AddNew
rst!p_name = "dd"
stream.Type = adTypeBinary
stream.Open
stream.LoadFromFile "H:\pp.jpg"
rst!pic = stream.Read
Set stream = Nothing
rst.Update
cnn.Close
------------------------------
and then I use the following code(ASP) to display the image:
<%
Dim cnn
Dim rs
' Clear existing HTTP header info
Response.Expires = 0
Response.Buffer = TRUE
Response.Clear
' Set the HTTP header to an image type.
Response.ContentType = "image/JPEG"
cnnPubs=getdbconn() ' the function return the db connection
set rs=server.CreateObject("adodb.recordset")
rs.Open "SELECT FROM t1where id=1",cnn
Response.BinaryWrite rst("pic")
Response.End
%>
and I use to show the image.
the first(vb) code works well.
but I alway can not display the image, I just got a image like red X.
please help me to solve the problem.
Thanks a lot!!!
Best!
Alan
|
|
|
|
|
I do not have admin access to my site's web server, also I don't seem to be able to connect via telnet.
I need to load a new perl module to my personal /lib directory. Can this be done simply by running a CGI script somehow?
Seems like I should be able to run
#!/blah/bla/perl makeperl.pl LIB=/mylib
or something along those lines. Would this work right? Is there more required?
BW
The Biggest Loser
"And then one day you find ten years have got behind you No one told you when to run, you missed the starting gun"
|
|
|
|
|
You should have the rights for installing additional modules. Why don't you just ask your web hosting provider to install it for you ?
YasHost.com - MULTIPLE Domain Hosting on Fast Servers
|
|
|
|
|
I can understand why they don't give rights to the primary perl library to everyone.
I know it is possible to install below my ~ directory, but was wondering if I can do this via a script for simplicity. I can email my host, but I was curious how to solve the problem on my own. I'm not that familiar with the process of installing modules, and was hoping to learn a bit more about it, before having expectations that something should work, and get frustrated out of ignorance.
I'll probably take your advice for now though, thanks.
BW
The Biggest Loser
"And then one day you find ten years have got behind you No one told you when to run, you missed the starting gun"
|
|
|
|
|
Hi,
I am having a japnese team site developed in sharepoint portal server 2003 with OS as Windows server 2003. It is on a laptop. I want to copy the site on another computer having SPS 2003 and Windows Server 2003. I took backup and restored on the new computer. Also copied the extra folders with dlls for custom web parts. However, when I open the site as http://localhost:300/sites/sales, error is shown as "File Not Found" and in address bar, there is error as http://localhost:300/sites/sales/_layouts/1041/error.aspx?ErrorText=List does not exist The page you selected contains a list that does not exist. It may have been deleted by another user. Click Home at the top of the page to return to your Web site.
What can be the reason. I have spent around 3 days on this issue . Please help.
Thanks a lot in advance
Navneet
|
|
|
|
|
Hi,Everybody,
How to use ASP(Vbscript/ADO) to display the picture stored in a database? also I want to display some text or other information.
Please give me an example!!!
Thanks very much!!
Alan
|
|
|
|
|
Check this article, there is an example code too:
http://www.freevbcode.com/ShowCode.asp?ID=1802
YasHost.com - MULTIPLE Domain Hosting on Fast Servers
|
|
|
|
|
I want to connect to a server that sends mp3-data to my server.
When I open a .asp or aspx I want to hear the sound sent from my server and not the server sending the data since that server is blocked for other IP-numbers.
Suggestions?
sssss
|
|
|
|