Jump to content

Matthias

Members
  • Posts

    20
  • Joined

  • Last visited

About Matthias

  • Birthday December 20

Contact Methods

  • Website URL
    https://ambre-medien.de

Profile Information

  • Gender
    Male
  • Location
    Eschborn / Germany

Recent Profile Visitors

1,085 profile views

Matthias's Achievements

Jr. Member

Jr. Member (3/6)

5

Reputation

  1. Thank you very much, but i fear the new build image won't be a square then, but just keeping the original aspect ratio.
  2. Hi there, hopefully i didn't miss something, but i have the following question: I want to show a square picture after upload, independent of the original aspect ratio of the uploaded image. But instead of cutting the parts of the original image, it should be filled up the empty spaces with white, so that in any case the full content of the uploaded original is visible. When i use something like $square = $page->original_uploaded_image->size(500,500); The image will just be cropped. Did i miss something, are there options or any ideas how to ensure that all content will be still visible? Thanks
  3. Thank you. The missing trailing slash in the form action argument was indeed the problem, causing a 301. (see screenshot attached) Now it works fine! So this is correct: <form id="my-form" method="post" action="<?php echo $config->urls->root; ?>proceed/"> … etc …
  4. Thanks for your reply, but it's still not working. Which is obvious i guess, because the code outside the if statement is called in any case, if not ajax or if ajax, too, of course. The config-ajax check was more meant as test if the page "proceed" is really called and working.
  5. Hi there together! Im trying to do the following: Having a simple template (page) form.php (form): <form id="my-form" method="post" action="<?php echo $config->urls->root; ?>proceed"> <input type="text" name="firstname" value="john doe"> <button type="submit">submit</button> </form> <script src="//ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <script> $(document).ready(function() { $("#my-form").submit(function(e){ var form = $(this); e.preventDefault(); $.post( form.attr("action"), form.serialize(), function(result){ form.html(result); }); }); }); </script> posting "to" a simple proceeding template (page) proceed.php (proceed): <pre> <?php if($config->ajax) { echo 'proceed.php via ajax called!'; } if($input->post->firstname) { echo 'hello, ' . $input->post->firstname; } ?> </pre> Everything works fine after hitting "submit" except that the POST data in $input is not found. So the result is: proceed.php via ajax called! and not as wished / expected: proceed.php via ajax called! hello, john doe Any idea why? Because of the serializing? Or maybe i have overseen something? Thanks a lot! Matthias
  6. Hi Zeka, thanks a lot for the links. I switched in my MAMP between PHP 5.6 and 7 and if(empty($input->post->name)) { ... } works only in PHP 5.6 not in PHP 7. For whatever reasons, couldn’t find anything about this in the PHP Docs. Yes, I'll change to the even simpler if($input->post->name) { ... } And say byebye to "empty" ;-)
  7. I have a strange one. inside my module class i want to check the user input, but it does not work like expected. Trying around since hours … what am i doing wrong. Any idea? I have a form, method=post, posting a simple text input "input_name". <?php public function ready() { echo $this->input->post->input_name; // echoes the name if (empty($this->input->post->input_name)) { echo 'no name'; // echoes "no name", too } $foo = $this->input->post->input_name; if (empty($foo)) { echo 'no name'; // echoes nothing, works. } } ?> The "empty" term seems not to work. Im going crazy with this (or $this …)! Is it something about namespaces? PHP7? Any ideas? Thanks a lot!
  8. Hi there. This is a really nice script, and it works really fine! Is there a possibility to use it more than once in my project? I nee a simple contact form and more customized one for other requests. Can i "duplicate" the full script it maybe? Thanks for helping!
×
×
  • Create New...