Jump to content

WinstonLA

Members
  • Posts

    23
  • Joined

  • Last visited

Everything posted by WinstonLA

  1. 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?
  2. 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>
  3. Instead $('.likestatusclass').click(function(x){ use $('body').on('click', '.likestatusclass', function(x){ This should solve the problem.
  4. http://stackoverflow.com/questions/2787910/why-does-mysql-autoincrement-increase-on-failed-inserts
  5. 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
  6. Try to add CURLOPT_PORT curl_setopt($ch, CURLOPT_PORT, 84);
  7. Open init.js file, find the line with code var finalDate = '2016/01/01'; And change finalDate to what you need
  8. Before using $_POST[ 'modsToBeChecked' ] you need check if this element is exists if(isset($_POST[ 'modsToBeChecked' ])) { //Element exists, you may use it }
  9. @Asumi You're welcome Please mark this topic as answered if you can do it
  10. 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.
  11. 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
  12. 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
  13. I don't understand what problem? Did you never see default parameters for functions?
  14. I don't quite understand... Do you trying do F5 protection?
  15. 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
  16. 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
  17. String functions that you're using will be more performance than RegExp used me xD
  18. $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
  19. OK session_start() must be at first line of your file Check your the files ecoding. If it UTF-8 check that it should be UTF-8 Wihtout BOM These rules compliance?
  20. 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'); }); });
  21. Also you can use file_get_contents() (if server configuration enabled allow_url_fopen setting) + RegExp
  22. I can't see session_start() in your file1.php, therefore age key don't saving in session.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.