|
instead of passing the username as the identifier to retrieve the profile info why don't you try passing a unique numerical value which also identifies the profile. This way there are never going to be any spaces to be worried with and your URL should always work.
Using the integer identifier assumes all of the profiles are held in a database and using integer type identifiers.
nick
|
|
|
|
|
I wonder how does the script in CP forums know when to append the "new!" icon at the subject line of the message. It can not be just because of the date of posting. I've tried hitting every message that I saw with that icon and went to attend some of my work for a while, went back to the forum and found that the messages that I have visited a while ago don't have the icon anymore!
Any hint? Do I smell cookies here? Maybe it's a simple one that I am missing ... Tnx!
(just like after I submit this, I am expecting to see the "new" icon in yellow!)
|
|
|
|
|
From what I can tell it takes the date/time of sign in, then marks any post that occured after that date/time as new.
You need to remember that your sign in date/time isn't neccesarily the last time you put your username/password in. When the session object times out on the server you will be 'logged out' of the system, but when you hit the page again it will automatically log you in assuming you have it set to do so.
James
Simplicity Rules!
|
|
|
|
|
I see. So the script simply displays the icon if the message posting date is greater than the "last visit". Tnx!
|
|
|
|
|
So, here's my technical question for the day. I have a really cool idea for my new web site's architechture. Problem is, I don't know if IIS is capable of it, or exactly how it would do so. Here goes:
I want all my data to be a combination of my own proprietary XML format and XHTML. Something like:
<small>
<?xml version="1.0"?>
<Page xmlns:XHTML="http://www.w3.org/1999/xhtml">
<Head>
<Title>Site Map</Title>
<Image Width="200">Images/SiteMap.gif</Image>
</Head>
<Body>
<XHTML:p>
The site map is designed to help you find exactly what you're looking
for on the MadHamster Creations website. It allows quick and easy
lookup of and access to every file and page on the site, giving you the
ability to get to exactly what you need as fast as possible.
</XHTML:p>
<XHTML:center>
<XHTML:div>Choose the organizational structure you prefer:</XHTML:div>
<XHTML:table>
<XHTML:tr>
<XHTML:td><Link Href="javascript:OpenFileSiteMap()" Status="..." Comment="...">By Files</Link></XHTML:td>
<XHTML:td><Link Href="javascript:OpenPageSiteMap()" Status="..." Comment="...">By Pages</Link></XHTML:td>
</XHTML:tr>
</XHTML:table>
</XHTML:center>
</Body>
</Page>
</small>
Pretty cool, huh? Pure data, no layout. Anyway, because I can't rely on the client having IE6 (for XSL stuff), of course all my XML transformation will be done on the server side. This is where things get fuzzy...
My plan is to have on ASP.NET (.aspx) page, which takes as an argument (PageWriter.aspx?doc=ThatDoc.xml ) the XML document to translate. However, I was wondering if there was anyway NOT to have that ugly URL show up in the browser. You see my drift? A simple ThatDoc.xml would be best, although perhaps a ThatDoc.aspx , ThatDoc or Content/ThatDoc.xml would work as well if it would be easier.
I've heard something about this before, somewhere, in some MSDN magazine article perhaps? Anyway, my computer with IIS is still dead ( ), but just give me an idea which of the above, if any, is good, because I'm writing my XML on this Win98 machine ( ), and would like to know which I can use before I start plugging URLs into my link tags.
Thanks in advance, and I'm sorry I couldn't find the write forum, but this doesn't seem to fit anywhere, and everybody ignores anything not in the lounge NEway...
-Domenic Denicola- [CPUA 0x1337]
MadHamster Creations
"I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
|
|
|
|
|
I think HttpHandlers will do the trick.
cheers,
Chris Maunder
|
|
|
|
|
So in regards to filling in my link tags, does that mean I can map it onto ThatPage.xml?
-Domenic Denicola- [CPUA 0x1337]
MadHamster Creations
"I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
|
|
|
|
|
You can only map it to types that ASP.NET is in charge of handling. I just took a quick look on this box and I don't see it in the IIS MMC snapin.
If you look in the machine.config file (located in the %WINDIR%\Microsoft.NET\Framework\%DOTNETVERSION%\Config directory) you will see a section called httpHandlers , it looks like this is where it tells IIS what types ASP.NET will be handling.
You can add a new handler in this list to specify what should be done when that file is requested, if the HttpHandler documentation isn't good you can check the source to the provided handlers with ILDASM or Anakrino to see how they work.
James
Simplicity Rules!
|
|
|
|
|
James T. Johnson wrote:
it looks like this is where it tells IIS what types ASP.NET will be handling.
So would I be better coming up with my own file type, e.g. .mhc (the page is for my "company", MadHamster Creations)? That way I could have any files of that type be handled as I wanted? Keep in mind, at this point I just want a vague idea of what's possible and what's not, and most importantly, what exactly I should put in my <Link> tages in the meantime!
-Domenic Denicola- [CPUA 0x1337]
MadHamster Creations
"I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
|
|
|
|
|
Domenic [CPUA 0x1337] wrote:
So would I be better coming up with my own file type, e.g. .mhc
Yes, I would; otherwise your handler is going to be called whenever an xml file is requested; which isn't a good thing, especially if you plan on sharing the server with others (outside of your company or other developers who don't know about your handler).
I know I've seen an example somewhere of creating an HttpHandler, but I can't find a reference to it now
James
Simplicity Rules!
|
|
|
|
|
The last msdn mag came with a excellent article about httphandlers
Reality.sys is corrupted!
Reboot the universe Y/N?
|
|
|
|
|
Ah, I C. Sorry about the wrong forum thing Chris
-Domenic Denicola- [CPUA 0x1337]
MadHamster Creations
"I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
|
|
|
|
|
Custom HttpHandlers should work (Chris already mentioned this.)
Another way you could do this would be to create a Custom 404 handler. Let people type in ThatDoc.asp (or ThatDoc.whatever), see if it is actually your XML file and if so render it, otherwise do standard 404 stuff.
|
|
|
|
|
I need to have my SQL perform a search on the following table:
Table: News
==================================================
PKID Source newsText newsURL|
==================================================
00001 Microsoft Something www.ms.com
00002 Sun Something www.sun.com
00003 Apple Something www.apple.com
...And so on
SELECT * FROM News
Would fill my recordset with all the fields from the News table. However in my site I have an options feature where users can select News by Source
Microsoft
Apple
Sun
Intel
Etc...
These options are stored in cookies and are later used in displaying the news. Depending on the news source options selceted only certain feilds should be displayed.
What would be the best way of doing this...?
Should I use seperate Select statements for each option checked...?
Like this?
If microsoftNews.checked = true Then
SELECT * From News WHERE Source = 'Microsoft'
'Iterate the recordset and display news items
Else If sunNews.checked = true Then
SELECT * FROM News WHERE Source = 'Sun'
'Iterate the recordset and display news items
Else If appleNews.checked = true Then
SELECT * FROM News WHERE Source = 'Apple'
'Iterate the recordset and display news items
End if 'Etc...
Or should I generate the entire SQL statement depending on options checked...?
I tried this earlier but it turned out to be harder than I desired.
I hope I explained myself clearly...
Any suggestions...?
Thanx!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
I am not sure if I've understood your question correctly... Is this what you are looking for?
Dim SQL, Keyword
Select Case True
Case microsoftNews.checked
Keyword = "Microsoft"
Case sunNews.checked
Keyword = "Sun"
Case appleNews.checked
Keyword = "Apple"
Case Else
Keyword = ""
End Select
SQL = "SELECT * From News WHERE Source = '" & Keyword & "'"
'Iterate the recordset and display news items
|
|
|
|
|
Nope, sorry!
The news feed should only display news by topic of interest (selected by user and stored in cookies).
So if Microsoft and Sun and Apple and Intel are checked AND AMD and Adobe and Claris are NOT checked, then I must construct some SQL statement on the fly according to the options set.
Select case True
Case microsfotNews.checked
Keyword = Keyword + "Microsoft"
...And so on...
I'm wondering if it would be easier to just use seperate SQL statments for each checkbox fill a recordset write it to screen and move onto the next...?
Sorry if i'm unclear, but it's super early in the morning and i'm just ready to goto sleep.
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
You can try this
Select * from News Where Source In ('pref1', 'pref2', 'pref3', 'pref4', ...)
It may or may not be case sensitive, I think that depends on the database settings.
James
Simplicity Rules!
|
|
|
|
|
Well, then James is right and your code should look like this:
Dim SQL, Keywords
<br> <br>
Keywords = ""
<br> <br>
If microsoftNews.checked Then
Keywords = Keywords & "'Microsoft',"
End If
If sunNews.checked Then
Keywords = Keywords & "'Sun',"
End If
If appleNews.checked Then
Keywords = Keywords & "'Apple',"
End If
<br> <br>
If Len(Keywords) > 0 Then
' Remove last comma
Keywords = Left(Keywords, Len(Keywords) - 1)
End If
<br> <br>
SQL = "SELECT * From News WHERE Source IN (" & Keywords & ")"
'Iterate the recordset and display news items
|
|
|
|
|
Sweet i'll try it out and hope for the best.
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hello,
I have been trying with no success to use this NewMail object on the
CDONTS library. It is very simple to script this, but I get a VBScript
Runtime error as follows:
'800a0046' Permission Denied
This occurs in my ASP page.
The script looks like:
dim oMail
set oMail = Server.CreateObject("CDONTS.NewMail")
oMail.Send "NoReply@www.abc.com", "abc@xyz.net"
Does anybody have any idea why I would get this runtime error when I execute the Send method?
Best Regards,
|
|
|
|
|
Hello:
How to open a password protected MS Access database using
ASP?
Is it possible at all?
Thanks in advance.
|
|
|
|
|
Dim strConn
' The following provider works for Access 97 and Access 2000, but
' is supposedly more stable w/ Access 2000.
' (In the db be sure Tools | References | Microsoft ActiveX Data Objects 2.5 Library is checked.)
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/mydbdir/mydb.asp") & ";Jet OLEDB:Database Password=mypassword;"
Best regards,
-Paul
Web Database Developer
To help you put live data on the Web...
http://www.Bullschmidt.com
|
|
|
|
|
I have a web page where I have text files (some with HTML commands included) that are loaded into a page using FSO. I can't get the text to wrap properly when it is loaded into a table - it just keeps extending across the page, pulling the whole layout out of whack. I have no idea why this happens, as the text theoretically should just wrap within the table.
What I am wondering is if anyone knows a way to go through the text file, and once say 80 characters has been exceeded, replace the next available space between words with a line break? and then keep going through all the text until each line is roughly 80 characters or so long. (I just don't want to end up cutting up any HTML commands) e.g. I wouldn't want to end up with <bod<br>Y>. Of course, if you had any lo-tech ideas as to fixing up the display of a text file read into a table, then that'd be just as good...
|
|
|
|
|
If you are using the FSO object then just append a "<br>" at the end of your WriteLine method.
HTH
Nick Parker
|
|
|
|
|
I want to create a web page where the user inputs
some number, I multiply that number by some special
number and it returns a new number. Here is the catch,
the special number is important to me and I don't
want other people to know what that number is. If I
just use java or simple html, anyone can go to Edit/
View Source and see my special number.
Is there any way of doing this? Or is there a way
to make html execute some simple c++ program and then
retrieve the number that it returns. I can easily write
something in c++ to multiple the user inputted number
with my number and return the new number, but I don't
know how to get html to execute a c++ file.
Any ideas? Any thoughts? Any code?
Any response you can give me will be greatly appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|