hellboy
Members-
Posts
13 -
Joined
-
Last visited
Everything posted by hellboy
-
So now it works. No clue why, im getting through the git changes and compare it with that im having right now ? Thanks for all your great answers sorry that im beeing so harsh Thanks for your time. this is the code that works just fine <input class="checkout" type="submit" name="submit"> </form> </div> <?php if ($input->post->submit) { foreach($input->post as $key => $value) echo htmlentities("$key = $value") . "<br />"; echo "<p>Data successfully submitted {$sanitizer->text($input->post->prnumber)} amount: {$sanitizer->text($input->post->quantity)}</p>"; } AAAAAAAAAAAAAAAAHHHHHHHHHHHHHHH..... That was the issue ..... oh my god.... ??
-
thats right but i checking also against $input->post->submit and getting nothing ?
-
I dont know what im doing wrong... its realy sh... Its very easy to catch some data from an post request in other languages ... I only have this code right now and cant get it to work <?php if ($config->ajax) { echo "test"; } $action = $pages->get('/shopping-cart/')->httpUrl; ?> <form method="post" action="<?php echo $action ?>"> <input name="prnumber" value="23"> <input name="quantity" value="2323"> <button type="submit" class="checkout">Checkout</button> </form> </div> <?php if($input->post->submit) { echo "super"; } ?> i can see the post request in the network tab and all the data but cannot reach it in pw. its realy frustrating if i build the app not that far i would think about to switch to another cms ?
-
what i actually want is that i can post a json to page and when succed show a success page
-
Oh hello thank you for your help. it seems that i cannot get the post request to php properly
-
ok now i get it in the console the whole html page is in the msg and the php says: thats not working
-
Hello all, I need some help :). I want to send a post request via ajax. Everything works just fine in the console but i cannot reach the post request in php I have this button in my shopping-cart.php file as markup <button onsubmit="sendMail()" class="checkout">Checkout</button> this is what sendMail() does: function sendMail() { $.ajax({ method: "POST", url: "<?php echo $pages->get('/shopping-cart')->url ?>", data: { test: "test" } }) .done(function( msg ) { console.log( "return: " + msg ); }); } and this is what i want to echo in the first place per php: $ret = isset($_REQUEST["test"]) ? "this is a: ".$_REQUEST["test"] : "thats not working"; echo $ret; in the console i see the request with a status 200 Request Header: Request URL:http://localhost/shopping-cart/ Request Method:POST Status Code:200 OK Remote Address:[::1]:80 Referrer Policy:no-referrer-when-downgrade Cache-Control:no-store, no-cache, must-revalidate Connection:Keep-Alive Content-Encoding:gzip Content-Length:4527 Content-Type:text/html; charset=utf-8 Date:Mon, 14 May 2018 06:22:13 GMT Expires:Thu, 19 Nov 1981 08:52:00 GMT Keep-Alive:timeout=5, max=100 Pragma:no-cache Server:Apache/2.4.10 (Debian) Vary:Accept-Encoding X-Frame-Options:SAMEORIGIN X-Powered-By:ProcessWire CMS X-XSS-Protection:1; mode=block Accept:*/* Accept-Encoding:gzip, deflate, br Accept-Language:de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7 Cache-Control:no-cache Connection:keep-alive Content-Length:9 Content-Type:application/x-www-form-urlencoded; charset=UTF-8 Cookie:useCookies=active; wire=e7e454666fe95e1df8ee1a194de6eb82; wire_challenge=jA9Y9Yym1J52K9MzMN2c%2F%2FH9sX24RzlC; shopping={%22products%22:[{%22articleNumber%22:%22015%2001%20137%22%2C%22amount%22:1}]} Host:localhost Origin:http://localhost Pragma:no-cache Referer:http://localhost/shopping-cart/ User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36 X-Requested-With:XMLHttpRequest test:test the post is submitted but i cannot reach it within the php file can someone help me? thank you very much
-
ah perfect thats awesome thank you!!! im trying to implement that this week. thank you all
-
ah ok yeah thats was my first aproach but i dont find a proper way to save the thing in coockies?
-
Ok sorry for the poor explanation. I have a site there you can go to a site and choose your product and click on a button "in Shopping-cart". What i want is now to retreive the submit from the button and store it in a field. When its there i can create the shopping cart view and list all the products that in the user fields a example is here http://ims.thomas-berendt.de/zubehoer/absperrblasen/kegelrohrdichtkissen/
-
Hiho, not a framework because its only for logged in users and they dont get charged by submitting the order is only a email that going to the company and customer. For that i dont want a framework because everything so far is good enough for pw. I dont want to make a big webapplication because its not necessary. Datamodel is a json right now to handle dropdown fields via ajax 50 - 100: {price: 225, productnumber: "900 01 050"}80 - 150: {price: 249, productnumber: "900 01 051"}120 - 200: {price: 255, productnumber: "900 01 052"} the bussiness logic is not implemented yet i want to store it in custom user fields and put a prefix on to delete it when the email is send to the client
-
Uhm, yeah i noticed that there is a module for shopping cart. But i want do it on my own :). I dont get it right now to use a button and store a new field to the logged in user. I hava a button like this: echo "<a class='cart-btn' href='#' >$shopingcard_text</a>"; so now i want to store the data from the form in custom user fields: echo "<form>"; <ul> <li> <div>Menge</div> <div class="count-input"> <div class="incr-btn" id="decr-btn" data-action="decrease"><i class="icofont icofont-curved-left"></i></div> <input class="quantity" type="text" name="quantity" value="1"/> <div class="incr-btn" id="incr-btn" data-action="increase"><i class="icofont icofont-curved-right"></i></div> </div> </li> <li id="price-amount" style="display: none"> <div>Gesamtpreis:</div> <div class="count-input" id="price-sum">2</div> </li> per javascript i add some more divs with price and productnumber.
-
Hello all, I want to store some Userdata for a shopping cart. I want to do it in the user database and retrieve it from there. what i have now is a Link button and there i want to store a Productnumber for the logged in user. What i want is: Userdatabase -> shoppingcart->items, amount is this possible? Cheers