Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 users own page
 New Topic  Topic Locked
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 4

eauxvives
Junior Member

Bhutan
145 Posts

Posted - 27 February 2006 :  09:02:54  Show Profile
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
Go to Top of Page

ILLHILL
Junior Member

Netherlands
341 Posts

Posted - 27 February 2006 :  14:14:05  Show Profile
Which url is the textlength referring to?
http://www.mysite.com/forum/pop_profile.asp (44) ?

or it it referring to the ammount of characters in the url to the 404?
http://www.mysite.com/404.asp (29)

Thanks, D

CLPPR.com - All The News Only Seconds Away
Go to Top of Page

ILLHILL
Junior Member

Netherlands
341 Posts

Posted - 27 February 2006 :  17:50:35  Show Profile
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
Go to Top of Page

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 28 February 2006 :  04:34:15  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message
quote:
Originally posted by ILLHILL

Which url is the textlength referring to?
http://www.mysite.com/forum/pop_profile.asp (44) ?

or it it referring to the ammount of characters in the url to the 404?
http://www.mysite.com/404.asp (29)

Thanks, D



http://www.mysite.com/ <-- this is the text you should know the length of..
My site is http://www.gotlandrace.se/ and I use textlength = 26.

/Tribaliztic
- www.gotlandrace.se -
Go to Top of Page

ILLHILL
Junior Member

Netherlands
341 Posts

Posted - 28 February 2006 :  11:50:57  Show Profile
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
Go to Top of Page

ILLHILL
Junior Member

Netherlands
341 Posts

Posted - 28 February 2006 :  13:05:21  Show Profile
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
Go to Top of Page

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 01 March 2006 :  05:17:09  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message
This is my working code, I pointed my IIS to use this page as my 404-page.

http://www.gotlandrace.se/tabort/404_page.txt

/Tribaliztic
- www.gotlandrace.se -
Go to Top of Page

ILLHILL
Junior Member

Netherlands
341 Posts

Posted - 01 March 2006 :  16:24:04  Show Profile
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
Go to Top of Page

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 02 March 2006 :  05:39:42  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message
What is your "forum url" setting in admin home/main forum configuration?
I don't know where the ":80/dominiccom:80/" is coming from?
Also, I have the same domain in both places:

http://www.gotlandrace.se/username
points to
http://www.gotlandrace.se/pop_profile.asp?mode=display&id=" & UserID & ""

You have different domains...
Maybe that's what's causing the problem...

/Tribaliztic
- www.gotlandrace.se -
Go to Top of Page

ILLHILL
Junior Member

Netherlands
341 Posts

Posted - 02 March 2006 :  17:21:48  Show Profile
The link in the admin profile is http://blog.illhill.com/
I also tried setting the ammount to 24.

One thing I notice is when I try to visit http://www.illhill.com/blog/dominic or http://blog.illhill.com/dominic it results in this message:

"Redirection limit for this URL exceeded.
Unable to load the requested page.
This may be caused by cookies that are blocked." (Firefox)


CLPPR.com - All The News Only Seconds Away
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 02 March 2006 :  18:31:10  Show Profile  Visit AnonJr's Homepage
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....
Go to Top of Page

ILLHILL
Junior Member

Netherlands
341 Posts

Posted - 04 March 2006 :  13:26:05  Show Profile
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
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 05 March 2006 :  08:40:54  Show Profile  Visit AnonJr's Homepage
Glad its working.

What else is left to finish?
Go to Top of Page

ILLHILL
Junior Member

Netherlands
341 Posts

Posted - 05 March 2006 :  12:53:54  Show Profile
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
Go to Top of Page

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 06 March 2006 :  04:36:42  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message
"the amazon thing"?

/Tribaliztic
- www.gotlandrace.se -
Go to Top of Page
Page: of 4 Previous Topic Topic Next Topic  
Previous Page | Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.26 seconds. Powered By: Snitz Forums 2000 Version 3.4.07