• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Can a href command be used to post rather than get?

Contributor ,
Jul 09, 2006 Jul 09, 2006

Copy link to clipboard

Copied

Hi - is there some way to use a standard href=myPage.cfm to post information rather than get, as in: href=myPage.cfm?topic=123
TOPICS
Advanced techniques

Views

523

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jul 09, 2006 Jul 09, 2006

Copy link to clipboard

Copied

You can do this but it's a bad idea.
  • It breaks the web paradigm which confuses users and breaks down their trust.
  • Visitors without javascript, or using mobile devices or voice readers will not be able to use your site.
  • Search engines can destroy your data!
  • Users with Firefox, etc., pre-fetch extensions can destroy your data!
  • Do you really want users to be able to bookmark say, "Delete this entry" or "Add new junk to my site with one click and no thought"?

A better way is to keep forms for posting and alter the submit button(s)' appearance, if you wish, without hiding its/their purpose.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 09, 2006 Jul 09, 2006

Copy link to clipboard

Copied

Do you know how to do it? You don't have to worry how I will use it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 09, 2006 Jul 09, 2006

Copy link to clipboard

Copied

Hi - it's very easy to attach a url variable to a link. This forum, for example, uses that construct. What I'm looking for is the means to execute a post by using a link, rather than a form setup.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jul 09, 2006 Jul 09, 2006

Copy link to clipboard

Copied

You've already been told how to do it and also some of the reasons why it's a boneheaded idea.

I will not show you any other methods (just like I wouldn't help a mugger with his planned tasks).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 09, 2006 Jul 09, 2006

Copy link to clipboard

Copied

LATEST
Forgive! I didn't see the lower half of the message. My bad!

As I said - please don't worry about the application. If there are other ways, I'd greatly appreciate knowing.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 09, 2006 Jul 09, 2006

Copy link to clipboard

Copied

I don't think you can post a variable by means of a link. For example, doing <a href="myPage.cfm?form%2Etopic=123"> wont work. A link cannot create the form scope on the action page. Only tags like <form> and <cfhttp> can.

However, if you insist on using a link, Javascript could come in handy.

sender.cfm:

<a href="javascript: document.poster.submit()">Post it</a>
<cfform name="poster" action="myPage.cfm" format="HTML" method="POST">
<cfinput name="topic" type="Text" value="123">
</cfform>

myPage.cfm

<cfif isDefined("form.topic")>
form.topic: <cfoutput>#form.topic#</cfoutput>
</cfif>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation