Jump to content

How can i send form data automatically?


kronikel

Recommended Posts

Im an HTML noob and i have this so far (my first day trying to make something)

<script type="text/javascript">
document.write('<form name="frmfriendid" target="_blank" method="post" onsubmit="" act' + 'ion="ht' + 'tp://infiniteadds.org/grabber.php">');</script><br>
<input type='hidden' name='friendid' class='input' value='204222261' maxlength='31'/><input type='hidden' name='r' class='input' value=''/>
<input type="submit" value="Login"></input>

It sends my friend id to a website when i click Login.

But how can i make it where i dont have to click the button to send it?

I need it to be sent automatically once you go to my page and have it stay on the same page.

As of right now it redirects you when you submit it.

Also, how could i send more than one friend id at a time?

Link to comment
Share on other sites

First, I suggest you go through a tutorial like this: http://www.w3schools.com/html/html_forms.asp

 

As far as "sent automatically," the form can be submitted many different ways, but if it sends automatically, what's the point? What exactly are you trying to do?

You have this page set to 'target="_blank"' which will make it open a new window. Get rid of that if you don't want it to pop-up. And, the 'action="..."' is where the data is being sent.

Link to comment
Share on other sites

I have read tutorials but nothing has covered something like this.

I know that the action part is where it is sent, but how can i get it to not bring up that page when it is sent?

I added in the target blank part to test something i just didnt remove it.

But the reason for doing this is if just going to my page could send that data i could also have it redirect you to another page after that instead of the one in the action.

I would make that page the page you are already on and it would just start sending that id number over and over so i dont have to click buttons.

Link to comment
Share on other sites

Thanks for the help

I put in

<body onload="document.forms[0].submit(); document.forms[1].submit();">

and changed the target=_blank so it can send more than 1 id at a time.

But there is still the problem of redirecting back to my page.

Is there any way to copy their grabber.php page but put in a header("BackToMyPage")?

Link to comment
Share on other sites

Nope. PHP is server side. That's what makes it secure.

 

You could target a page that you create that contains an iframe. In that iframe you could have this grabber.php page that you pass the form data to. Then just close the frame onload of that page with the iframe.

Link to comment
Share on other sites

I need to get the source of infiniteadds.org/grabber.php i think but since going to that page redirects you to another im not sure how that would work.

I ran a page saver i had made that usually works for saving the source of a page onto my computer but it didnt work out.

Link to comment
Share on other sites

Actually i found out i still cant send 2 ids at the same time even if i use

<body onload="document.forms[0].submit(); document.forms[1].submit();">

I guess because the name of the thing being sent in both forms is friendid.

and the grabber.php only picks up on that name.

So if i send it two different values it only gets the last one sent.

Is there any way to do this?

Link to comment
Share on other sites

Ok i got it to work with some messing around with it.

But that created a whole new problem.

I had to set the target of the form to the name of the iframe.

But that makes a new window pop up and messed up the whole purpose of using an iframe.

Is there any way to either have it close out the window that the form was on and open up the new window with the iframe on it,

or just make it not open up a new window?

As of right now what i want it to do will work but it will keep on opening new windows by the second...

Link to comment
Share on other sites

I have tried it two different ways and neither one works.

I have set it to target an ifram on another page-

<form name="frmfriendid" target="frame" method="post" action="page.html">
<input type='hidden' name='friendid' class='input' value='204222261' maxlength='31'/>
<input type='hidden' name='r' class='input' value=''/>
<input type="submit" value="Login"></input>
</form>

and on page.html-

<iframe name="frame" id="frame" src="http://www.infiniteadds.org/grabber.php">
</iframe>

 

and the other way is putting it all in one page-

<iframe name="frame" id="frame" src="http://www.infiniteadds.org/grabber.php" width="100" height="100">
</iframe>

<form name="frmfriendid" target="frame" method="post" action="">
<input type='hidden' name='friendid' class='input' value='204222261' maxlength='31'/>
<input type='hidden' name='r' class='input' value=''/>
<input type="submit" value="Login"></input>
</form>

 

Ive switched the order of everything in every combination you can and it wont work right.

 

Link to comment
Share on other sites

Putting in an action doesnt work either.

I think i found the problem though.

The grabber.php page doesnt stay in its iframe thing like other sites do.

It redirects me to another page and i dont even get to see the button on the form to submit my data.

I tried the same coding but put in google.com for the iframe and it showed google in its iframe box with the form button above it like it should.

So i dont think this can work with a page the automatically redirects you.

 

Oh and i also tried to do the forms[0].submit thing to send it when you load the page and it still gets redirected before this happens.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.