Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy & Pasting Forms within same page

Status
Not open for further replies.

Borvik

Programmer
Jan 2, 2002
1,392
US
Ok, FrontPage has decided to try to be helpful - when I don't want it to be (never liked FP, but job requires using it).

I have a program that generates a form for me, that contains 2 hidden fields and a submit button. It generates the form and copies it to the clipboard in a manner that allows it to be pasted into FP.

Here is an example form:
Code:
<form method="post" action="[URL unfurl="true"]http://some_processor.php">[/URL]
   <input type="hidden" value="m_id" name="merchant">
   <input type="submit" value="Quick Buy">
   <input type="hidden" name="sku" value="T013201">
</form>

The first form placed on the page works just fine, but subsequent forms fail to work properly (target script reports problem).

I have found out that FP - while trying to be helpful, renames the merchant and sku fields - to keep unique names.

The target script is dependent on the merchant and sku fields being named properly, but the subsequent ones are name merchant# and sku# (where # represents a number).

I can understand renaming if the field were within a form that already had that field name, but a separate form on the same page should allow that (just IDs that are separate).

Anyone know how to turn this "helpfulness" off?
 
It may be that this method has to be used but would it not be easier to just create a 'graphic' link to the PHP script containing the 'sku' value and paste that into your page? The correct merchant values could be assigned within the script itself?

Keith
 
The merchant values cannot be assigned within the script itself, as the script handles multiple merchants (thus different price levels for the items) - so the merchant id must be passed to the script.

Actually the script requires https so passing the values as a link (via GET method), would leave it vulerable - though there isn't much vulnerable at that point in the script.

That might be the way to go - however, if there is a way to turn that "feature" off - that would be easiest at this point.
 
Not sure if it can be turned off but it makes sense that this feature is in place.
If there are only a small number of merchants, you could pass a merchant code to the script rather than the merchant number itself. If you are pulling data from a DB, the merchant number could be accessed that way.
As regards security, the merchant number will be viewable in the page source code if you use your original method.
Another thought, if you go down the form route, you could iterate through a loop which creates all the possible values of merchant and sku numbers and find the ones which contain data. It's a bit messy but would provide a solution.
Perhaps you could explain why you need to use Frontpage as personally, I would be serving the pages from the PHP script directly.

Keith
 
Yea, I'll probably end up passing the values via GET links.

I HAVE to use FrontPage, because the boss likes to edit the website - and that's all he know how to use.

Personally, I would serve up the pages from the PHP script as well.
 
Makes it harder when someone wants to change the structure but as you say, he is the boss!
I often think their time would be better spent running their businesses but ho hum.
Why not let him edit a single htm form and use that as a template for the rest of the site. he controls layout and you can have a hassle free application.

Keith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top