GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Business Turning a 'submit' button into a URL? (https://gfy.com/showthread.php?t=1349487)

Publisher Bucks 10-28-2021 11:30 AM

Turning a 'submit' button into a URL?
 
Is it possible to take a forms submit button and code it so that it acts like a url.

I do not think and 'onclick' element will actually work for what I need :/

I want to avoid using the form itself but still need it (data collection) and wanted to simply add a meta refresh to a page as if the button was clicked.

Nothing nefarious, just want the form to still count submit clicks in the database, without having to have the surfer click the submit button.

This is the form I'm using presently:

Quote:

<form action="vote.php?id=4" method="post">
<input type="hidden" name="confirmation" value="true" />
Are you sure that you want to vote for this?<br />
<input type="submit" value="Yes" /> <input type="button" value="No" onclick="javascript:history.back();" />
</form>

ZTT 10-28-2021 11:56 AM

If the surfer isn't clicking submit then what submit clicks are you counting?

faperoni 10-28-2021 11:57 AM

Maybe something like:

Give the form a name, for example "form1", then

Code:

window.onload = function(){
  document.forms['form1'].submit();
}

or

Code:

<body onload="document.form1.submit()">

ZTT 10-28-2021 12:05 PM

So the question isn't how to turn a button into a URL (which I'm sure he's asked before) but how to make a form automatically submit on page load?

Publisher Bucks 10-28-2021 01:45 PM

Quote:

Originally Posted by ZTT (Post 22928765)
So the question isn't how to turn a button into a URL (which I'm sure he's asked before) but how to make a form automatically submit on page load?

It was a button to link to a specific URL in the past.

Onclick wont work for this, I need to be able to change a submit button to a clickable link (the link from the previous page loads the form, but i want to bypass the form but still carry the data through to the 3rd page).

ZTT 10-28-2021 02:31 PM

Is the 3rd page on your site?

Colmike9 10-28-2021 03:44 PM

Quote:

Originally Posted by Publisher Bucks (Post 22928799)
It was a button to link to a specific URL in the past.

Onclick wont work for this, I need to be able to change a submit button to a clickable link (the link from the previous page loads the form, but i want to bypass the form but still carry the data through to the 3rd page).

Would something like this work?:

<form action="page3.php" method="post">
Message: <input type="text" name="message">
Name: <input type="text" name="name">
Email address: <input type="text" name="emailad">
<input type="submit">
</form>

page3.php:

<html> <body>
Hello <?php echo $_POST["name"]; ?>, I see that you wrote <?php echo $_POST["message"]; ?><br>
Your email address is <?php echo $_POST["emailad"]; ?>
</body> </html>

This carries data to another page and doesn't need it to be a clickable link

dcortez 10-28-2021 05:04 PM

Quote:

Originally Posted by Publisher Bucks (Post 22928748)
Is it possible to take a forms submit button and code it so that it acts like a url.

I do not think and 'onclick' element will actually work for what I need :/

I want to avoid using the form itself but still need it (data collection) and wanted to simply add a meta refresh to a page as if the button was clicked.

Nothing nefarious, just want the form to still count submit clicks in the database, without having to have the surfer click the submit button.

This is the form I'm using presently:

Nothing "nefarious"? It looks like your trying to dig back into the user's web browser history that may precede your pages.

Is that what you're trying to do?

Publisher Bucks 10-28-2021 06:00 PM

Quote:

Originally Posted by dcortez (Post 22928845)
Nothing "nefarious"? It looks like your trying to dig back into the user's web browser history that may precede your pages.

Is that what you're trying to do?

No im trying to get them to pass a vote across without actually having to click a button prior to hitting the target url :1orglaugh

Otherwise I'll have a redirect page with a form on it that I'll have to throw ads on before going to the tagret url which will detract from the surfers site experience.

Publisher Bucks 10-28-2021 06:01 PM

Quote:

Originally Posted by ZTT (Post 22928807)
Is the 3rd page on your site?

No, the third page is an external site.

Colmike9 10-28-2021 06:21 PM

I think I read something wrong lol.

But, if you want to send data on a <a href=...> then sessions would work. But, if you want to send that data to other sites, then that makes things kind of tricky, like syncing up where the sessions are stored on both sites. Also, probably will have to use a prefix for the session variables on each site so that they aren't named the same and cause issues etc.

dcortez 10-28-2021 06:28 PM

Quote:

Originally Posted by Publisher Bucks (Post 22928858)
No im trying to get them to pass a vote across without actually having to click a button prior to hitting the target url :1orglaugh

Otherwise I'll have a redirect page with a form on it that I'll have to throw ads on before going to the tagret url which will detract from the surfers site experience.

I see.

If you want to move the visitor from one page to another, while at the same time, invoking a script using the form data from the first page, you might be able to achieve that by passing the data to the next page and coding the next page to recognize the passed form data, invoking a web hit to whatever script is handling the form data.

Do you have coding control of the target page, or is that a third party page?

dcortez 10-28-2021 06:29 PM

Quote:

Originally Posted by Publisher Bucks (Post 22928859)
No, the third page is an external site.

That answers my last question.

How are you handling the form data? With a PHP script and some DB hit?

Publisher Bucks 10-28-2021 06:51 PM

Quote:

Originally Posted by dcortez (Post 22928865)
How are you handling the form data? With a PHP script and some DB hit?

Correct.

Once its completed theres a very high chance you might be interested in this script too ;)

