PHP - Moved: Really Random Question Doesn't Belong Anywhere
This topic has been moved to Miscellaneous.
http://www.phpfreaks.com/forums/index.php?topic=310934.0 Similar TutorialsThis topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=349338.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=315227.0 Hi, I'm trying to display the products for a certain tag in the email for new order in wooCommerce. For example, I want that when a client buys a product with a certain tag, all the products that have that tag to be added automatically to the order email too. For now I achieved to display the tag in the email but not the products that have that tag. I don't know how get the products that belongs to that tag and add them to the cart to so I can display them in the email. Any help as small as it may be, it is very welcomed, please. I'm a bit stuck. I'm not very skilled in php... Thank you very much function email_products_per_tag( $order, $item ) { $items = $order->get_items(); foreach ( $items as $item ) { $terms = wp_get_post_terms( $item['product_id'], 'product_tag' ); foreach($terms as $term){ $term_names[] = $term->name; // Product tag Name // $item2 = 'product_tag'=> ; // not very sure about this line... } } } add_action( 'woocommerce_email_after_order_table', 'email_products_per_tag', 10, 4 ); Edited September 15, 2020 by cimita hi... Im developing a web site to store a audio and video songs and it enable to download the songs for users. most of features I have finished at the moment. I need to count download users amount in a song and also need to count how many users view it only. actually I dont have any idea to do it using php. so anyone can me give any idea how to do it. thanks in advance for your help.... actually im try to do similar this http://www.music.lk/....php?index=5938 please give me any idea to do it.. thanks again.... [attachment deleted by admin] hi... Im developing a web site to store a audio and video songs and it enable to download the songs for users. most of features I have finished at the moment. I need to count download users amount in a song and also need to count how many users view it only. actually I dont have any idea to do it using php. so anyone can me give any idea how to do it. thanks in advance for your help.... [attachment deleted by admin] This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=314527.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=319085.0 Hi everyone Well I've started learning php yesterday and now I encountered my first problem, I looked around but I don't really know what to search for if I want my answer so here I come Code: [Select] <html> <body> <?php $names = array('Peter','Quagmire','Joe'); $ages = array("Peter"=>32, "Quagmire"=>30, "Joe"=>34); $who = rand(0,2); $who2 = $names[$who]; echo "$names[$who] is $ages[$who2] years old"; ?> </body> </html> This is the script I have, and there is the kind of script I expected: Code: [Select] <html> <body> <?php $names = array('Peter','Quagmire','Joe'); $ages = array("Peter"=>32, "Quagmire"=>30, "Joe"=>34); $who = rand('Peter','Quagmire','Joe'); echo "$who is $ages[$who] years old"; ?> </body> </html> But after some search I concluded that rand is only used for random numbers So, my question is, which function should I use to achieve my goal? Is there any randstring('string1','string2',etc) command? Tnx for your time This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=321864.0 This topic has been moved to Other Web Server Software. http://www.phpfreaks.com/forums/index.php?topic=331552.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=308276.0 This topic has been moved to Application Frameworks. http://www.phpfreaks.com/forums/index.php?topic=355562.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=305845.0 This topic has been moved to Other Programming Languages. http://www.phpfreaks.com/forums/index.php?topic=312147.0 The PHP code sends me an email from the server, but the user input is empty or "blank". I only receive: "From: \ Email: \ Subject: \ Message: " and that's it. How do I fix my PHP and/or HTML code to receive user input from the form? Attached is my existing HTML and PHP code that doesn't send me any "user input" from the form. Thanks to anyone who can help!!
As above, I have a lottery style site that picks a random number between 1-8 but my users complain for some reason that this is not enough. So i was told to look into using fopen and random.org to generate a random number. Anyone have experience of this and perhaps a code snippet for me to look at and possibly use? help will be appreciated. This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=331562.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=345714.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=342468.0 Amazingly, threads about application design belong in the Application Design sub-forum. This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=358384.0 |