Jump to content

Sigmahokies

Members
  • Content Count

    52
  • Joined

  • Last visited

Everything posted by Sigmahokies

  1. Sigmahokies

    RSA encryption

    Hello everyone, I'm trying to create a RSA encryption, but seem it is not function correctly. Is Javascript know RSA? like, let rsa = new RSA(); do I have to download from github? here my code: let rsa = new RSA(); let prime = ["2", "3", "5", "7", "11", "13"] //<-- Prime number let random = prime[Math.floor(Math.random() * prime.length)]; let text = document.getElementById("readed"); document.getElementById("en").innerHTML = rsa.encrypt(random, text); Seem console log show it is not function.
  2. Sigmahokies

    RSA encryption

    So, do I have to find source, then download it, then put in path to connect to this script?
  3. Sigmahokies

    JavaScript and PHP same time

    Hi everyone, I want to make clear again. I am trying to get data from "name" by PHP in HTML, but problem is "name" is used up by Javascript, but I need "name" for PHP's $_POST to get data from input from html, but can I use this "name" by JavaScript and PHP in same time? I need to get data from that word to post in database, but I think I'm stuck now...Anyone can tell me what is alternative keyword to get data from "name" in HTML? If you don't understand what I said, I will display and show you Thanks, Gary
  4. Sigmahokies

    JavaScript and PHP same time

    Never mind, i found a way to post, Javascript and PHP can use one keyword, but work in separate.
  5. Sigmahokies

    JavaScript and PHP same time

    Hi Justsomeguy, Ok here my code, I replaced array ([ ]) to nothing in PHP, so PHP should able to get data from this name. <tr><td>Go/Walk-To/From</td> <td><label for="box"><input class="single-count" type="checkbox" id="box" name="chkboxGrp0[]" value="1"></label></td> <td class="vert-middle">0</td></tr> <tr><td>Bring-Stack-Comic</td> <td><input class="single-count" type="checkbox" name="chkboxGrp1[]" value="1"></td> <td class="vert-middle">0</td></tr> <tr><td>Pick-up</td></tr> In JavaScript: var inputNameArray = []; for (var j = 0; j < chkbox.length; j++) { var chkBoxNameStripSqrBraces = chkbox[j].name.replace('[]', ''); <---- if (inputNameArray.indexOf(chkBoxNameStripSqrBraces) === -1 && chkbox[j].checked === true) { chkboxTotal[parseInt(chkBoxNameStripSqrBraces.replace('chkboxGrp', ''))].innerHTML = "1"; inputNameArray.push(chkBoxNameStripSqrBraces); } In PHP: if (isset($_POST['save'])) { $name01 = $_POST['chkboxGrp0[]']; $name01 = $_POST['chkboxGrp1[]']; } Look at arrow in JavaScript, please then goes on save in database... As you can see Javascript use "name", but I need "name" in php to get data from form in HTML, but seem it won't work because of conflict. I'm sorry if you don't understand, I'm ASL user, not english. if still not understand, i will display all whole code.
  6. Sigmahokies

    get data (checkbox) from iframe

    Hi everyone, is it possible to collect data such as checkbox and radio inside iframe when push button outside of iframe? or require to method of post inside iframe?
  7. Sigmahokies

    checkbox and paginate page

    Hi everyone, I'm trying to create the look like "paginate data page", but it is not. I set up the file to insert in website by iframe, but I need to find a way to make clicked data like click the checkbox, then click on next, go to next file in iframe, then come back, stay checked in checkbox. Do you understand what I mean? I'm not fluent in English, my prime is American Sign Language.
  8. Sigmahokies

    checkbox and paginate page

    I used session storage, seem it doesn't work. I use localstorage, seem it works a little, but stayed checked on checkbox has not work. here code I get from other website, but seem function is not right <script> function onClickBox() { let checked = $("#box").is(":checked"); localStorage.setItem("checked", checked); $("#msg").text("Checkbox is checked: " + $("#box").is(":checked")); } function onReady() { $("#msg").text("Loaded."); let checked = "true" === localStorage.getItem("checked"); $("msg").prop('checked', checked); $("#box").click(onClickBox); } $(document).ready(onReady); </script> <form> <div id="msg"></div> <table> <tr><th colspan="3">Spatial Verbs</th></tr> <tr><td>Go/Walk-To/From</td> <td><input class="single-count" type="checkbox" id="box" name="chkboxGrp0[]" value="1"></td> <td class="vert-middle">0</td></tr>
  9. Sigmahokies

    checkbox and paginate page

    Does that mean i have to use PHP as well?
  10. Sigmahokies

    Frame changing by link

    Hi everyone, inside PhpStorm, seem tag of frame has been strike, it might mean it is not support. I want to create like paginate data, but I just want to have page inside frame on page, so I can leave video on left, then other column can be change page by link. Anyone can help? Thanks, Gary
  11. Hi everyone, I am still learning changing PHP by mysqli to PDO. I'm not get used with PDO because it is little complex to understand, but maybe few weeks I will understand how PDO works. Now, I am trying to make redirect with type account in website and database. I am trying to identify type of three - administrator, license, and scorer page. I set up the test to make it work, seem it went dead end, it won't go to admin or license or scorer page. What did I do wrong? maybe something is missing. here my code: <?php /** * Created by PhpStorm. * User: Gary.Taylor * Date: 7/5/2018 * Time: 10:10 PM */ session_start(); require('access.php'); if(isset($_POST['submitted'])) { $username = $_POST['username']; $password = $_POST['password']; if($username && $password) { $login = $GaryDB->prepare("select username, password, Administrator from account Where username = '.$username.' and password = '.$password.' and Administrator = X"); $login->execute(); $count = $login->fetch(); if($count == 1) { $_SESSION['username'] = $username; header('location:admin.php'); } } elseif ($username && $password) { $login = $GaryDB->prepare("select username, password, License from account Where username = '.$username.' and password = '.$password.' and License = X"); $login->execute(); $count = $login->fetch(); if($count == 1) { $_SESSION['username'] = $username; header('location:license.php'); } } elseif ($username && $password) { $login = $GaryDB->prepare("select username, password, Scorer from account Where username = '.$username.' and password = '.$password.' and Scorer = X"); $login->execute(); $count = $login->fetch(); if($count == 1) { $_SESSION['username'] = $username; header('location:scorer.php'); } } else{ header('location:denied.html'); } }
  12. Sigmahokies

    Blur on video background

    Hi everyone, I'm trying to have little blur on background which is video. I added filer:blur(5px) on this video, but it won't work. Is there any way to make it work? I searched in google to see some code in, but none of them are working. Can anyone help? Thanks, Gary Taylor
  13. Sigmahokies

    Blur on video background

    Never mind about above, I found a way to make it work Thank you, everyone.
  14. Hi everyone, I'm wondering it is possible to have few checkbox checked but count as one? For example, I put three checkbox on html, then checked two of three, but will count as one. Suppose I have group of checkbox, but considered count one from three checkbox checked. it will be very appreciate if you can help. Thanks, Gary
  15. Sigmahokies

    few checkbox checked, but count as one

    Here example look like:
  16. Sigmahokies

    few checkbox checked, but count as one

    Hey, hey! I just fixed what I want. all i have to remove "+" from =. it count as one! Thank you so much!
  17. Sigmahokies

    few checkbox checked, but count as one

    That is not what I am asking for. I am asking for to have few checkbox have been checked, but count as one. For example, If I put nine checkboxes on website, then I divide nine checkboxes into three group: Three checkboxes in one group, then three checkboxes in second group, then three checkboxes in third group, suppose someone click checkboxes two out of three checkboxes in first group, click one out of three checkboxes in second one, then click two out of three checkboxes in third one, so script would count three checked because it showed someone did it all nine checkboxes which divided into three group that will count as three checked. Get it? Please forgive me, English is not my primary language, it is my second language. My primary language is ASL. Thanks, Gary
  18. Sigmahokies

    table under table

    Hi everyone, I will like to know how to have table under master table. Is it relationship? or how you do that? Thanks, Gary
  19. Hi everyone, I know how to create new table by PHP, but I don't know how to have relationship to prime table such as account or register table once a new table is insert. Can you please show me how to do that? I know how to create new table, but my point is once table is insert in phpmyadmin, then have relationship connect to prime table. If you are not sure, I will explain more about this. Thanks, Gary
  20. Sigmahokies

    Create new table will have relationship to prime table automatically

    Actually, I am using MySQL (MariaDB), All right I will try this, I will come back to comment if I have something wrong or question. Thanks, Gary
  21. Sigmahokies

    Insert into in PHP

    Hi everyone, I am trying to get all data from input in HTML, then post in php to insert into the database (phpmyadmin), seem it doesn't work. I checked for misspelling, and checked followed very correct, but it won't work, even it did not show what is error. "require.php" file is a connect to database. Can you help? Thanks, Gary <?php require("require.php"); $first = $_POST['first']; $last = $_POST['last']; $address = $_POST['address']; $address2 = $_POST['address2']; $city = $_POST['city']; $state = $_POST['state']; $birth = $_POST['birth']; $zip = $_POST['zip']; $home = $_POST['home']; $mobile = $_POST['mobile']; $gender = $_POST['gender']; $insert = "INSERT INTO register ( ASL-PT_ID, FirstName, LastName, Address 1, Address 2, City, State, Zip, BirthDate, Home, Mobile, Gender) VALUES ('$first', '$last', '$address', '$address2', '$city', '$state', '$zip', '$birth', '$home', '$mobile', '$gender')"; if ($first && $last && $address && $address2 && $city && $state && $zip && $birth && $home && $mobile && $gender) { mysqli_query($GaryDB, $insert) or die("Could not add in the Database"); } ?>
  22. Sigmahokies

    Insert into in PHP

    You mean, hackers can use URL to make data object mess up after use php code? Are you suggesting me to have different and very oddly variable, instead similar variable like inside SQL name of column that same name as variable? like for example, in SQL statement, `address 1`, then in PHP, $address1, is that how hacker get exploit to hack in? so, should I type very oddly, like Address 1 = $wacky? I mean, create those variable is no sense to people?
  23. Sigmahokies

    Insert into in PHP

    All right, I will test this SQL injection. Please be patient with me, I am having long way to learning. Please tell me, is PDO is best security than MySQLi? If so, that mean, i have to do start over to learn PDO. I know there will always new feature, but I am usually using same concept from Java, JavaScript, ASP. My real thing is working with database with web. I just use developer tools, I tested my old website that under company that give me a free small space disk - 1 GB. It is not serious, it is my practice in PHP, so, I use my username and password to access to next file, I don't see any SQL statement in developer tools, like it is just disappear. How do you can see SQL and PHP code? I don't see anywhere in developer tools in web browser. I'm no hacker, I don't like to hack in because in case if i do this, FBI will eat me alive, even revoke my degree, so forget it. my point is I thought PHP usually invisible to anyone because PHP just do interpreter in HTML, unlike ASP because ASP is a open source in website as you can see all code in View Page Source in any web browser. How can you see the SQL statement? I just don't get it all. Hey, I am still learning, there is no stopping to learn because there are over 1,000 new features in everyday. Thanks, Gary
  24. Sigmahokies

    Insert into in PHP

    it is interest to have backticks, in other phpmyadmin in server already, it does not require to have backticks, it works. That make me puzzling.
×