Using a PHP script file - Post ID 224005

User 2639168 Photo


Registered User
3 posts

Hi folks! I'm a newbie and apologize for my ignorance in advance. What I'm trying to do is to put the following code in an HTML box. Then, when the user clicks the button, have it run the php file. When I do this, the page looks fine. However nothing happens when the user clicks the button. No errors, no changes, the script doesn't run. I've added the agreement.php file using the Add Files menu in Visual Site Designer. Any suggestions would be most appreciated.

HTML I'm using:

<form action="agreement.php" method="post" enctype="multipart/form-data" target="upload">
<br />
<br />
<input type="button" value="AGREE"
onclick="submit_form(this);" />
</form>
User 187934 Photo


Senior Advisor
20,190 posts
Online Now

Give this a try.
<script>
function submit_form()
{
document.getElementById("myform").submit();
}
</script>

<form action="agreement.php" method="post" enctype="multipart/form-data" target="upload" id="myform">
<br />
<br />
<input type="button" value="AGREE"
onclick="submit_form();" />
</form>
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2639168 Photo


Registered User
3 posts

Eric, thank you so much for the quick response. Got it to go to the php file. Hooray! Now I'm off to figure out what I'm doing wrong with the php file. :) Thanks for getting me this far.

Athelene
User 187934 Photo


Senior Advisor
20,190 posts
Online Now

Did you add it to the root of your site?
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2639168 Photo


Registered User
3 posts

Eric Rohloff wrote:
Did you add it to the root of your site?


I realized that I had not capitalized the first letter of the file name in the form when I should have. Picky, picky! I fixed that little detail and it was off and running. I really appreciate your support.

Athelene
User 187934 Photo


Senior Advisor
20,190 posts
Online Now

Great!
Have fun with your new discovery.:cool:
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.