Send me a PM :)

dcortez 10-28-2021 06:54 PM

How about this...

Your page with the form, on submit, executes a PHP script:

record_and_go.php

You pass whatever data you need for saving, AND the target URL.

The PHP script does whatever DB validation/update you need, and returns an tiny HTML shell that contains only a Javascript snippet that immediately sets the window location (page url) to the target page from the last form.

That will cause the target page to be loaded when the JS is executed (on form load).

??

Publisher Bucks 10-28-2021 06:57 PM

Quote:

Originally Posted by dcortez (Post 22928875)
How about this...

Your page with the form, on submit, executes a PHP script:

record_and_go.php

You pass whatever data you need for saving, AND the target URL.

The PHP script does whatever DB validation/update you need, and returns an tiny HTML shell that contains only a Javascript snippet that immediately sets the window location (page url) to the target page from the last form.

That will cause the target page to be loaded when the JS is executed (on form load).

??

That could potentially work perfectly actually :thumbsup

I'd need to add an additional .php file, but yeah, I can see that working.

ZTT 10-28-2021 08:41 PM

Quote:

Originally Posted by dcortez (Post 22928845)
Nothing "nefarious"? It looks like your trying to dig back into the user's web browser history that may precede your pages.

Is that what you're trying to do?

Sounds more like he's faking votes on another site, using his visitors as bots. :upsidedow

dcortez 10-28-2021 09:34 PM

Quote:

Originally Posted by ZTT (Post 22928904)
Sounds more like he's faking votes on another site, using his visitors as bots. :upsidedow

If that were the case, it's easy enough to render the visitor's page as a multi-framed document and with Javascript spawn multiple hits from the same visitor/IP.

As I now understand, the application is more for top list / traffic exchange tracking.

zerovic 10-29-2021 02:54 AM

I'm trying to understand the question, but I have no idea what OP is trying to achieve =D

Can you please describe your question step by step? There are many good answers above, but I still have no idea what you need :D

You have a form, which, in this case is completely unnecessary.. You can simply use 2 links without the form itself..

tomash999 10-29-2021 04:25 AM

Seems like he wants to use the visitor's IP and browser, to submit a form in an external site.

First check if they have CSRF tokens, a validation that their site is not in an iFrame, CloudFront, or any other security measures. Then it may be achievable with JavaScript as well.

ZTT 10-29-2021 05:42 AM

Quote:

Originally Posted by dcortez (Post 22928913)
If that were the case, it's easy enough to render the visitor's page as a multi-framed document and with Javascript spawn multiple hits from the same visitor/IP.

An easy way to get flagged as a bot instantly.

Quote:

As I now understand, the application is more for top list / traffic exchange tracking.
Why would you need such a convoluted method, that not one person has even understood, to track outgoing hits?

The only thing he has been clear about is wanting to generate clicks that people haven't made.

dcortez 10-29-2021 09:24 AM

Quote:

Originally Posted by ZTT (Post 22928971)
An easy way to get flagged as a bot instantly.

Absolutely correct. Sadly, not everyone flags bots. Regardless, this is not an approach to advocate in any case.

dcortez 10-29-2021 09:26 AM

Even simpler solution.

Use a PHP script that scrapes the form data (for DB) and the target URL.

When PHP updates the DB, simply return a location header from the PHP script, aimed at the target URL.


All times are GMT -7. The time now is 03:04 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc