You are not enjoying the benefits offered by registering. To register click here...
  
Forums | Prefs | Your Messages | Members | Recent | Search
Quick Search


Advanced Search
| Calendar | Doc | Dev' Blog! |
Chat (Alpha Version)

Guest, do not forget to login ( Register )
 Top > Forums > This Software > Support, FAQ, How-to's
 Remote form to post on forum?

Skin Selection:
 (1 pages) 1  
Jasper

Public Speaker
Group: Testers
Posts: 562
Reputation: 10


Posted on Mar 3, 2007, 12:08 am by Jasper
Remote form to post on forum?
Is there a way to have a form on my site post to a forum on my board?

For example:

Form on siteA
Board on siteB

I fill out the form on siteA and it posts to siteB

Edit: Also, after the post is made, is it possible to have them redirect to another remote page (rather than go to the board)

Last edit by Jasper on Mar 3, 2007, 12:30 am
doesn't come here often, cause he has no free time ;_;
 
Top

chris

The Culprit
Group: Admins
Posts: 1,541
Reputation: 38


Posted on Mar 4, 2007, 5:53 am by chris
Yes. As a matter of fact, here is some sample code:

xml Code:
  1.  
  2. <form method="post" name="userform" action="http://www.yourboard.whatever.com/?do=handlemsg">
  3. Your name <input type="text" name="nbbs_name" size="40" value=""><input type="hidden" name="desc_nbbs_name" value="Your name">
  4. Your message <textarea name="nbbs_message" rows="6" cols="40"></textarea><input type="hidden" name="desc_nbbs_message" value="Your message">
  5. <input type="hidden" name="act" value="form">
  6. <input type="hidden" name="area" value="1">
  7. <input type="hidden" name="whoami" value="fi">
  8. <input type="hidden" name="FormTitle" value="Message From Some Dude">
  9. <input type="hidden" name="mandatory" value="message">
  10. <input type="hidden" name="goto" value="link_to_redirect_to">
  11. <input type="hidden" name="redirecttext" value="">
  12. <input type="submit" name="Submit" value="Submit">
  13. </form>


 
Top

chris

The Culprit
Group: Admins
Posts: 1,541
Reputation: 38


Posted on Mar 4, 2007, 5:54 am by chris
Damn. html is still improperly escaped...grrr.

 
Top

Jasper

Public Speaker
Group: Testers
Posts: 562
Reputation: 10


Posted on Mar 4, 2007, 10:23 am by Jasper
Thanks chris
doesn't come here often, cause he has no free time ;_;
 
Top

JakeH

Public Speaker
Group: Moderators
Posts: 761
Reputation: 7


Posted on Mar 9, 2007, 4:47 pm by JakeH
That actually seems usuful :O
 
Top

harmor


Story Teller
Group: Developers
Posts: 127
Reputation: 3


Posted on Mar 11, 2007, 3:25 am by harmor
There should be a way to permit only certain sites from submitting the form.
Xen Web Hosting Offering ad-free hosting with features such as, cpanel, fantastico, PHP and MySQL support, and more -------------------------------------------------------------------------------------------------------
Chris
Let's hang on to Harmor, it's not everyday that you find people who walk the walk, not just talk the talk.
 
Top

chris

The Culprit
Group: Admins
Posts: 1,541
Reputation: 38


Posted on Mar 11, 2007, 7:22 am by chris
Agreed. This is a very ugly trick that leaves the site open to DoS attacks.
Unfortunately, HTTP_REFERER is unreliable at best and the trade-off is that people can not even submit a form.

 
Top

Jasper

Public Speaker
Group: Testers
Posts: 562
Reputation: 10


Posted on Mar 11, 2007, 9:01 am by Jasper
 chris wrote:
Agreed. This is a very ugly trick that leaves the site open to DoS attacks.
Unfortunately, HTTP_REFERER is unreliable at best and the trade-off is that people can not even submit a form.


Well perhaps after post submission, the post can then be handled server side, stripping out all HTML and outputting a clean text-only post on the forums?

