Jump to content

saynotojava

Members
  • Content count

    30
  • Joined

  • Last visited

Community Reputation

0 Neutral

About saynotojava

  • Rank
    Member
  1. saynotojava

    Ajax call without reloading ?

    Figured out that one as well - i had jquery include in http url, and for some reason firefox is blocking js load in case of protocol mismatch.
  2. saynotojava

    Ajax call without reloading ?

    Finally figured out what i was doing wrong- i need to use echo only, not session, since it is ajax call is the one which handle data back and forth. Since session is method what is used in PHP to handle data between pages, i assumed same for javascript but it was wrong assumption. But there is still one problem remaining - for some reason, ajax call is not working on https protocol . I found possible solution here: https://serverfault.com/questions/891980/ajax-post-not-working-on-https-ssl-nginx , but it's not working.
  3. saynotojava

    Ajax call without reloading ?

    So in shortly, not possible ?
  4. saynotojava

    Ajax call without reloading ?

    So i have two files, one with ajax call and second with content which is called. And i get what i need(displaying session variable so in this case), but only when i manually refresh page, while i should see result immediately after i load file with ajax call for first time. Is that possible? Test.php <?php session_start(); ?> <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> <script type="text/javascript"> $.ajax({ type: "GET", url: 'ab.php', data: {name: 'Wayne', age: 27, country: 'Ireland'} }); </script> <?php echo $_SESSION["so"] ; ?> ab.php <?php session_start(); $name = $_GET['name']; $age = $_GET['age']; $_SESSION["so"]='kukulele'; ?>
  5. saynotojava

    Changing sorting order in pagination class

    Actually, when i tested different queries, when you dont specify ORDER in query, by default it order by ID(alias first column). So if you dont want ORDER to run , then you need to specify NULL.
  6. saynotojava

    Changing sorting order in pagination class

    There is not much difference between example code and my code, only difference is sql query and obviously HTML layout. Everything else is same as in example code.
  7. saynotojava

    Changing sorting order in pagination class

    It's a specific query in specific situation which require order by NULL to make it work properly. It does sounds like a terrible thing, but since i have this class already, it should be possible to reverse page output, so page 1 become page 10,page 2 become 9 and so on.
  8. I am using following pagination class: https://github.com/BenGriffiths/pdo-mysqli-pagination and i have specific situation where i cant use ordering inside mysql query. How do i change sorting in this pagination class, where loading first page wont load first page but last page instead ? (that way i'l get proper sorting)
  9. saynotojava

    Generting mysql queries based on table data

    1. I was copy paste-ing example code so that line was copied too. I always have it only once. 2.This is how i have it stored - ID 1 Android ID 2 Iphone ID 3 Raspberry 3.Yes it is, not just for that but also to prevent sql injection. Tho, first i want to finish my project , then i will go over entire code and switch all querys with prepared statements. 4. I dont see how at the moment. Tho, i should find it step by step. And here is sample of current working code: $conn = new mysqli($servername, $username, $password, $dbname); $result = $conn->query("SELECT temp FROM temp "); while($arow = $result->fetch_assoc()) { { $bresult = $conn->query("SELECT COUNT(`Device`) AS 'KU' FROM `table` WHERE `Device` LIKE '%{$arow['temp']}%'"); while($row = $bresult->fetch_assoc()) { echo "<font size=\"6\"> <div align=\"left\">Overall {$arow['temp']} : {$row['KU']} </div></font>"; } } } Also, what i noticed, how i using if ($result->num_rows > 0) on almost every query, yet seems to me how that might be not needed in most cases.
  10. saynotojava

    Generting mysql queries based on table data

    Working now, was loading wrong query in second loop. This thread can be closed.
  11. saynotojava

    Generting mysql queries based on table data

    Yes, just tested it and it seems php code/query can be looped inside while loop. Tho, it seems it does not load second entry in table, only first one.
  12. So, i have following code: $conn = new mysqli($servername, $username, $password, $dbname); $result = $conn->query("SELECT COUNT(`Device`) AS 'KU' FROM `table` WHERE `Device` LIKE '%android%'"); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { { echo "<font size=\"6\"> <div align=\"left\">Overall number of android devices is {$row['KU']} </div></font>"; } } } else {} $conn = new mysqli($servername, $username, $password, $dbname); $result = $conn->query("SELECT COUNT(`Device`) AS 'KU' FROM `table` WHERE `Device` LIKE '%ios%'"); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { { echo "<font size=\"6\"> <div align=\"left\">Overall number of ios devices is {$row['KU']} </div></font>"; } } } else {} What this is doing, is counting entries which are listed as android and as ios. But how do i make this code blocks based on external data? Let's say i have table in mysql, which contain titles android,ios and windows, and as result i get output which would be matching 3 code blocks, each with query android,ios and windows. Would be putting this code into another while loop be enough ?
  13. saynotojava

    Recording url redirect in iframe?

    Let me put this way - let's say you are webmaster, and i am advertiser. I give you a link to advertise on your site, you checked it and it is fine. But i added a setting to redirect to bad url which is different then your browser, and wouldn't you want to know what is really happening? I dont need to know what exactly is user doing it after url is loaded, but i do need to know does he see same thing when i load url in my browser.
  14. saynotojava

    Recording url redirect in iframe?

    Purpose of this is to detect malware/bad links in redirect url - when you have a redirect url which redirect based on criteria, url might be fine when you check with your browser, but could be malware/bad link with other browser. Method does not need to be iframe(this is just idea to do it), nor user need to stay on site, i just need to see what happening with user when he leave site. At the moment i need to use different browsers manually to do such checks, but when you have tons of links to check it become a tedious job.
  15. How do i record with php when user loads external url which redirect , what urls's he loaded by using invisible iframe(so the user still stay at my site) ? I do know this can be done with curl and i tested it, but problem with curl how it access url redirect by using server, while it should access as user.
×

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.