Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PostFormData and PostAdd
#1
I am using PostAdd and PostFormData to post data to a php webpage. However, quick macros seems to ignore all of the PostAdd statements and just looks at the connect and PostFormData statements..
I am using this to post large amounts of text to a php webpage that posts to a database. I won't be able to use IntGetFile because the sum of text i am uploading may have special characters and may disrupt the url. Here is my code.

x.Connect("xxx"); str s
x.PostAdd("username" "mshah15")
...
x.PostFormData("xxx.php" 0 s)
out s

The out statement shows that it is not inserting any of the PostAdd statements.

Any help is appreciated. Thank you.
Reply
#2
Maybe the posted data is too long. I don't know what is the limit. I tested now with short strings, and it works.

Web page http://www.quickmacros.com/test/post.php
Code:
Select All      Help
<?php
var_dump($_POST);
?>

Macro
Code:
Select All      Help
Http x.Connect("quickmacros.com"); str s
x.PostAdd("username" "mshah15")
x.PostAdd("z" "x")
x.PostFormData("test/post.php" 0 s)
out s

Output
Quote:array(2) {
["username"]=>
string(7) "mshah15"
["z"]=>
string(1) "x"
}
Reply
#3
As of now I too am testing with small strings, but still, I am unable to get the proper output.
Could it be possible that the cause of this problem is that when i use PostAdd, my parameters are like so:

x.PostAdd("username" username) ;; username is a string variable
Reply
#4
This works too.
Macro Macro2894
Code:
Select All      Help
str s1="mshah15"
str s2="x"
Http x.Connect("quickmacros.com"); str s
x.PostAdd("username" s1)
x.PostAdd("z" s2)
x.PostFormData("test/post.php" 0 s)
out s
Reply
#5
This doesn't seem to be working for me, but I am able to do the same with IntGetFile. The only problem is, I have one string that can be include special characters like &,',",=,%, which is messing up the url and it ends up not working. Is there any get around like putting a slash in front of the special characters to show them has normal text?
Reply
#6
Macro Macro2895
Code:
Select All      Help
str s=
;&,',",=,%
s.escape(9)
str url=F"http://a.b.c?username={s}"
out url
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)