Query string without '?' ... ?

B

burak

Hey guys,

I need to be able to pass a query string to a script without using
the question mark, ie:

http://www.domain.com/scriptname/arguments_here

I know it's possible to create a new directory and have the htaccess'
DirectoryIndex point to the index.cgi, but that yields:

http://www.domain.com/directoryname/?querystring

I need to eliminate that question mark... is this possible? (I know
it's possible on Ruby on Rails, but I'm not sure about perl...)


Any Ideas? Thanks in advance,


Burak
 
J

Jürgen Exner

I need to be able to pass a query string

Query string? What's a query string?
to a script without using the question mark, ie:

Well, then don't use a question mark.
perl foo.pl AndHereComesMyArgument
works perfectly fine. No question mark anywhere.


Oh, this is a CGI/WebServer/HTTP question in disguise.
I know it's possible to create a new directory and have the htaccess'
DirectoryIndex point to the index.cgi, but that yields:

http://www.domain.com/directoryname/?querystring

I need to eliminate that question mark... is this possible? (I know
it's possible on Ruby on Rails, but I'm not sure about perl...)\

That solely depends on your web server and has nothing to do with Perl at
all.

You may want to ask in a NG that actually deals with CGI/WebServers/HTTP.

jue
 
M

Michael Greb

Hey guys,

I need to be able to pass a query string to a script without using
the question mark, ie:

http://www.domain.com/scriptname/arguments_here

I know it's possible to create a new directory and have the htaccess'
DirectoryIndex point to the index.cgi, but that yields:

http://www.domain.com/directoryname/?querystring

I need to eliminate that question mark... is this possible? (I know
it's possible on Ruby on Rails, but I'm not sure about perl...)


Any Ideas? Thanks in advance,


Burak

Yes this is possible but it is more of a web authoring/cgi question then
a perl question.
 
J

John Bokma

Hey guys,

I need to be able to pass a query string to a script without using
the question mark, ie:

http://www.domain.com/scriptname/arguments_here

I know it's possible to create a new directory and have the htaccess'
DirectoryIndex point to the index.cgi, but that yields:

http://www.domain.com/directoryname/?querystring

I need to eliminate that question mark... is this possible? (I know
it's possible on Ruby on Rails, but I'm not sure about perl...)


Any Ideas? Thanks in advance,

check out PATH_INFO
 
J

John Bokma

[ nothing ]

I wonder what's more annoying, an OT question that can be answered with a
one-liner, or a "funny" reply.
 
X

xhoster

J

John Bokma

$url =~ s/\?//;

Giving the wrong answer (on purpose) takes (at least on my keyboard) more
effort than just typing a hint like PATH_INFO...

I understand that this group shouldn't function as a general purpose help
desk, but this is the third IMNSHO lame post I see in this thread. Added
up, it's more annoying then the off topic post.

Also, people seem constantly to forget that what's clear to them, is not
so clear to others. For some people CGI is equal to Perl (and vice versa),
they are not aware that they have a CGI question, and not a Perl one.

In two lines you could have and explained that this is not really a Perl
question, and that the OP should look up PATH_INFO in the documentation of
CGI.pm. Or did you and others really thought that the OP was well aware
that this was a CGI question, and just posted in this group on purpose?
 
X

xhoster

John Bokma said:
Giving the wrong answer

My answer was not wrong. It will eliminate the question mark from the
string he gave, as he requested.

(on purpose) takes (at least on my keyboard) more
effort than just typing a hint like PATH_INFO...

When I searched for PATH_INFO, I found info on how to deal with what
he wants, assuming he already has it. It told me nothing about how
to get what he wants in the first place.

I understand that this group shouldn't function as a general purpose help
desk, but this is the third IMNSHO lame post I see in this thread. Added
up, it's more annoying then the off topic post.

I answered the question he asked. If you wish to try to magically divine
what he meant to ask and try to answer that, go forth with my blessing.
But in the mean time, I'm perfectly justified in answering the question
actually asked, if I feel like doing so.

Xho
 
J

John Bokma

[..]
Giving the wrong answer

My answer was not wrong. It will eliminate the question mark from the
string he gave, as he requested.

You probably haven't been programming for other people then.
When I searched for PATH_INFO, I found info on how to deal with what
he wants, assuming he already has it. It told me nothing about how
to get what he wants in the first place.

So you couldn't answer the actual question in the first place.
I answered the question he asked. If you wish to try to magically
divine what he meant to ask and try to answer that, go forth with my
blessing.

