Using a PHP script file - Post ID 224005
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>
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>
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>
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
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
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

Athelene
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
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
Eric Rohloff wrote:
Did you add it to the root of your site?
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
Great!
Have fun with your new discovery.
Have fun with your new discovery.

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
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.