Author |
Topic  |
eauxvives
Junior Member
 
Bhutan
145 Posts |
Posted - 27 February 2006 : 09:02:54
|
it would probably help (this is what I have done, anyway) to debug by adding on top of the code a line that says response.write Request.ServerVariables("QUERY_STRING") response.write strQString response.end
to give you an idea of what comes out in my case i discovered that the actual querystring on my site was 404;http://www.mysite:80/name and indeed I had to change nonslashtext = textlength - 36 to nonslashtext = textlength - 32 you should then play around with the number until sqrString comes out right |
Edited by - eauxvives on 27 February 2006 15:07:02 |
 |
|
ILLHILL
Junior Member
 
Netherlands
341 Posts |
|
ILLHILL
Junior Member
 
Netherlands
341 Posts |
Posted - 27 February 2006 : 17:50:35
|
What am I doing wrong, I tried
response.write Request.ServerVariables("QUERY_STRING") response.write strQString response.end
But I get different outcomes with different names of different lengths.
To which exact link is the "nonslashtext = textlength - X" part referring?
Cause my outcome is: http://www.mysite:80/name when entered name, but when entered names the link is messed up again.
Is this due to another error in my code?
|
CLPPR.com - All The News Only Seconds Away |
 |
|
tribaliztic
Senior Member
   
Sweden
1532 Posts |
|
ILLHILL
Junior Member
 
Netherlands
341 Posts |
Posted - 28 February 2006 : 11:50:57
|
Abybody willing to send me a copy of their working code so I can take it from there? I found out that the length is 29 which would be equal to: http://www.mysite.com/forum/ Setting it the ammount to http://www.mysite.com/ results in half cut off links, so maybe since the config.asp file is called from the forum directory I need to include that folder. However no matter which username I enter, it keeps redirecting to the 404_2.asp file instead of to the pop_profile.asp location. Also, I'm trying to have it redirect to http://forum.mysite.com can that cause problems with the link I added to that location?
dominic @ illhill.com
|
CLPPR.com - All The News Only Seconds Away |
 |
|
ILLHILL
Junior Member
 
Netherlands
341 Posts |
Posted - 28 February 2006 : 13:05:21
|
I changed this part and got a bit further:
Set linkRec = objConn.Execute ("SELECT * FROM FORUM_MEMBERS WHERE M_NAME = "" & link & "";") if linkRec.BOF or linkRec.EOF then Set linkRec = Nothing objConn.Close Set objConn = Nothing Response.Buffer = True Response.Clear Response.Redirect("404_2.asp?=" & strQString)
Changed this ("404_2.asp?=" & strQString) into: ("pop_profile.asp?mode=display&id=" & link)
It works a bit better, but the username is not translated/transformed into the member ID.
When I try http://www.mysite.com/username I get the message about an invalid Member ID and the link showing the entered username at the end, instead of the number of the id. http://www.mysite.com/pop_profile.asp?mode=display&id=username
I'm really lost. Posting of a working copy would be appreciated and I don't even mind giving somebody a cd or something from Amazon for this to help me out, especially since this is the last part of the blog software to get it working.
Greets & thanks, Dominic
|
CLPPR.com - All The News Only Seconds Away |
 |
|
tribaliztic
Senior Member
   
Sweden
1532 Posts |
|
ILLHILL
Junior Member
 