The question was not well written, but not that hard to grasp. Of course
it's more fun to pick one part, and answer that one, maybe even knowing
it's wrong.
But in the mean time, I'm perfectly justified in answering
the question actually asked, if I feel like doing so.

You didn't answer the question. And either you are very well aware of
this, and thought it a very cool joke. Or you were not able to
understand the question, let alone to answer it, so you just picked
something out of the question and focussed on that.

Lets read together:

" I need to be able to pass a query string to a script without using
the question mark, ie:

http://www.domain.com/scriptname/arguments_here"

Translation: I want to pass arguments to a CGI script in such a way that
the URL looks like above.

Why can I understand it, and several people not? I think because the
other people think it's way more fun to write a stupid reply.
 
G

Gunnar Hjalmarsson

John said:
Giving the wrong answer (on purpose) takes (at least on my keyboard) more
effort than just typing a hint like PATH_INFO...

I understand that this group shouldn't function as a general purpose help
desk, but this is the third IMNSHO lame post I see in this thread. Added
up, it's more annoying then the off topic post.

Agreed. Very much agreed.
 
J

John Bokma

Tad McClellan said:
Xho's answer reflected a similar amount of care as the OP did
in composing the question.

IMNSHO Xho should have known better. But I am afraid that this will go on
and on, so have fun without me.
 
M

Matt Garrish

John Bokma said:
(e-mail address removed) wrote:


Giving the wrong answer (on purpose) takes (at least on my keyboard) more
effort than just typing a hint like PATH_INFO...

I understand that this group shouldn't function as a general purpose help
desk, but this is the third IMNSHO lame post I see in this thread. Added
up, it's more annoying then the off topic post.

And you often post for no purpose but to say you're willing to work for
money. What does that add? Judge not lest ye be judged, right...

Matt
 
J

John Bokma

Matt Garrish said:
And you often post for no purpose but to say you're willing to work
for money.

OMG, yeah, I did that twice (IIRC) today. I also answered a question on
Parallel::UserAgent, for free.
What does that add?

What does your reply add?
 
G

Gunnar Hjalmarsson

Matt said:
And you often post for no purpose but to say you're willing to work for
money. What does that add?

He splashed water on me, so why can't I throw sand in his eyes?

Time to grow up soon, ehh?

It's true that bad composed and/or OT questions may be annoying, but
they don't justify patronizing responses solely aiming to making fun of
newbies. Reading such responses by those who should know better is
_really_ annoying.
 
A

A. Sinan Unur

He splashed water on me, so why can't I throw sand in his eyes?

Time to grow up soon, ehh?

It's true that bad composed and/or OT questions may be annoying, but
they don't justify patronizing responses solely aiming to making fun
of newbies. Reading such responses by those who should know better is
_really_ annoying.

Neverending patronizing responses to responses to off-topic questions
that go on and on are getting really annoying as well.

Xho's response to a 100% off-topic CGI / webserver configuration
question was right on the mark. He showed how to remove the question
mark from a string in Perl. That's it.

Sinan
 
M

Matt Garrish

Gunnar Hjalmarsson said:
He splashed water on me, so why can't I throw sand in his eyes?

Time to grow up soon, ehh?

I think it's ridiculous to waste time with pointless conversations like
this, especially if you don't take a good hard look at your own posting
patterns. This sudden attempt to tell people how to post is no less annoying
than the new troll.

In reference to what started this, the poster got what he asked for. It's up
to him to come back and say that he meant something else. Mind reading gets
tiresome: well if you really mean this, but you might also mean this, or
maybe this... If you want to engage in that kind of response it's up to you,
but usenet is certainly not about writing responses that are appropriate for
John Bokma, Gunnar Hjalmarsson, Matt Garrish or anyone else.

Remember, if you ask a stupid question, you'll get a stupid answer...

Matt
 
R

robic0

I think it's ridiculous to waste time with pointless conversations like
this, especially if you don't take a good hard look at your own posting
patterns. This sudden attempt to tell people how to post is no less annoying
than the new troll.

In reference to what started this, the poster got what he asked for. It's up
to him to come back and say that he meant something else. Mind reading gets
tiresome: well if you really mean this, but you might also mean this, or
maybe this... If you want to engage in that kind of response it's up to you,
but usenet is certainly not about writing responses that are appropriate for
John Bokma, Gunnar Hjalmarsson, Matt Garrish or anyone else.

Remember, if you ask a stupid question, you'll get a stupid answer...

Matt
Hey and I didn't even contribute to this thread.
Making more enemies Matt?
Care to publish your home address?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,274
Latest member
JessMcMast

Latest Threads

Top