Email subscription form in octobercms - laravel

I am using Email Subscription Form plugin. When I enter the email address in the form and click the submit button, the submitted email appears in the url and it redirects to the same page. I did the configuration as mentioned in the documentation but it is not working. Neither the subscription list is updated nor it shows the userProfile page.
<form name="form-subscribe-andradedev" id="form-subscribe-andradedev" data-request="formSubscribe::onAddSubscriber" data-request-update="'formSubscribe::alert': '#result'">
<input type="email" class="form-control" name="email" placeholder="* Email" required>
<input type="hidden" name="latitude" id="latitude">
<input type="hidden" name="longitude" id="longitude">
</form>

Reads like you need {% frameworks extras %} loading in the template somewhere. You also need the jquery loaded before that.

Related

Passing input to url with get method in form in laravel 5.1

I want to pass my search input to laravel 5.1 like this
localhost:8000/search/{searchtext}
but right now it send data with this method
localhost:8000/search?search='searchtext'
<form action="search" method="get" class="form-wrapper">
<input type="text" NAME="query" id="search" placeholder="جستجو ..." required>
{{--<input type="hidden" name="_token" value="{!! csrf_token() !!}">--}}
<input type="submit" value="بررسی" id="submit">
</form>
Can you give me a solution for it?
Change the action attribute of the form in the onSubmit event, you have to use javascript. The exact code depends if you are using a library like jQuery or plain Javascript.
Here a useful link:
Change form action based on submit button

how to generate a HTTP rquest in a controller spring mvc

I have a form created with bootstrap and I use spring MVC. I don't use spring security here.
<form role="form">
<fieldset>
<div class="form-group">
<input class="form-control" placeholder="Username" name="name" type="text" autofocus>
</div>
<div class="form-group">
<input class="form-control" placeholder="Password" name="password" type="password">
</div>
Login
</fieldset>
</form>
I want to send the username and password to the welcome url. How can I do that.
Now, when I use #RequestParam("name") annotation, it gives an
Required String parameter 'name' is not present
error.
Set the 'action' attribute of the form to the url that you want to submit the form to.
The url can be absolute (http ://...) or relative (some/path), depending on where the page is hosted.
You may need to set the 'method' attribute on the form to POST , if the server expects a POST request.
You also want a submit button too

Honeypot protection with Ajax

Recently i got attacked by nasty auto-form fill bots which filled my shout form with all sorts of spam. My shout form consist from a html file with 2 textboxes,an ajax script(for refreshing without reloading) and my php file for handling all the inserting data into my DB.
I am thinking implementing a hidden textbox for a minimum protection against these bots but with no luck since i cant pass the honeypot data to my php file. My code:
HTML Form
<form class="form" method="post" action="postdata.php">
<fieldset id="inputs">
<input id="name" name="name" type="text" placeholder="name" maxlength="20">
<textarea id="message" name="message" type="text" placeholder="message" maxlength="255"></textarea>
</fieldset>
<fieldset id="actions">
<input type="submit" id="submit" value="Submit">
</fieldset>
</form>
Ajax script
$(function(){refresh_shoutbox();$("#submit").click(function(){var a=$("#name").val();var b=$("#message").val();var c="name="+a+"&message="+b;$.ajax({type:"POST",url:"postdata.php",data:c,success:function(d){$("#shout").html(d);$("#message").val("");$("#name").val("")}});return false})});
function refresh_shoutbox(){var a="refresh=1";$.ajax({type:"POST",headers:{"cache-control":"no-cache"},url:"postdata.php",data:a,success:function(b){$("#shout").html(b)}})};
postdata.php file
<?php
if($_POST['name'] or $_POST['message']) {
$name= $_POST['name'];
$message= $_POST['message'];
///do other stuff/////
?>
I will insert a hidden field in my html form
<input id="email" name="emails" style="display:none"></br>
but i cant manage to pass the extra value to my existing ajax script.Tried some code but with no luck.
Any help so i can get my shoutbox up and running again?

Joomla module form to submit to same page

I have a Joomla module in an article. The module has a form, and when I submit the form I want it to reload the same page (and some PHP will take care of the form's new state).
Is there any way to do this with a module, without using ajax? Because at the moment Joomla throws a 404 and I can't figure out where the form is trying to submit to.
Let's say my page is http://www.example.com/payment
The form submits to http://www.example.com/404
This is my form:
<form method="post">
<label>Order ID</label>
<input type="text" name="id" value="<?php echo $_POST['id']; ?>" />
<label>Email</label>
<input type="text" name="email" value="<?php echo $_POST['email']; ?>" />
<input type="submit" name="login" value="Continue" />
</form>
I have tried having no form action, as well as:
action="index.php?option=com_content&view=article&id=8"
action="/index.php?option=com_content&view=article&id=8"
action="payment"
action="/payment"
It always submits to 404.
The problem may be with submiting id via input, because Joomla uses id internally to find the correct route, so if you overwrite it with your request, Joomla will try to get article/category with unexisting id.
So, try to rename the name of the input with id and see what happens.

Magento - How can I pass UserId instead of OrderId to ADYEN SKIN

I'm using adyen to pay by credit cards and I notice that when the user pays, the module on Magento passes the order id as MerchantReference to Adyen.
In order to activate the "remember my data" during the payment using adyen SKIN, I need to pass the UserId and not the orderId.
Any suggestion how to solve it?
--- More info ---
This is the specific module: http://www.magentocommerce.com/magento-connect/adyen-payment.html
And, this is the form example that we generate for the payments on Adyen, in another environment. As you can see, the merchantReference is an unique value, which identify the first user payment. This values is calculated using UserId, so we could identify the user for his next payments.
I should need to know where the plugin Adyen (for Magento) generate this form, so I could change the merchantReference parameter using UserId and not OrderId
<form action="https://test.adyen.com/hpp/pay.shtml"
method="post" id="gatewayPaymentForm">
<input type="hidden" name="merchantReference" value="Ajx">
<input type="hidden" name="paymentAmount" value="2900">
<input type="hidden" name="currencyCode" value="EUR">
<input type="hidden" name="shipBeforeDate" value="2013-02-03">
<input type="hidden" name="skinCode" value="XDFGG">
<input type="hidden" name="merchantAccount" value="NameAccount">
<input type="hidden" name="shopperLocale" value="es">
<input type="hidden" name="sessionValidity" value="2013-01-31T16:35:31+01:00">
<input type="hidden" name="merchantSig" value="bcbXNhsd">
<input type="hidden" name="shopperEmail" value="asd#gmail.com">
<input type="hidden" name="shopperReference" value="5">
<input type="hidden" name="recurringContract" value="ONECLICK">
</form>
Thank you
Already solved, we modified the file: /Madia/Adyen/Model/Adyen/Hpp.php
//To identify and remind user data with mail.
$adyFields['shopperReference'] = $customerEmail;
It works for us.

Resources