Jump to content

sigmahokies

Members
  • Posts

    138
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    Richmond, VA

sigmahokies's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Hi Phill W., I know about SQL injection, it's wide open. but it's practice, I said i will set up the SQL security after I make sure Insert and update is working. Relax! Also, I know how to close SQL in PHP, I want to make sure it is working, beside, it's in xampp, so it's localhost, not open to internet. I'm not that dumb. I need to practice to make it work, so I can move on with my demonstration to interview. SQL injection is my last to install in my code in PHP. Thanks, Gary
  2. I don't understand why it doesn't work to insert in Phpmyadmin (MariaDB) with my code...It saying failed to add all times. I know about security issue, I will install security later. I just want to make sure insert into MariaDB is working, then I will set up security system. Here my code: /* Register and check username and email is exist or not */ if (isset($_POST['submitted'])) { $username = $_POST['user']; $email = $_POST['email']; $first = $_POST['first']; $last = $_POST['last']; $password = $_POST['password']; $check_user = "SELECT * FROM username where Username = '".$username."'"; $check_email = "SELECT * FROM username where Email = '".$email."'"; $check_user2 = mysqli_query($GaryDB, $check_user); $check_email2 = mysqli_query($GaryDB, $check_email); if(mysqli_num_rows($check_user2) > 0) { $taken_user = "→ Sorry, Username is taken"; } elseif (mysqli_num_rows($check_email2) > 0) { $taken_email = "→ Sorry, E-mail is taken"; } else { $register = "INSERT INTO username (Username, Password, FirstName, LastName, Email) VALUES ('$username','$password','$first','$last','$email')"; $insert = mysqli_query($GaryDB, $register); } if ($insert) { $insert1 = "successfully added"; } else { $insert1 = "Failed to added"; } } Can you find what I did do wrong? Thank you in advance!
  3. All right, I'm trying to tell you that I'm trying to get all array from $srs in above of script into function below of loop in array, but problem is PHP still does not recognize $srs is defined from beginning of script; Look at image screen as example that need to be done.
  4. <?php $srs = array(); for ($section = 1; $section < 5; $section++) { for ($row = $section; $row < 10; $row++) { for ($seat = $row; $seat < 20; $seat++) { $srs[] = array( 'section_name' => $section, 'row_name' => $row, 'seat_name' => $seat); } } } output(convert_array($srs)); // Converts the array function convert_array($input) { return $input; } function output($obj) { echo "<pre>"; print_r($obj); echo "</pre>"; die; } ?> I'm trying to convert those array number to string, add implode() to make it happen, but seem PHP didn't recognize variable in $input. Like this implode("Section: ", $input) or (Section: ", $srs). Can you help me? Thanks, Gary
  5. My apology, I mean to name title "OOP vs Procedural", instead of PDO. Sorry...
  6. I want to see your opinion about OOP and Procedural. Which method has more easier to code in PHP? I'm using Procedural, but I notice PHP can read OOP as C++. Which is better for PHP? Thanks, Gary
  7. Hi everyone, It's been awhile since I was here in autumn time. How are everyone here? I'm good. I want to know, which best and cheaper host to create website with PHP? include Phpmyadmin or SQLBuddy. Please let me know... Thanks, Gary
  8. I put your code in above of my script, there is no error warning message on site.
  9. Hi everyone Happy Holiday to everyone!!! I am trying to create the form contact in PHP. I created form contact in html, But next page - I'm not sure it is right script in PHP to send email to my gmail account. I asked the hosting company to see if their server can send email to my gmail account, they said yes, should be. So, I create script in PHP, I don't know if it is right script, i hope you will find something missing in this script. I followed exactly from website, I tested to send then I checked my gmail account, this email has not sent. Can you help? Here my script: <?phpif (isset($_POST['submitted'])) {$name = $_POST['name'];$email = $_POST['email'];$select = $_POST['select'];$text = $_POST['text'];} $to = "xxxxxxx@gmail.com";$subject = "ASL class";$message = "Message is from ".$name.".\n The type class is ".$select.".\n The message said: ".$text; mail($to,$subject,$message); echo "<p>Sent! Thank you for fill an E-mail form</p>";?> Thank you in advanced, Gary
  10. Hi everyone, I want to ask for your opinion and advice. Is there possible for Deaf person getting a job as PHP web developer? I know few Deaf people who can write in PHP. I just want to see how chance for Deaf people, because discriminate against Deaf people are still exist in America even it is illegal. Please let me know, if you don't understand what I said, Please let me know, then i will be happy to repost in this thread. Thanks, Gary
  11. Barand and Psycho, it is working now. Thank you, Gary
  12. Hi everyone, I usually write PHP, but this time, I need a help in CSS. I am trying to create a vertical text, Not transfer rotate degree. I want to write like this: C L A S S Thanks, Gary
  13. Hi gizmola, I'm sorry for waste your time but explain about split, I found why it didn't work why PHP didn't take value from html's value...I forget to add the vertify the connect to MySQL. Like always start with connect to MySQL like this: <?php include('connection.php') ?> I did write this, but I forget to verify script connect INSIDE connection.php...that is why insert is not work. Now, it is working, even type of class are working by insert, so i can split this column into three columns to view which people are register for class. Thank you for your time...
  14. All right, gizmola I am trying to set up the three class, ASL1, ASL2, ASL3 in a one column that will split into three column on display to allow instructor see type of class.. I need to have three type ASL on one column, Like list of local and nonlocal in membership. I could put this tag - <td><input type="hidden" value="ASL1">ASL 1</td>. Seem PHP didn't take the post from value in html that will send value into table column. I don't want to have three tables, I prefer to have one table. For example, following register: Table: ID (AC) | FirstName | LastName | Email | Type Gary Taylor Gary@gmail.com ASL1 Wendy Taylor Wendy@gmail.com ASL2 [\php] So, In other display, then i can select column name from table name that where equal ASL 1 or ASL 2 or ASL 3. Instructor can tell which students are registered in those three classes. Get it? Please advise me if you don't understand what i am saying... Thanks in advance time Gary
  15. Thank you for advise, I am going to remove ENUM from phpmyadmin, trying to set up the one columns will split into three columns. Thank you.
×
×
  • 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.