You could strip out the HTML with a foreach()

php Code:
  1. foreach($_POST as $key => $value) {
  2. $_POST[$key] = htmlspecialchars($value);
  3. }


Last edit by Jasper on Mar 11, 2007, 9:01 am
doesn't come here often, cause he has no free time ;_;
 
Top

harmor


Story Teller
Group: Developers
Posts: 127
Reputation: 3


Posted on Mar 11, 2007, 12:26 pm by harmor
In the ACP have a text area where you type in sites you allow the form to post from. Somewhere on the code that handles the message get the HTTP_REFERRER from the incoming site and strip it with a regex so it will only display "domain.com".
Check if the domain in question is listed in the textarea the ACP.

Xen Web Hosting Offering ad-free hosting with features such as, cpanel, fantastico, PHP and MySQL support, and more -------------------------------------------------------------------------------------------------------
Chris
Let's hang on to Harmor, it's not everyday that you find people who walk the walk, not just talk the talk.
 
Top

Jasper

Public Speaker
Group: Testers
Posts: 562
Reputation: 10


Posted on Mar 11, 2007, 7:15 pm by Jasper
If someone disables referrals in their browser, then how can that work? That's why http referrals are unreliable.

It's the same reason why hotlink protection isn't foolproof, because people can disable referrals.
doesn't come here often, cause he has no free time ;_;
 
Top

harmor


Story Teller
Group: Developers
Posts: 127
Reputation: 3


Posted on Mar 12, 2007, 12:54 am by harmor
How can you disable server side referrals?
Make a link to xenweb.net/http_referrer.php from a browser that has referrers turned off.
Xen Web Hosting Offering ad-free hosting with features such as, cpanel, fantastico, PHP and MySQL support, and more -------------------------------------------------------------------------------------------------------
Chris
Let's hang on to Harmor, it's not everyday that you find people who walk the walk, not just talk the talk.
 
Top

chris

The Culprit
Group: Admins
Posts: 1,541
Reputation: 38


Posted on Mar 12, 2007, 4:24 am by chris
It's not the link that will have referrers turned off; it's the client browser itself.
There are firefox plugins that let you rewrite your own referer but it's only part of the problem: some versions of IE do not have a referrer at all.

 
Top

Jasper

Public Speaker
Group: Testers
Posts: 562
Reputation: 10


Posted on Mar 12, 2007, 9:01 am by Jasper
 chris wrote:
It's not the link that will have referrers turned off; it's the client browser itself.
There are firefox plugins that let you rewrite your own referer but it's only part of the problem: some versions of IE do not have a referrer at all.


Yes this is true



I usually keeps referrals turned off in my browser, but if I wanted to go further I could also rewrite them

Last edit by Jasper on Mar 12, 2007, 9:02 am
doesn't come here often, cause he has no free time ;_;
 
Top

harmor


Story Teller
Group: Developers
Posts: 127
Reputation: 3


Posted on Mar 12, 2007, 11:22 pm by harmor
I guess the only way to stop that is deny users from posting from an external site if they have referrals turned off.
Xen Web Hosting Offering ad-free hosting with features such as, cpanel, fantastico, PHP and MySQL support, and more -------------------------------------------------------------------------------------------------------
Chris
Let's hang on to Harmor, it's not everyday that you find people who walk the walk, not just talk the talk.
 
Top

chris

The Culprit
Group: Admins
Posts: 1,541
Reputation: 38


Posted on Mar 13, 2007, 7:32 pm by chris
You are correct. The flip side is alienating some IE users.

 
Top

 (1 pages) 1 - Flat Mode | Threaded Mode  
Quick Jump:

         
Page generated in 0.04 seconds (Queries: 0.01) - Cpu: 0.09
Total DB [adodb:mysql] queries: 15
Total Strings Translated: 15
Powered by NextBBS SE v0.4.5 - Copyright © 2007 CFR & The NextBBS Team
Chatbox powered by smiletag