Jump to content
  • Advertisement
Sign in to follow this  
VISQI

Urgent matter

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


Link to post
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
have to read its manuals.
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 this post


Link to post
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

Share this post


Link to post
Share on other sites
You could look into GreaseMonkey it's a javascript engine that allows you to run javascript on a page without being part of the page. You can script it so when a certain page loads, it autofill the form. This plugin is for Firefox, but i think someone told me it also exists for chrome and/or safari.

Hope that helps!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!