i am new with kirby and have a problem with it or maybe it is my php knowledge too…
I try to “rebuild” the contact form because we changed our webserver from a local vm to azure(“App Service”) and a few problem with the new smtp-situation(send mails).
At the beginning we used Kirby Uniform but i want to change it with custom php code(sendGrid/O365 Mail API, etc.)
i know have the snippet(site\snippets\contactForm.php):
<div class="mod modForm">
<form action="<?php echo $page->url() ?>" method="POST">
This is a test
<?php echo csrf_field() ?>
<?php echo honeypot_field() ?>
<button class="btn btn-primary" name="demo" type="submit">Nachricht absenden</button>
and the controller(site\controllser\contact.php):
return function ($site, $pages, $page)
//here i want to do my smtp stuff later
when i try to do the normal “header(‘location: URL’)” it is not working. I get the error “This page is currently offline due to an unexpected error. We are very sorry for the inconvenience and will fix it as soon as possible.”
i also tried “Header::redirect(URL)” --> no success
I hope you can help me… i am very frustrated now…
I suggest you first enable debugging to find out what the error is or check your php error logs
thanks for the response.
thats another problem… i cant get it work too.
wether in Azure or in XAMPP.
'debug' => true
Please add your license key, which you've received
via email after purchasing Kirby on http://getkirby.com/buy
It is not permitted to run a public website without a
valid license key. Please read the End User License Agreement
for more information: http://getkirby.com/license
This is my config.php
You’re mixing up Kirby 3 syntax with Kirby 2 syntax here.
c::set() is Kirby 2, the return array Kirby 3. Since you have chosen the Kirby 2 category, you would have to set
c:: set('debug', true);
ahhh thas makes sense.
now i get following message:
After google this error i found a solution…
Put “session_start();” at the beginning of the code solved the issue.
But why did it worked with Uniform/Form?
Does they start the “session” in their library?
I don’t know, but it seems it’s still loading uniform stuff and you are still echoing the
honeypot fields from the plugin. Somehow, that doesn’t really seem to fit together and doesn’t make sense.
Good to know…
its because i used the uniform stuff as template and removed the “for me not important parts”.
It’s not very nice i know, but i am at the beginning of learning Kirby and the general syntax of php.
I will try to make it more clear.
But anyway… my main-problem is solved!
By the way: this was the most fastest response/help i’ve ever recieved for forum posts! Great Job