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

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 13 October 2005 :  04:26:05  Show Profile  Visit MarcelG's Homepage
Good to see you got it working!

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

pdrg
Support Moderator

United Kingdom
2897 Posts

Posted - 13 October 2005 :  04:29:18  Show Profile  Send pdrg a Yahoo! Message
Woohoo!
Go to Top of Page

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 13 October 2005 :  05:42:10  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message
It was very easy to get the UserID and point
http://www.site.com/username
to
http://www.site.com/pop_profile.asp?mode=display&id=" & UserID & "
and tadaaa.. all users have their own little page on the world wide web. Now all I have to do is expand the use of the profiles (work is already in progress...) with their own blog/photo album and so on.

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

eauxvives
Junior Member

Bhutan
145 Posts

Posted - 02 January 2006 :  07:01:50  Show Profile
thanks tribaliztic, I reused and modified your code and now http://www.mysite.com/username points to http://www.mysite.com/forum/pop_profile.asp?mode=display&id=member_ID

However is it possible to make it so that the user still sees www.mysite.com/username in the address bar?

also, needless to say that the number 36 in
nonslashtext = textlength - 36

should be adjusted depending on the length of you website's name...
and then does not work if instead of www.mysite.com/username" target="_blank">http://www.mysite.com/username you enter for example http://mysite.com/username

Edited by - eauxvives on 02 January 2006 08:54:44
Go to Top of Page

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 09 January 2006 :  03:26:02  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message
I wanted it to show www.site.com/username also, but never got the time to look into it further, let me know if you find a way to do this =)

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

eauxvives
Junior Member

Bhutan
145 Posts

Posted - 10 January 2006 :  11:05:53  Show Profile
you could always use a frame, but that's a chicken way of doing it:
i.e. instead of
quote:
Response.Redirect "/forum/pop_profile.asp?mode=display&id=" & member_ID

use
quote:

response.write "<html><head><title>"&m_name&"</title></head>"& vbNewLine & _
"<frameset rows=""0,*"" frameborder=""NO"" border=""0"" framespacing=""0"">" & vbNewLine & _
"<frame name=""topFrame"" scrolling=""NO"" noresize>"& vbNewLine & _
"<frame src=""/forum/pop_profile.asp?mode=display&id="&member_ID&" "" name=""mainFrame"">"& vbNewLine & _
"</frameset><noframes><body></body></noframes></html>"


But I don't like it either

Edited by - eauxvives on 10 January 2006 11:07:05
Go to Top of Page

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 11 January 2006 :  08:25:14  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message
Nah, that's no solution I think =)

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

eauxvives
Junior Member

Bhutan
145 Posts

Posted - 17 January 2006 :  09:44:55  Show Profile
I thought that one way would be to do an include statement but I did not find how to pass an asp parameter within an include statement ?
ex <!--#INCLUDE FILE="pop_profile.asp?mode=display&id=<%member_ID%>"--> doesn't work...

Edited by - eauxvives on 17 January 2006 09:45:26
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 17 January 2006 :  11:12:14  Show Profile  Visit AnonJr's Homepage
quote:
Originally posted by eauxvives

I thought that one way would be to do an include statement but I did not find how to pass an asp parameter within an include statement ?
ex <!--#INCLUDE FILE="pop_profile.asp?mode=display&id=<%member_ID%>"--> doesn't work...


Includes don't work like that. Maybe a look at Server.Execute or Server.Transfer might give you some ideas.
Go to Top of Page

Nertz
Junior Member

Canada
341 Posts

Posted - 17 January 2006 :  11:46:32  Show Profile
quote:
Originally posted by eauxvives

I thought that one way would be to do an include statement but I did not find how to pass an asp parameter within an include statement ?
ex <!--#INCLUDE FILE="pop_profile.asp?mode=display&id=<%member_ID%>"--> doesn't work...


not sure if this would work, but worth a try....

<!--#INCLUDE FILE="pop_profile.asp?mode=display&id=<%=member_ID%>"-->

--- or ----

<!--#INCLUDE FILE="pop_profile.asp?mode=display&id=<%Response.Write(member_ID)%>"-->


cheers
Nat

Sadly, most Family Court Judges wrongfully reward opportunistic gold diggers
that use our children unjustly as "instruments" of power.


www.fathers-4-justice-canada.ca
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 17 January 2006 :  15:24:49  Show Profile  Visit AnonJr's Homepage
Includes don't work that way. They are processed before any scripts are run. Also, you can't pass any variables in the query string since all the statement does is grab the file and dump its contents into the location of the statement. (yes, that's a bit of an over-simplification.)

Server.Transfer and Server.Execute are probably your better bets. You can get the basics of them over at http://www.w3schools.com/asp/asp_ref_server.asp
Go to Top of Page

eauxvives
Junior Member

Bhutan
145 Posts

Posted - 25 January 2006 :  07:51:37  Show Profile
AnonJr
Thank you for the suggestion. I have tried this, very promising but:
you cannot pass special characters (thus parameters) in the address. In this case the problem seems to be caused by the question mark.
Example:
Server.Execute("pop_profile.asp?mode=display&id=2")
returns
An invalid character was specified in the Path parameter for the MapPath method.

see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iissdk/html/d47bdda3-96e1-46c3-b872-a038c2a61317.asp

Edited by - eauxvives on 25 January 2006 07:57:32
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 25 January 2006 :  08:43:14  Show Profile  Visit AnonJr's Homepage
I knew about not being able to pass variables along in the query string, but I had thought that there were other ways around it.

If you wanted to cheat you could probably just use an iframe, but that will open up more problems than it solves...

I wonder if there isn't a way to use some of the AJAX techniques to jimmy something to gether...

Anyway, those are just a couple of random thoughts made before the first cup of coffee. Hope you find something that works.
Go to Top of Page

ILLHILL
Junior Member

Netherlands
341 Posts

Posted - 26 February 2006 :  16:55:25  Show Profile
Can anybody tell me how they got this to work?

This is the code I'm working with as I have collected from this
topic:

quote:
<!--#INCLUDE FILE="forum/config.asp"-->
<%
dim textlength, nonslashtext
textlength = Len(Request.ServerVariables("QUERY_STRING"))
nonslashtext = textlength - 36
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?=" & strQString)
else
'link found, redirecting
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://forum.mysite.com/pop_profile.asp?mode=display&id=" & strQString & ""
end if
end if

%>


The textlength part is not really clear to me.
No matter which entry it redirects to the 404_2.asp page regardless.

Anybody willing to share how they got it to work?

Greets & thanks, Dominic

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

AnonJr
Moderator

United States
5768 Posts

Posted - 27 February 2006 :  06:10:33  Show Profile  Visit AnonJr's Homepage
probably because the 32 found in the nonslashtext line near the top is the length of the writer's URL. If yours is longer or shorter its probably cutting it off in the wrong place. Not sure if that's the only problem, but its a good place to start.
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.24 seconds. Powered By: Snitz Forums 2000 Version 3.4.07