Jump to content

Veryify form info in table


viv

Recommended Posts

I'm trying to create a registration page for my online game and I'm not sure how to make it read information from a table in my database and require that the information on the form match it to proceed. I'm totally new to PHP but have some HTML experience. Can I make an HTML form and connect it with PHP to my database? If so does anyone have a good tutorial or directions for how to do what I need?

 

Let me know if my question needs additional information or if I didn't explain something properly. Thanks for your help!

Link to comment
https://forums.phpfreaks.com/topic/50026-veryify-form-info-in-table/
Share on other sites

Well, what you're asking, really only takes a basic understanding of PHP. You basically just need to query the database and do a comparison. These forums are meant more for troubleshooting existing code, so I recommend looking at online examples of working code, and see how it works.

 

<?php

  if(isset($_POST['submit'])) {

    $name = $_POST['name'];
    $lname = $_POST['lname'];

    $db new db;

    $db->connect();
    $db->query("SELECT * FROM users WHERE name = '$name'");
    $db->close();

  }

?>

That's not complete code, nor will it work for you unless you edit it...since I don't know the information you're checking/aubmitting...and that is also asuming you have a MySQL class with your connection string named 'db'.

 

http://www.php.net <-- Pretty much an answer to all your question. Almost everything has a working example.

 

P.S...doesn't help to make all the text in your post orange.  ;)

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.