Jump to content

Adding html code in command/function


MariusN
 Share

Recommended Posts

Is it possible for someone here to tell me how to add a HTML code into a Function? Reason for asking is that i want to compile some software as Donationware...I basicly want a button in my program with PayPal or whatever's code in it. So when ppl click on paypal's button, they will go directly to the credit facility or whatever code paypal gave me...

thanks guys...

Link to comment
Share on other sites

I'm still having a little trouble...This is the code from monsterpay's submit button. What it actually does, is ask you to log in after it reached their webpage, then the info below get entered automaticly for the purchasing goods

--->

<form action="https://www.monsterpay.com/secure/index.cfm" method="post">

<input type="hidden" name="buttonaction" value="buynow">

<input type="hidden" name="merchantidentifier" value="1234567">

<input type="hidden" name="liddesc" value="test v1.00">

<input type="hidden" name="lidsku" value="01">

<input type="hidden" name="lidprice" value="10">

<input type="hidden" name="lidqty" value="1">

<input type="hidden" name="CurrencyAlphaCode" value="USD">

<input type="hidden" name="ShippingRequired" value="1">

<input type="hidden" name="LIDExpiry" value="1">

<input type="hidden" name="MerchCustom" value="test v1.00">

</form>

And this is what i have tried with AutoIt--->

#include <IE.au3>

Opt("MustDeclareVars", 1)

Local $oForm, $oIE, $oInputFile,$oInputFile1,$oInputFile2,$oInputFile3,$oInputFile4,$oInputFile5,$oInputFile6,$oInputFile7

Local $oInputFile8,$oInputFile9

$oIE = ShellExecute('https://www.monsterpay.com/secure/index.cfm')

$oForm = _IEFormGetObjByName ($oIE, "ExampleForm")

$oInputFile = _IEFormElementSetValue ($oForm, 'buttonaction" value="buynow"')

$oInputFile2 = _IEFormElementSetValue ($oForm, 'merchantidentifier value="1234567')

$oInputFile3 = _IEFormElementSetValue ($oForm, 'liddesc value="test v1.00"')

$oInputFile4 = _IEFormElementSetValue ($oForm, 'lidsku value="01"')

$oInputFile5 = _IEFormElementSetValue ($oForm, 'lidprice value="10"')

$oInputFile6 = _IEFormElementSetValue ($oForm, 'CurrencyAlphaCode value="USD"')

$oInputFile7 = _IEFormElementSetValue ($oForm, 'ShippingRequired value="1"')

$oInputFile8 = _IEFormElementSetValue ($oForm, 'LIDExpiry value="1"')

$oInputFile9 = _IEFormElementSetValue ($oForm, 'MerchCustom value="test v1.00')

_IEFormSubmit ($oForm)

Am i on the right track here? :)

Link to comment
Share on other sites

Open notepad...

enter:

<form action="https://www.monsterpay.com/secure/index.cfm" method="post">

<input type="hidden" name="buttonaction" value="buynow">

<input type="hidden" name="merchantidentifier" value="1234567">

<input type="hidden" name="liddesc" value="test v1.00">

<input type="hidden" name="lidsku" value="01">

<input type="hidden" name="lidprice" value="10">

<input type="hidden" name="lidqty" value="1">

<input type="hidden" name="CurrencyAlphaCode" value="USD">

<input type="hidden" name="ShippingRequired" value="1">

<input type="hidden" name="LIDExpiry" value="1">

<input type="hidden" name="MerchCustom" value="test v1.00">

</form>

save it as donate.html

then open Scite

and type:

ShellExecute(@scriptdir & "\Donate.html")

try that :)

Link to comment
Share on other sites

Open notepad...

enter:

<form action="https://www.monsterpay.com/secure/index.cfm" method="post">

<input type="hidden" name="buttonaction" value="buynow">

<input type="hidden" name="merchantidentifier" value="1234567">

<input type="hidden" name="liddesc" value="test v1.00">

<input type="hidden" name="lidsku" value="01">

