• 10
• 12
• 12
• 14
• 15

Urgent matter

This topic is 2914 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

How ya' doin', people i wanted to on how can create a program in c++ to ask the user input a set of numbers, and then i copy them to the browser to autofill some designated forms( i.e: name, age .....) i really need it to complete my program and i don't know how to do it P.S: iam still learning in c++

Share on other sites
Assuming the Web page you need to fill in is actually on a site and not just local...

The simplest way to do it is to just launch the browser with a constructed URL in which you pass the parameters (a GET request):

http://www.example.com/foo.bar?name=John+Smith&age=22

Make foo.bar a CGI script that generates the form. If you are using PHP, for example, it might look like this:

    <html>    <head>    ...    </head>    <body>    ...    <form action="submit.php" method="post">    <input type="text" name="name" value="<?php echo $_GET['name']; ?>"/> <input type="text" name="age" value="<?php echo$_GET['age']; ?>"/>    ...    <input type="submit" value="Submit"/>    </form>    ...    </body>    </html>

This generates a form with whatever <input> fields you want and fills the fields with the appropriate values captured from the URL.

Make sure you take URL encoding into account if you have special characters in your input, and replace spaces with plus signs.

Share on other sites
actually this is not what i meant, i meant that is there a way to copy the the text to the clipboard or something and then when the user clicks on the beginning of the form, it will automatically fill it

it should behave exactly like this macro but i want to implement it in c++

var WshShell = WScript.CreateObject("WScript.Shell")

WScript.Sleep(1000);
WshShell.SendKeys("John Doe");
WshShell.SendKeys("{TAB}");
WshShell.SendKeys("22");
WshShell.SendKeys("Male");
WshShell.SendKeys("aaa@aaa@aaa.com");

my friend made this one in javascript, if u can also tell me how did he do it, i will heavily appreciate it.

Share on other sites
Hm sounds to me that you are trying to do some
bot who will fill forms for you.
Make sure this is legal!

For the jscript part I do not know the context but I
think if it is written in jscript it should be embedded
into the site with the form in it.
For this reason it is simple to get access to the fields.
I do not know if there is an interface in your browser that
allows other programs to control it. If there is one than you
If not, this would be very complicated.
Another possibility would be to write your own "browser" that
will fill in the form for you.

Share on other sites
how to do it in a created browser, and how to create a browser

this is totally legal by the way