PHP - Need Help Targeting The Right Varibles?
Hi can anybody help me , what am i doing wrong here?
this one works
/////////////////////////////////////////
$(document).ready(function(){
Similar Tutorialshi i have set 2 varibles, and want to echo them out if they are true, i have this script but doesnt work, please help. <?php $month=$_GET['month']; $year=$_GET['year']; If($year!=0 && $month!=0) { echo $month; echo $year; } ?> cheers matt Doing a horizontal scrolling site project and trying to use Lightbox to show portfolio images. Here's the deal--I have everything working but there's one wrinkle. I have the gallery content loading in an iframe because that works best in the horizontal scrolling design. When you click on a thumbnail you can't go to another page like in a normal design because the site is one big page. So the page "album.php" loads in an iframe. However once it's loaded and you click on an image, the Lightbox loads in the iframe too which is not big enough to have the full screen effect I need. That's the wrinkle. Is there a way to modify the PHP code to have the lightbox content load in the full screen, something like target="parent" instead of in the iframe? Here's the link so you can see what I mean: http://staging.workshop-marketing.com/index-current.php#Approach The page in question, not in the iframe showing the full screen effect I need: http://staging.workshop-marketing.com/album.php Here's the code I think needs to be modified, however I'm not a PHP coder: <?php <br /> if(isset($_GET['s'])) { $opts = array( 'template' =>'c_list_image.html' ); perch_gallery_album($_GET['s'], $opts); } ?> Thanks for any suggestions and help-- I want to fetch items from a database and be able to update their quantity by selecting a number from a drop down selection and press the button "Update quantity" to perform the action.
I have the following php code:
echo '<table border="4"> <tr> <th>ID</th> <th>Item Name</th> <th>Current Quantity</th> <th>New Quantity</th> <th>Update</th> </tr>'; for($i=0 ;$i<$k; $i++) $z = $i+1; //fetch data from database $id = the id of the row that the entry/item is at $item_name = the name of the item $current_quantity = the current quantity of the item //create a table of entries echo '<tr'> <td>'.$z.'</td> <td>'.$item_name.'</td> <td>'.$current_quantity.'</td> <td> <select id="quantity" name="quantity"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> . . . </select> </td>'; echo '<td> <button type="button" value="'.$id.'" name="updatebtn" id="updatebtn">Update Quantity</button> </td>'; echo '</tr>';Where k = number or matches in database The result is something like this: //////////////////////////////////////////////////////////////////////////// ///ID // Item Name // Current Quantity // New Quantity // Update /// //////////////////////////////////////////////////////////////////////////// // 1 // Shoes // 10 // 12 // Update Quantity // //////////////////////////////////////////////////////////////////////////// // 2 // T-shirts // 5 // 8 // Update Quantity // //////////////////////////////////////////////////////////////////////////// // 3 // Watches // 4 // 2 // Update Quantity // //////////////////////////////////////////////////////////////////////////// The first 3 columns are populated by the database and New Quantity by the user. As soon as the user is done with the new quantity he/she presses "Update Quantity" to update the database. Below is the jQuery code i use: $(document).ready(function(){ $('#updatebtn').click(function(){ //i use this value to find the exact entry in the database var id = $('#updatebtn').attr('value'); var quantity_selected = $('select#quantity option:selected').attr('value'); $.ajax({ type: "POST", url: "js/ajax/updatequantity.php", data: {id: id, new_quantity: quantity_selected} }); //this is for testing alert('ok'); }); });The updatequantity.php script just takes the new quantity and the row of the entry and updates the value. My problem is: If i press the "Update Quantity" of the item "Shoes", i see the pop-up "ok" and the quantity is updated. But when i try to do the same for the 2 other items (T-shirts and watches), i get nothing. Does my js script has trouble to differentiate between the "Update Quantity" buttons? Is there another approach? ps: i am doing this using wamp on my localhost Thanks in advance. I am getting the following error when using composer: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? Just started. I am pretty sure composer.json wasn't changed. journalctl doesn't show anything. Maybe Doctrine related, however, nothing seems to help.
Any ideas? [michael@devserver www]$ php -v PHP 7.3.4 (cli) (built: Apr 2 2019 13:48:50) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.4, Copyright (c) 1998-2018 Zend Technologies with DBG v9.1.9, (C) 2000,2018, by Dmitri Dmitrienko [michael@devserver www]$ composer -V Composer version 1.4.2 2017-05-17 08:17:52 [michael@devserver www]$ yum info composer Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.us.oneandone.net * epel: mirror.rnet.missouri.edu * extras: mirror.us.oneandone.net * remi-php73: mirror.bebout.net * remi-safe: mirror.bebout.net * updates: mirror.us.oneandone.net Installed Packages Name : composer Arch : noarch Version : 1.8.4 Release : 1.el7 Size : 1.8 M Repo : installed From repo : epel Summary : Dependency Manager for PHP URL : https://getcomposer.org/ License : MIT Description : Composer helps you declare, manage and install dependencies of PHP projects, : ensuring you have the right stack everywhere. : : Documentation: https://getcomposer.org/doc/ [michael@devserver www]$ composer update Loading composer repositories with package information Updating dependencies (including require-dev) [ErrorException] "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>]... [michael@devserver www]$
|