Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PostFormData and PostAdd
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.
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
Select All      Help

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

Quote:array(2) {
string(7) "mshah15"
string(1) "x"
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
This works too.
Macro Macro2894
Select All      Help
str s1="mshah15"
str s2="x"
Http x.Connect(""); str s
x.PostAdd("username" s1)
x.PostAdd("z" s2)
x.PostFormData("test/post.php" 0 s)
out s
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?
Macro Macro2895
Select All      Help
str s=
str url=F"http://a.b.c?username={s}"
out url

Forum Jump:

Users browsing this thread: 1 Guest(s)