Jump to content


  • Content count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Sigmahokies

  • Rank
  1. 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
  2. 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
  3. 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
  4. 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
  5. 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?
  6. 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
  7. 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.
  8. Sigmahokies

    Insert into in PHP

    I know about SQL injection, but all php code is outside, it won't show on website. all php are external file. I plan to insert the string escape mysqli, but I need to make sure it works, before I insert them. And, I don't show my code in php in website, it will work very quick, like first file, then jump second file to verify, then move to third file, there is no way to look at second file because has mysqli inject string escape which contain in php. I just create layout in html and css. I'm sure hackers cannot see my hidden file. It's like all html and css are upper from floor, but my php code is like just show up in one second to verify, then disappear from floor. This file is not on main file, it is outside, just use file to insert into database, then move to other website...it's just matter of less then second.
  9. 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"); } ?>
  10. Sigmahokies

    Validation form

    Never mind, someone helped me, just added required in html, then it will appear... Thank you for helped.
  11. Sigmahokies

    Validation form

    Hi everyone, I am trying to have validation form, seem it doesn't work. what did I do wrong? If anyone can help, Thank you so much... Gary Taylor <?php $buzz = $buzz2 = ""; if ($_SERVER['REQUEST_METHOD'] == "POST") { if (empty($_POST['select'])) { $buzz = "<h2><color ='red'> >- </color></h2>"; $buzz2 = "<h2><color ='red'> -< </color></h2>"; } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Welcome to ASL-PT Scoring</title> <link href="default.css" rel="stylesheet" type="text/css"> </head> <body> <fieldset> <h1>Welcome to ASL-PT Scoring website</h1> <table> <form action="login.php" method="post"> <select name="select"> <?php echo $buzz ?><option value="" >Please select the level</option><?php echo $buzz2 ?> <option value="Administrator">Administrator</option> <option value="License">License</option> <option value="Scorer">Scorer</option> </select> <caption>Please login to enter the site below:</caption> <tr><td>Username:</td><td class="td"><input type="text" name="user"></td></tr> <tr><td>Password:</td><td class="td"><input type="password" name="password"></td></tr> <tr><td colspan="2"><input type="submit" name="submitted" value="Login"></td></tr> </form> </table> </fieldset> </body> </html>
  12. Sigmahokies

    Flexible in array for table in the Database

    hi just someguy, please forgive me for my grammar, I'm Deaf, so ASL is my prime language, English is my second language. Anyway, I'm trying to create new variable by loop which must be follow number of array. In the many database, there are various number of columns, so I need to set up the flexible array that can insert in value in the database. For example, if one table has three columns, so have to set up with three array, if table has four columns, so have to set up four array. feel me? So, I need to create variable to get post from the name in HTML, which need to same number from array. For example, if post get four value from HTML, have to have four variable. if post get three value from HTML ,have to have three variable. I'm doing my best to improve my grammar in next time.
  13. Sigmahokies

    Flexible in array for table in the Database

    Hi everyone, I am trying to set up the flexible with array, like set up the array by count the columns in tables in the Database, so I am still figure how to create variable word through loop to allow equalized from $_post as if $_post appear in two or three or four...I figured out to set up the $_post in loop, but I haven't find a way to have create new variable to equalized with $_post in loop in same time. here my code <!doctype html> <html> <head> <title>Add name and number</title> <link href="defaultdatabase.css" rel="stylesheet" type="text/css"> </head> <h2>Add any DSDJ information to database</h2> <?php require ("require2.php"); $sql = "show tables from NewDSDJ"; $list = mysqli_query($GaryDB, $sql); while ($row = mysqli_fetch_array($list)) { $table[] = $row[0]; $option = ''; foreach ($table as $rows) { $option .= "<option value='{$rows}'>{$rows}</option>"; } } ?> <form action="addname.php" method="post"> <table> <tr><th>Select the table</td><td> <select name="subject"> <?php echo $option; ?> </select></td><td><input type="submit" name="selected" value="select"></td></tr> </table> </form> <form> <table> <?php if (isset($_POST['selected'])) { $selected = $_POST['subject']; $column = "select column_name from information_schema.columns where table_name = '" . $selected . "'"; $list5 = mysqli_query($GaryDB, $column); while ($array = mysqli_fetch_array($list5)) { $input = ''; foreach ($array as $row5) { $input = "<tr><td>{$row5}:</td><td colspan='2'><input type='text' name='label[]'></td></tr>"; } echo $input; } if (isset($_POST['insert'])) { foreach ($array as $row6) { $ins = "{$row6},"; } for ($i = 0; $i < count($array); $i++) { $label = $_POST['label']; } echo $label; $insert = "insert into " . $selected . " (" . $ins . ") values (" . $label . ")"; mysqli_query($GaryDB, $insert) or die("Could not insert"); } }echo "<tr><td><input type='submit' name='insert'></td></tr>"; mysqli_close($GaryDB); ?> </table> </form> </html> Look at above of $insert, that is one I haven't figure how to create variable word to get data from name in form in HTML. Can you help? Thanks, Gary Taylor
  14. Sigmahokies

    Images in array

    Hi everyone, I am still learning Java. I am trying to create an array with images. I have images in folder, but I can't figure how to start to have images in array. How can I do that? I checked around in google, none of them make sense, more likely off topic to image icon. I need to tell java to pull all images from folder into array, so i can process programming. can you please show how to do that? Thank you so much. Gary
  15. Sigmahokies

    do and while loop

    Hi ingolme, Don't worry about it now, I found a way to make do...while loop works! Thanks.