Netherlands
341 Posts |
Posted - 01 March 2006 : 16:24:04
|
Thanks...however still didn't get it to work.
My site's link is: http://www.illhill.com/ which would make 23 characters. The 404's located here: http://www.illhill.com/404.asp In case of invalid member names it redirects to: http://www.illhill.com/404_2.asp (the old 404 file, basically html tables, no scripts) I call the config.asp file from: http://blog.illhill.com/config.asp in the file it's: http://www.illhill.com/blog/config.asp
The username I tried with is "dominic" which is ID 2273 (http://blog.illhill.com/pop_profile.asp?mode=display&id=2273)
Here's the code. Can anybody spot a flaw?
quote:
<!--#INCLUDE FILE="blog/config.asp"--> <% dim textlength, nonslashtext textlength = Len(Request.ServerVariables("QUERY_STRING")) nonslashtext = textlength - 23 strQString = (Right(Request.ServerVariables("QUERY_STRING"),nonslashtext))
If (Len(strQString)> 0) Then 'start the redirect script
Dim linkRec Dim link Dim hits Dim newUrl Set objConn = Server.CreateObject ("ADODB.Connection") Set linkRec = Server.CreateObject ("ADODB.Recordset") 'get current link link = strQString 'Open database objConn.Open strConnString
Set linkRec = objConn.Execute ("SELECT * FROM FORUM_MEMBERS WHERE M_NAME = """ & link & """;")
if linkRec.BOF or linkRec.EOF then Set linkRec = Nothing objConn.Close Set objConn = Nothing Response.Buffer = True Response.Clear Response.Redirect("404_2.asp") else 'link found, redirecting UserID = linkRec("MEMBER_ID") objConn.Execute "UPDATE FORUM_MEMBERS SET PAGE_HITS = PAGE_HITS + 1 WHERE
M_NAME = """ & link & """" Set linkRec = Nothing objConn.Close Set objConn = Nothing Response.Buffer = True Response.Clear Response.Redirect "http://blog.illhill.com/pop_profile.asp?mode=display&id=" & UserID & "" end if end if %>
No matter what I do I continue ending up on the 404_2.asp page everytime I try: http://www.illhill.com/dominic (or other existing usernames).
Any ideas anybody?
I also tried:
response.write Request.ServerVariables("QUERY_STRING") response.write strQString response.end
Which results in: 404;http://www.illhill.com:80/dominiccom:80/dominic
I have basically tried any and every number instead of the 23, without any result 
I'm definitely lost at the moment...
Ps, thanks for the code Tribaliztic, I feel that I'm almost there!
Greets & thanks, Dominic
PS...do not pay attention to the blog software since it's far from done...
|
CLPPR.com - All The News Only Seconds Away |
Edited by - ILLHILL on 01 March 2006 16:33:21 |
 |
|
tribaliztic
Senior Member
   
Sweden
1532 Posts |
|
ILLHILL
Junior Member
 
Netherlands
341 Posts |
|
AnonJr
Moderator
    
United States
5768 Posts |
Posted - 02 March 2006 : 18:31:10
|
Just a wild guess, but you might want to check which domain its coming from first.... maybe using InStr() and Request.ServerVariables("HTTP_REFERER")?
Then, adjust accordingly.... |
 |
|
ILLHILL
Junior Member
 
Netherlands
341 Posts |
Posted - 04 March 2006 : 13:26:05
|
Thank all you guys so much! That Request.ServerVariables("HTTP_REFERER") gave me a result which showed I needed 30 as the value and I needed to remove the Update view count line.
Anon & Trib, the Amazon thing is still valid, thanks so much! Let me know.
Greets & thanks, Dominic (Yay, I can finally finish up the software with this out the way!)
You guys made my weekend!
Dominic
|
CLPPR.com - All The News Only Seconds Away |
 |
|
AnonJr
Moderator
    
United States
5768 Posts |
Posted - 05 March 2006 : 08:40:54
|
Glad its working. 
What else is left to finish? |
 |
|
ILLHILL
Junior Member
 
Netherlands
341 Posts |
Posted - 05 March 2006 : 12:53:54
|
Only the small things like some layout things and creating a comment page, so the actual blog can be read on a "clean" page.
And some mainpage layout things that I'm starting on as we speak/type :)
Greets, D |
CLPPR.com - All The News Only Seconds Away |
 |
|
tribaliztic
Senior Member
   
Sweden
1532 Posts |
Posted - 06 March 2006 : 04:36:42
|
"the amazon thing"?
|
/Tribaliztic - www.gotlandrace.se -
|
 |
|
Topic  |
|