Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

user.cgi: bug..

Quote Reply
user.cgi: bug..
i remember reporting this in links sql b1.2..

but here i go again..

in sub signup_user...

find
Code:
$db->add_record ( $in_r );

replace with:
Code:
$db->add_record ( $in_r ) or &site_html_signup_form ( { error => $Links::DBSQL::error, %{$in_r} }, $dynamic ) and return;

find:
Code:
$db->add_record ( $in_r ) or &site_html_signup_form ( { error => $Links::DBSQL::error, %{$in_r} }, $dynamic );

replace with:
Code:
$db->add_record ( $in_r ) or &site_html_signup_form ( { error => $Links::DBSQL::error, %{$in_r} }, $dynamic ) and return;

jerry

[This message has been edited by widgetz (edited December 10, 1999).]
Quote Reply
Re: user.cgi: bug.. In reply to
also.. is there an easier way to do this:

www.pdamania.com/users/PDAmania
www.pdamania.com/users/jsu7785

just simple little profiles.. but right now i'm using this in my .htaccess..

Code:
ErrorDocument 404 /profile.cgi

and in profile.cgi i put

Code:
($user) = $ENV{'REDIRECT_URL'} =~ m,^/users/([^/]+)$, if (!$user);

for some reason.. i don't think that's the best way.. but i like how it doesn't actually show it redirected..

jerry

[This message has been edited by widgetz (edited December 10, 1999).]
Quote Reply
Re: user.cgi: bug.. In reply to
Couple different ways you could do this:

1. Use Redirect:

Redirect /users /cgi-bin/profile.cgi

which will redirect all requests that start with /users to profile.cgi and you'll find the info in $ENV{PATH_INFO}.

2. Use mod_rewrite

RewriteEngine on
RewriteCond %{REQUEST_URI} /users
RewriteRule ^/users/(.*) /cgi-bin/profile.cgi?user=$1

and that will redirect completely silently to the browser to profile.cgi and pass in the user as user=username. Syntax might be a little off, been a while since I used rewrite.

3. With cgi-bin:

You could name your profile.cgi 'users' and then make links like:

/cgi-bin/users/abcde
/cgi-bin/users/alex

etc. It does mean you have to add in the /cgi-bin though.

Hope that helps,

Alex
Quote Reply
Re: user.cgi: bug.. In reply to
Alex,

I had tried to use redirection from a short url to a cgi file, and was getting very odd results with Apache.

I know I'm missing something, but just in case others have the same problems, I was getting the cgi file displayed as text (a security problem) and was having other problems.

Before tampering with server settings, make sure you know what you are doing -- and hopefully someone will post "the" answer. I have not had time to research it any further, than I have used sym-links to shorten some directory paths -- but STILL have not been able to run cgi programs as an alias

(I have cgi turned off on my server, except for the cgi-bin directory, and that may be the root of the problem.... but others will hit it too, I'm sure!)