Jump to content

jazzman1

Staff Alumni
  • Posts

    2,713
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by jazzman1

  1. Barand will kill me if he sees my previous reply. Try next (already tested) select u.firstname, u.surname, a.userID, X.week as 'Max Week', X.score as 'Gameweek' from POINTS a inner join (select userID, week, score from POINTS a1 where week = (select max(week) from POINTS a2 where a2.userID = a1.userID) group by userID) as X ON X.userID = a.userID and X.week = a.week inner join USERS u ON u.userID = X.userID I needed to use a subquery after the where clause or you could use another inner join inside the first join table instead!
  2. Try, SELECT u.firstname, u.surname, a.userID, max_week, gameweek FROM POINTS a inner join (select userID, max(week) as max_week, score as gameweek from POINTS group by userID) as b ON a.userID = b.userID and b.max_week = a.week inner join USERS u ON u.userID = b.userID
  3. Barry, I think he is looking for stored procedures or trigers. fastsol, stored procedures provide SQL enhancements supporting variables, comments, exceptions, conditional testing and looping as programming elements.
  4. Try (second page): <!doctype html> <html> <head> <title>Test array attendence</title> </head> <body> <table border="1"> <?php if (!empty($_GET['member'])) { $data = $_GET['member']; foreach (array_chunk($data, 2) as $row): ?> <tr> <?php foreach ($row as $value): ?> <td><?php echo htmlentities($value); ?></td> <?php endforeach; ?> </tr> <?php endforeach; }else { echo "Fail to get data from previous"; } ?> </table> <table><tr><td><?php echo count($_GET['member']) . " are attending this meeting tonight." ?></td></tr></table> </body> </html>
  5. Infinity loop I see here: while ($row = array($rows)) { $data['Name'] = $row; }
  6. I did it. You had to tell me about that So, there is no way to login using curl to this page, at least I don't know how to do this task. Sorry....maybe somebody would help you here I will try later on.
  7. You are still continue to teach me how the server and client works. No problem, no offense is taken by me Now, I already know that there is not way php to detect if javascript is enabled / disabled in my browser when I make an ajax call to the server. So, back to the OP problem, here is the logic credentials: #!/bin/bash NAME='user' PASS='pass' referer='http%3a%2f%2fwww.bet365.com%2fxtra%2fen%2f' #curl --cookie-jar cjar --output /dev/null 'https://members.bet365.com/Members/lp/default.aspx' curl --cookie cjar --cookie-jar cjar 'https://members.bet365.com/Members/lp/default.aspx' --data "ctl00_AjaxScriptManager_HiddenField=&__EVENTTARGET=ctl00%24HeaderPlaceHolder%24HeaderControl%24Login%24Go&__EVENTARGUMENT=&__VIEWSTATE=%2FwEPDwULLTE0OTk1NjUxNDBkZM%2F826rAqHRdNx1mZCnaiwnKJMB7&__PREVIOUSPAGE=b_rpb_GyZeP1TGPyzN2vQPsEv-IJbnLMMZcHunMJW9JgkSoJrqm6glz93dN4lmrcFcwnZGiTdwRvEiEWZLRm3YVm7wU1&__EVENTVALIDATION=%2FwEWDQKgifDsDwLBpdiBBQKF1rTBCwKg14akCAL%2FnP6QCgK6iKG3CgLx%2BNLkCwLk5KvOAwLBnamGCALUi53qCALxrtCaBwLNvuHaCQK24aRbEcr2XoX5okTIDQsKsnM8zQd6ypk%3D&ctl00%24HeaderPlaceHolder%24ctl00%24hidSessionTimestamp=&ctl00%24HeaderPlaceHolder%24ctl00%24hidSessionHashvalue=&ctl00%24HeaderPlaceHolder%24ctl00%24hidSessionTimeoutDuration=&ctl00%24HeaderPlaceHolder%24ctl00%24hidSessionAppPath=&ctl00%24HeaderPlaceHolder%24HeaderControl%24Login%24Username=${NAME}&ctl00%24HeaderPlaceHolder%24HeaderControl%24Login%24InitialPassword=Password&ctl00%24HeaderPlaceHolder%24HeaderControl%24Login%24ProtectedPassword=${PASS}&txtPassword=${PASS}&txtUserName=${NAME}&txtTKN=7EDA0805C01A4AD3AA96165DA59A4461000003&txtLH=0f740fa6750303c821740356981f2e1123e37676&txtTS=20140919204322079&txtType=2&txtSTKN=695060f20f99447ea7406c3d37a75491&txtScreenSize=1280+x+800&txtFlashVersion=11.2.202" --referer=${referer} curl --cookie cjar --output ~/bet365.html 'http://www.bet365.com/extra/en/' I'm not finding myself in login action using curl. Ideas instead of teaching each others what is AJAX?
  8. Ok, do it for me and send me the login credentials.
  9. Jacques, who is talking about how the server treats the http post/get form? I am talking about that there is no way to make an ajax call without javascript and this could be easily checked (if js is enabled/disabled by php ( php is cross-side language)) CroNiX in the official docs of cURL, there is nothing about js and curl implementation. I don't think your example is possible to send data in this way by curl. muppet77, what is your username and password. Send me a PM if you want it, to check if it's possible to use curl and lately I'll post the solution to the forum.
  10. Ok, how will you send an ajax request (if the script is required) without javascript?
  11. This login page requires javascript to be enabled in your browser. No way to use cURL.
  12. In the process_applicants.php file you also need to call start_secure_session() before using login_check(), otherwise you will get a notice of undefined variables, only the start_secure_session() function contains session_start() itself in your script. Even the both function are in the same file, any variable used inside a function is by default limited to the local function scope. Also, when using a php header function you need to call an exit command at the end. header('Location:http://main_function_page.htm'); exit;
  13. Before looking the script into the login_check function, check first, if your login is being successful (or not) inside the login function and the both $_SESSION['user_name'] and $_SESSION['login_string'] variables are being defined. function login($user_name, $password, $mysqli) { // Using prepared statements means that SQL injection is not possible. if ($stmt = $mysqli->prepare("SELECT user_name, password, salt FROM user_profiles WHERE user_name = ? ")) { $stmt->bind_param('s', $user_name); // Bind "$user_name" to parameter. $stmt->execute(); // Execute the prepared query. $stmt->store_result(); // get variables from result. $stmt->bind_result($user_name, $database_password, $salt); $stmt->fetch(); // hash the password with the unique salt. $password = hash('sha512', $password . $salt); if ($stmt->num_rows == 1) { // Check if the password in the database matches // the password the user submitted. $short_password = substr($password,0,80); if ($database_password == $short_password) { // Password is correct! //echo "password is correct <br/>"; // Get the user-agent string of the user. $user_browser = $_SERVER ['HTTP_USER_AGENT']; // XSS protection as we might print this value $user_name = preg_replace("/[^a-zA-Z0-9_\-]+/", "", $user_name); $_SESSION['user_name'] = $user_name; $_SESSION['login_string'] = hash('sha512', $password . $user_browser); // echo "In login function user name: " . $_SESSION['user_name'] . "<br/>"; //echo "In login function login string: " . $_SESSION['login_string'] . "<br/>"; // Login successful. return true; } else { echo ("Password is incorrect!!!"); return false; } } else { // No user exists. echo "No user exists!!!"; return false; } } // end of if ($stmt = $mysqli->prepare.......) } EDIT: For debugging your database errors you need to use mysqli::$error function.
  14. Double check the script of this file and make sure that this constant is difened! <?php /** * These are the database login details */ define("HOST", "localhost"); // The host you want to connect to. define("USER", "sec_user"); // The database username. define("PASSWORD", "4Fa98xkHVd2XmnfK"); // The database password. define("DATABASE", "secure_login"); // The database name. define("CAN_REGISTER", "any"); define("DEFAULT_ROLE", "member"); define("SECURE", FALSE); // FOR DEVELOPMENT ONLY!!!!
  15. You shoud get some error messages without them I am affraid we cannot help you.Try to add the following error_reporting functions on the top of the file you call. ini_set('display_startup_errors',1); ini_set('display_errors',1); error_reporting(-1);
  16. You should get an error message if you're trying to post a huge script. If so, you need to post only that piece(s) of code that relevant to your actual problem.
  17. Post all relevant code here using forum's code tags and don't attach files when providing code, some users like me do not like the idea to download files into their own macines.
  18. B/s the main purpose of using XDebug is to brake down your script into small pieces and fragments of data making it much more easy to debuging. By using OO design patterns, that's guarantee (in most cases) that, that data it's encapsulating within a set of functions designed to ensure that the scripts are used appropriately and in a human readable format.
  19. I find XDebug as not very efficient for myself when I follow object oriented design patterns in my code. It could be very powerful and useful if you're coding in procedural way with bad coding design. I am on Netbeans IDE which is absolutely enough for what I want to do and Vi/VIM as command line interface code editor.
  20. I'm not sure whether you would be able to achive that in case this VM is a part of the same windows instalation. What's the problem with the bootable linux cd? Another good alternative is Hirens.BootCD.
  21. Download any linux life cd distro, boot Linux from the CD, mount the NTFS windows partion, find the directory and delete the file or delete all windows if you prefer
  22. He-he, Tony thank you for sharing the link to Silex I've installed Silex few days ago by Composer and i was very impressed how easy and fast I've done everything on my RedHat server I've noticed that Silex is not a real MVC framework like CakePHP, Symfony,Zend, etc...but....for small projects that is very useful, b/s we don't need to use a full functionality of MVC. It gives me only the C (controller) of the MVC pattern for V (view) I can use a "twig" or a flat php and for M (model) I could use a doctrine ORM, if I want it.
  23. I don't know why you cannot retrieve the content from multiple tables and databases. Unfortunately, there is no way to test it how this wonderful program works in windows ( I have only windows 95) See my log, the last time that I restarted the mysql-workbench was at March 28. Log: [jazzman@localhost log]$ ps aux | grep /usr/bin/mysql-workbench jazzman 31356 0.0 0.0 106096 1276 ? Sl Mar28 63:27 /bin/bash /usr/bin/mysql-workbench jazzman 32504 0.0 0.0 103244 844 pts/0 S+ 12:57 0:00 grep /usr/bin/mysql-workbench
×
×
  • 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.