<input type="hidden" name="lidprice" value="10">

<input type="hidden" name="lidqty" value="1">

<input type="hidden" name="CurrencyAlphaCode" value="USD">

<input type="hidden" name="ShippingRequired" value="1">

<input type="hidden" name="LIDExpiry" value="1">

<input type="hidden" name="MerchCustom" value="test v1.00">

</form>

save it as donate.html

then open Scite

and type:

ShellExecute(@scriptdir & "\Donate.html")

try that :)

Yep...im sure thia will work...wish i coud just have the code though, but this will do...thx ;)

I want to make it easier for my customers to purchase my goods...otherwise they have to fill in a whole lot of stuff

Link to comment
Share on other sites

Well your close but your also missing one minor thing :)

$oIE = ShellExecute('https://www.monsterpay.com/secure/index.cfm')

$oForm = _IEFormGetObjByName ($oIE, "ExampleForm")

$oQuery = _IEFormElementGetObjByName($oForm, 'buttonaction" value="buynow"')

$oInputFile = _IEFormElementSetValue ($oQuery, " ;This is where you would put the info that you want in the input box")

Link to comment
Share on other sites

Well your close but your also missing one minor thing :)

$oIE = ShellExecute('https://www.monsterpay.com/secure/index.cfm')

$oForm = _IEFormGetObjByName ($oIE, "ExampleForm")

$oQuery = _IEFormElementGetObjByName($oForm, 'buttonaction" value="buynow"')

$oInputFile = _IEFormElementSetValue ($oQuery, " ;This is where you would put the info that you want in the input box")

thx bam...hope it does the trick ;)
Link to comment
Share on other sites

thx bam...hope it does the trick :)

Eish man, im still having major probies with this code ;)

I'll repost the code of the HTML file (this is actually a BUTTON inside a html page that gets clicked on. Once clicked, it will take me to a page to LOGIN, then a buynow page. You can copy this and add it into html format and see what i mean...

<form action="https://www.monsterpay.com/secure/index.cfm" method="post">
<input type="hidden" name="buttonaction" value="buynow">
<input type="hidden" name="merchantidentifier" value="12345678">
<input type="hidden" name="liddesc" value="Access">
<input type="hidden" name="lidsku" value="02">
<input type="hidden" name="lidprice" value="50">
<input type="hidden" name="lidqty" value="1">
<input type="hidden" name="CurrencyAlphaCode" value="USD">
<input type="hidden" name="ShippingRequired" value="1">
<input type="hidden" name="LIDExpiry" value="1">
<input type="hidden" name="LIDExpiry" value="1">
<input type="image" src="http://www.monsterpay.com/images/cartbuttons/bn06.gif">
</form>

Here is my code in AutoIt

#RequireAdmin
#include <IE.au3>
#include <GUIConstants.au3>
#include <File.au3>
Local $account,$buttonaction,$CurrencyAlphaCode, $liddesc, $LIDExpiry, $lidprice, $lidqty, $lidsku, $merchantidentifier, $MerchCustom, $oIE
Local $o_form1,$1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$o_form2,$o_form3,$o_form4,$o_form5,$o_form6,$o_form7,$o_form8,$o_form9,$o_form10

$buttonaction ="buynow"
$merchantidentifier ="123456789"
$liddesc ="software"
$lidsku ="02"
$lidprice ="50"
$lidqty ="1"
$CurrencyAlphaCode ="USD"
$ShippingRequired ="1"
$LIDExpiry ="1"
$MerchCustom ="software"

$oIE = _IECreate()
_IENavigate($oIE, "http://www.monsterpay.com/secure/index.cfm")
$o_form = _IEFormGetObjByName($oIE, "SecureCartMonkey")

