
WinstonLA
Members-
Posts
23 -
Joined
-
Last visited
Everything posted by WinstonLA
-
Hm... Try this code foreach ($swap["sims"] as $item) { var_dump($item); } Something is outputting on the screen? If so, go back to your code and open (Ctrl+U) code of you page and find there your select tag. Will there be any options?
-
Change name for second variable in the foreach foreach ($swap["sims"] as $swap) foreach ($swap["sims"] as $swap) This formatting looks better <select name="sim_for_swap[]"> <?php foreach ($swap["sims"] as $item): ?> <option value="<?php echo $item['voice']; ?>"> <?php echo $item['voice']; ?> </option> <?php endforeach; ?> </select>
-
Function stops working after div reload (DOM?)
WinstonLA replied to slj90's topic in Javascript Help
Instead $('.likestatusclass').click(function(x){ use $('body').on('click', '.likestatusclass', function(x){ This should solve the problem. -
http://stackoverflow.com/questions/2787910/why-does-mysql-autoincrement-increase-on-failed-inserts
-
For PHP >= 5.3 you should use preg_* functions instead ereg(), instead of eregi() you should use preg_* funcitons with modificator i In your case you need use preg_match with modificator i
-
Try to add CURLOPT_PORT curl_setopt($ch, CURLOPT_PORT, 84);
-
Open init.js file, find the line with code var finalDate = '2016/01/01'; And change finalDate to what you need
-
Before using $_POST[ 'modsToBeChecked' ] you need check if this element is exists if(isset($_POST[ 'modsToBeChecked' ])) { //Element exists, you may use it }
-
@Asumi You're welcome Please mark this topic as answered if you can do it
-
OK. Try comment this line $anime = $file = str_replace(' ', '\ ', $anime); And after line $anime = "Sous-titres/".$anime."/"; write var_dump(file_exists($anime)); this will show that is there that directory. If so than uploading should be successful, if no, you need find that path that is will be returned true by file_exists() function.
-
As I know filename can't be Akame\ ga\ killFilename.jpg because Akame\ ga may be considered as a directory. You should avoid slashes in filenames or create appropriate directories and then specify slashes in filename
-
Maybe the directory that you're trying upload file in, hasn't write permissions. Set error reporting level to error_reporting(-1); May some errors will be output
-
I don't understand what problem? Did you never see default parameters for functions?
-
Detect whether the page was refreshed
WinstonLA replied to NotionCommotion's topic in PHP Coding Help
I don't quite understand... Do you trying do F5 protection? -
@Barand Thanks for benchmark
-
Regular expressions is a magiŃ, not all can understand it xD You can get access to the string in array specify array key index. No problem You need not preg_match() but regular expressions before. Good book about it http://shop.oreilly.com/product/9780596528126.do
-
can i use request to add text to my page from url
WinstonLA replied to cloudll's topic in PHP Coding Help
After email added, add redirect header('Location: some_location?added=ok'); And where it need add checking if(isset($_GET['added']) && $_GET['added'] == 'ok') { echo 'Email was added successfully'; } It is the simplest way -
String functions that you're using will be more performance than RegExp used me xD
-
$page = file_get_contents("http://www.curse.com/mc-mods/minecraft/railcraft"); preg_match('#<li class="newest-file">(.*?)</li>#is', $page, $version); echo '<pre>' . htmlspecialchars(print_r($version, 1)) . '</pre>'; The result is Array ( [0] => <li class="newest-file">Newest File: Railcraft 9.4.0.0</li> [1] => Newest File: Railcraft 9.4.0.0 ) Or like this preg_match('#<li class="newest-file">.*([0-9\.]++).*</li>#Uis', $page, $versionNum); echo $versionNum[1]; //9.4.0.0 If you need only version number
-
Targeting an element inside a PHP loop using jQuery
WinstonLA replied to tsangaris's topic in PHP Coding Help
Try like this 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' . $i . '" 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" class="quantity_updatebtn">Update Quantity</button> </td>'; echo '</tr>'; } $(document).ready(function(){ $('body').on('click', '.quantity_updatebtn', (function(){ //i use this value to find the exact entry in the database var id = $(this).attr('value'); var quantity_selected = $(this).closest('tr').find('select[id^="quantity"] option:selected').val(); $.ajax({ type: "POST", url: "js/ajax/updatequantity.php", data: {id: id, new_quantity: quantity_selected} }); //this is for testing alert('ok'); }); });- 4 replies
-
- php
- javascript
-
(and 1 more)
Tagged with:
-
Also you can use file_get_contents() (if server configuration enabled allow_url_fopen setting) + RegExp