Jump to content


  • Content count

  • Joined

  • Last visited

Everything posted by Sigmahokies

  1. 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
  2. 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.
  3. 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
  4. do and while loop

    Hi everyone, this is my second thread, I hope you can help me why do and while won't do loop as I put them in... public class GameGuess extends Thread { int a; public void Send(int a) { this.a = a; } do { int p1 = (int) ((Math.random() + 5) * 10); int p2 = (int) ((Math.random() + 5) * 10); System.out.print("Player 1: " + p1); System.out.print("Player 2: " + p2); if (p1 != a) { System.out.print("Player 1 get wrong guess."); } else if (p1 == a) { System.out.print("The Player 1 wins!"); } else if (p2 != a) { System.out.print("Player 2 get wrong guess"); } else if (p2 == a) { System.out.print("The Player 2 wins!"); } } while (p1 != a || p2 != a);
  5. do and while loop

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

    Are you talking about method that above of all must inside like public void (args) {}? all code are inside args already. If you want, I can show you a full of source in Java.
  7. do and while loop

    NetBean. It shows highlight error in do and while line. I checked the method has been correct, but it won't do loop. all method and compare are inside, I wrote code after parameter. Java source said while accept != as not equal. isn't that strange? I know what method is. I have been learning about OOP already, I am moving into intermediate level now.
  8. do and while loop

    Then tell me what is wrong with those codes?
  9. Hi everyone, I am beginner ti learn Java, I am trying to stop the repeat number in array, but it won't work. Anyone who have idea? it will be appericate...here my code to create random number that between 50 to 60, then put in 10 array, but few number are repeated... int [] myArray = {0,1,2,3,4,5,6,7,8,9}; int pop = 0; for (int i = 0; i < myArray.length; i++0 { pop = (int) ((Math.random() + 5) *10); for (int j = 0; j < myArray.length; j++) { if (pop != MyArray[j]) { myArray[j] = pop; }
  10. trying to prevent repeat random number in array

    Hi justsomeguy, Yes, i am trying to set up the random between 50 and 60, but not in order. I am trying to create the game. I want to have player 1 and player 2 making a guess number, if it is not match the secret number, then store into array to make sure player 1 and player 2 can't repeat number (like program can check to see if number is exist in array, then guess number that does not exist in array), until player 1 or player 2 make match the secret number to win. Hey, Please be patient with me if my grammar in english is terrible, because I am fluent in ASL. Thank you so much!
  11. while with checkbox

    Hi everyone I am trying to create the one table columns (I will do multiply columns later) with checkbox, it is good for people who show up for meeting or activity. I am trying to make a check that post in next below from checking chart, but it won't post at all, what did i do wrong? Can you help me? Thanks, Gary </table></fieldset></form><h2>Checbox works with database</h2><form action="portfolio.php" method="POST"><table><?php $list = "SELECT ID, FirstName, LastName FROM sample";$list2 = mysqli_query($connect, $list); if (mysqli_num_rows($list2)) {while ($row5 = mysqli_fetch_assoc($list2)) {echo "<tr><td>".$row5['FirstName']."</td><td>".$row5['LastName']."</td><td><input type='checkbox' value='".$row5['ID']."' name='check'></td></tr>";}}?><tr><td colspan="3"><input type="submit" name="check3" value="who showed up"></td></tr></table><table><?php if ($_POST['check3']) {$check = $_POST['check']; if ($check) {$select = "SELECT FirstName, LastName FROM sample WHERE = ID '%".$check."%'";$run = mysqli_query($connect, $select); if (mysqli_num_rows($run)) {while ($ran = mysqli_fetch_assoc($run)) {echo "<table>";echo "<tr><td>".$ran."</td></tr>";echo "<table>";}}}}?></table></form>
  12. while with checkbox

    which query that I made error?
  13. I want to see your opinion about website Which is best to sign up for create website in OS: Paid share hosted (GoDaddy.com, i-page.com, atspace.com, etc) or Virtual Private Server? Please let me know ASAP Thanks! Gary
  14. Paid share hosted or Virtual Private Server?

    Oh well, I need a something that allow remote database access, I'm sure only Paid hosted website and VPS are allowed, none of free website do that. I just want to start to work with database to create a portfolio website that show I can work in PHP and Database Management in PHP. Also, I will like to practice on CSS. I have VPS, but it is not really good cooperate with me. I am planning to cancel it if it continue stubborn. Gary
  15. Random Poker card

    Hi everyone, I am trying to find source or tutorial how to create the random. I will like to learn how to create the random in poker card, but i need to make sure it must show the display that card is used. For example, I click on back of card to draw card, then show number or royal on card, then click it, moved to left-top or right-top to keep tracking those random poker card...do you have any idea? those card can't be repeated. Thank you so much
  16. Random Poker card

    Oh cool, it worked, it is in JavaScript, right? Can i make an image in this script? But why i get "undefine of shade", "undefine of heart"...I will like to remove this "undefine" Thanks!
  17. Hi everyone, I am struggling with transition font color with background in table. I am using TD create transition background, it works, but not font. Here my CSS i created: td { background-color: rgba(0, 79, 0, 0.75); border-color:white; border-collapse:collapse; } #td { transition:background-color 0.7s ease; background-color:rgba(0, 79, 0, 0.75); } #td:hover { background-color:white; color:rgba(0, 79, 0, 0.75); }
  18. Transition color font with background in same time

    I found the solution, I solved it...I just found the default set must not set as color, or it won't work. so, I put color font in tag letter, id, or class...not * in beginning of CSS document. Thank you for your time, Ingolme
  19. Transition color font with background in same time

    Oh, I made mistake in this trend, but I did put period (.) in sec - 0.7s still not working.
  20. Transition color font with background in same time

    Oh i just tried that, it doesn't work. Seem transition will work one time on page. Even I tried to have code: transition:color 0,7s ease; that is separate from background, but still not work, even transition does not work with background.
  21. Transition color font with background in same time

    Look at my code above... I am using transition to do font color.
  22. Email contact form

    Hi everyone, I'm not sure if it is right code to send email from email form in HTML and PHP. I tested it to send to my email, it is not work...can you help me? Also, I'm not sure I understand what is difference between $_POST and $_REQUEST, I know $_REQUEST is good for email, but few tutorial about email contact using $_POST and $_GET. How $_REQUEST works? I checked php.net, seem it is not explain very clear...even i went to W3school.com to learn about $_REQUEST, still not clear about it. Also, I wonder...will "Webmail" such as gmail.com, yahoo.com, etc...work with any server with PHP? However, Here my code that I wrote: <?php $action=$_REQUEST['action']; if ($action=="") /* display the contact form */ { ?> <!doctype html> <html> <head> <title>Contact Form</title> <link href="contact.css" rel="stylesheet" type="css/text"> </head> <body> <form action="" method="POST" enctype="multipart/form-data"> <input type="hidden" name="action" value="submit"> Your name:<br> <input name="name" type="text" value="" size="30"/><br> Your email:<br> <input name="email" type="text" value="" size="30"/><br> Your message:<br> <textarea name="message" rows="7" cols="30"></textarea><br> <input type="submit" value="Send email"/> </form> </body> </html> <?php } else /* send the submitted data */ { $name=$_REQUEST['name']; $email=$_REQUEST['email']; $message=$_REQUEST['message']; if (($name=="")||($email=="")||($message=="")) { echo "All fields are required, please fill <a href=\"\">the form</a> again."; } else{ $from="From: $name<$email>\r\nReturn-path: $email"; $subject="Message sent using your contact form"; mail("XXXXXXXX@gmail.com", $subject, $message, $from); echo "Email sent!"; } } ?> Anyone who can help, thank you so much!
  23. Email contact form

    All right, I just put this code to check the error...I fixed error, now no error show on display, but still not send email to my gmail. I think it got to do something with php.ini.
  24. Introduce Yourself

    Hi everyone! I'm new guy in this forum, Thank you for invited me in this forum. I hope I will provide to assist in web - HTML, CSS, JavaScript and PHP. I'm into advance in HTML and CSS, mid-level PHP. I am still learning PHP, it is not easy to understand, but I am getting there now. I hope any of you will help me do code in PHP to improve the performance on website. Have a great day!