$1= _IEFormElementSetValue("buttonaction", $buttonaction)
$2 = _IEFormElementSetValue("merchantidentifier",$merchantidentifier)
$3 = _IEFormElementSetValue("liddesc",$liddesc)
$4 = _IEFormElementSetValue("lidsku", $lidsku)
$5 = _IEFormElementSetValue("lidprice",$lidprice)
$6 = _IEFormElementSetValue("$lidqty",$lidqty)
$7 = _IEFormElementSetValue("CurrencyAlphaCode", $CurrencyAlphaCode)
$8 = _IEFormElementSetValue("ShippingRequired",$ShippingRequired)
$9 = _IEFormElementSetValue("LIDExpiry", $LIDExpiry)
$10 = _IEFormElementSetValue("MerchCustom", $MerchCustom)

Sleep(500)
_IEFormSubmit($o_form)

This is the Errors AutoIt gives me --->

IE.au3 V2.4-0 Error from function _IEFormElementGetObjByName, $_IEStatus_InvalidDataType
IE.au3 V2.4-0 Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType
Edited by MariusN
Link to comment
Share on other sites

Eish man, im still having major probies with this code :)

I'll repost the code of the HTML file (this is actually a BUTTON inside a html page that gets clicked on. Once clicked, it will take me to a page to LOGIN, then a buynow page. You can copy this and add it into html format and see what i mean...

<form action="https://www.monsterpay.com/secure/index.cfm" method="post">
<input type="hidden" name="buttonaction" value="buynow">
<input type="hidden" name="merchantidentifier" value="12345678">
<input type="hidden" name="liddesc" value="Access">
<input type="hidden" name="lidsku" value="02">
<input type="hidden" name="lidprice" value="50">
<input type="hidden" name="lidqty" value="1">
<input type="hidden" name="CurrencyAlphaCode" value="USD">
<input type="hidden" name="ShippingRequired" value="1">
<input type="hidden" name="LIDExpiry" value="1">
<input type="hidden" name="LIDExpiry" value="1">
<input type="image" src="http://www.monsterpay.com/images/cartbuttons/bn06.gif">
</form>

Here is my code in AutoIt

#RequireAdmin
#include <IE.au3>
#include <GUIConstants.au3>
#include <File.au3>
Local $account,$buttonaction,$CurrencyAlphaCode, $liddesc, $LIDExpiry, $lidprice, $lidqty, $lidsku, $merchantidentifier, $MerchCustom, $oIE
Local $o_form1,$1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$o_form2,$o_form3,$o_form4,$o_form5,$o_form6,$o_form7,$o_form8,$o_form9,$o_form10

$buttonaction ="buynow"
$merchantidentifier ="123456789"
$liddesc ="software"
$lidsku ="02"
$lidprice ="50"
$lidqty ="1"
$CurrencyAlphaCode ="USD"
$ShippingRequired ="1"
$LIDExpiry ="1"
$MerchCustom ="software"

$oIE = _IECreate()
_IENavigate($oIE, "http://www.monsterpay.com/secure/index.cfm")
$o_form = _IEFormGetObjByName($oIE, "SecureCartMonkey")

$1= _IEFormElementSetValue("buttonaction", $buttonaction)
$2 = _IEFormElementSetValue("merchantidentifier",$merchantidentifier)
$3 = _IEFormElementSetValue("liddesc",$liddesc)
$4 = _IEFormElementSetValue("lidsku", $lidsku)
$5 = _IEFormElementSetValue("lidprice",$lidprice)
$6 = _IEFormElementSetValue("$lidqty",$lidqty)
$7 = _IEFormElementSetValue("CurrencyAlphaCode", $CurrencyAlphaCode)
$8 = _IEFormElementSetValue("ShippingRequired",$ShippingRequired)
$9 = _IEFormElementSetValue("LIDExpiry", $LIDExpiry)
$10 = _IEFormElementSetValue("MerchCustom", $MerchCustom)

Sleep(500)
_IEFormSubmit($o_form)

This is the Errors AutoIt gives me --->

IE.au3 V2.4-0 Error from function _IEFormElementGetObjByName, $_IEStatus_InvalidDataType
IE.au3 V2.4-0 Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType

anyone? ;)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...