I would like to know if there's a way to add a .php file to a Blogger template using a direct link. I am unsure whether or not I can add it to my form action with a URL as Blogger does not support .php directly.
<form method="post" action="CAN_I_USE_A_URL_HERE?.php">
<input name="Name" placeholder="Name*:"/>
<input name="E-mail" type="email" placeholder="E-mail*:"/>
<input name="Phone" type="email" placeholder="Phone:"/>
<label>Write your message!</label>
<textarea name="Message"></textarea>
<input id="submit" name="submit" type="submit" value="submit"/>
</form>
Blogger will not run server-side code.
You need to put your PHP code on some server that will run it for you, then make the <form> point to that.
Related
So I have been browsing trough a lot of threads, and the only suitable solution for my situation I found was this:
PHP:
<?php
if(isset($_POST["submit"])) {
my php code goes here
}
?>
HTML:
<form id="usp-form-23" class="usp-form" method="post" enctype="multipart/form-data" action="" data-validate="parsley" data-persist="garlic" novalidate>
<input name="usp-title" type="text" value="" data-required="true" required="required" maxlength="99999" placeholder="Answer" class="usp-input usp-input-title" />
<input name="submit" id="submit" type="submit" class="usp-submit usp-submit-default" value="Send Message" />
</form>
But it doesn't work.
Maybe I'm missing something?
Need help.
P.S. I can't use an external php file. Only php code inside the same file, because of the variables I need to grab from the post.
I also can't use $_GET, because if a person refreshes the page, my php will be repeated, which I don't want. I only need to run my php once.
I'm trying to create a contact form on my own. I noticed that it can be achieved by placing the form inside an article, instead of a custom html module.
In the client side, it seems to work. I even added a captcha manually (the re-captcha plugin doesn't seem to work for me). The problem is, I set form's action property as "mail.php", and just added this "mail.php" file to the the template root. The "mail.php" supossedly retrieves the data send by post, and finally composes and sends the email, showing a "message send" notification.
Anyway, when I click on submit, the form page is just reloaded. I guess that Joomla! can't find my "mail.php". I guess that this issue is related to the joomla structure and my inability to place the "mail.php". Any help will be wellcome.
This is how my article looks like (wysiwyg editor mode disabled):
<form action="mail.php" method="post" target="_blank">
<p><label for="nombre">Nombre:</label></p>
<p><input maxlength="50" name="nombre" size="30" type="text" /></p>
<p><label for="email">Email:</label></p>
<p><input maxlength="50" name="email" required="required" size="30" type="text" /></p>
<p><label for="asunto">Asunto:</label></p>
<p><input maxlength="150" name="asunto" size="30" type="text" /></p>
<p><label for="mensaje">Mensaje:</label></p>
<p><textarea cols="50" maxlength="700" name="mensaje" required="required" rows="8"></textarea></p>
<div class="g-recaptcha" data-sitekey="6Lefblahblahblahblah"> </div>
<p><input type="submit" /></p>
</form>
This form submits url like that
http://www.website.com/page/search.php?search=demo&submit=Search
<form action="search.php?search=" method="GET" id="search-form">
<input id="search-text" name="search" type="text" maxlength="30" placeholder="type keyword"/>
<button type="submit" name="submit" value="Search" id="search-button">Search</button>
</form>
Where I want to post the form like that:
http://www.website.com/page/search/demo.html
How can I do this?
I know it is a small thing but help me..
Thanks
I am unclear what your question is.
If you mean that you want to be able to process the input client-side, that is not possible unless you override the behavior with javascript. For example with jQuery
$( "search-form" ).on( "submit", function( event ) {
// Do stuff here with the form data
event.preventDefault();
});
If you mean that you don't want .php to show up and want to hide the underlying server technology, then you can use something like Apache's mod_rewrite. But you probably don't want that in this case because .html implies that it's a page you visit (GET, not POST) rather than a script you submit variables to.
Save this code as form.html on your desktop then open it with your browser then add some values and click the button. Look at the url afterwards
<form method="get" action="#">
<input type="text" name="input1">
<input type="text" name="input2">
<input type="text" name="input3">
<input type="text" name="input4">
<button type="submit">Click me and look at the url</button>
</form>
After seeing your edited question, try this with the above steps( save on the desktop etc.etc)
<form method="post" onsubmit="this.action=window.location.href.replace('.html',inputurl )">
<input type="text" name="input1" onblur="inputurl='/'+this.value+'.html'">
<button type="submit">Click me and look at the url</button>
</form>
I have a chat and i would want to send files also during chat. I would want the same approach like facebook has: when you put the file it should not put into the specific textbox that comes with input=file and to not have the browse button? is this doable?
<form method="POST" name="form1" action="" id="myForm" enctype="multipart/form-data">
<input name="message" type="text" id="textb" value="" />
<input name="submit" type="submit" value="Chat" id="post_button"/>
<input type="file" name="fisier">
</form>
That's done with a combination of CSS and javascript.
Take a look at: http://www.dropzonejs.com/
I want to do a login into a web using the URL. The login form is in this web https://www.kindertic.com/en/log-in
and the source code is like this
<form method="POST" name="form-login">
<div><input type="text" maxlength="25" name="usernamekt" id="username"/></div>
<div><input type="password" name="passwd" maxlength="30" id="passwd"/></div>
<div><input type="submit" value="Log in" class="input-submit" name="enviar-login"/></div>
</form>
I have tried to do this https://www.kindertic.com/en/log-in?usernamekt=XXXXXX&passwd=YYYYYY but nothing happens. How can I do that?
Other thing is to know what is the file that opens the redirection or this webpage?
Thanks in advance and sorry for my english.
If what you want is https://www.kindertic.com/en/log-in?usernamekt=XXXXXX&passwd=YYYYYY then you need <form method="GET">