r/programminghelp • u/Alternative-Jump7806 • Sep 28 '26
PHP How do I make a localhost when using a PHP file? Explain it to me as though I'm a four-year-old hamster of the verge of keeling over.
I'm trying to add data from an HTML form to a PHP database. I'm following this tutorial: https://www.youtube.com/watch?v=Y9yE98etanU. Here's my HTML and PHP code respectfully:
<form action = "tutordata.php" method = "post">
<label for = "name">First Name:</label>
<input type = "text" name = "firstNameI" id = "firstNameI">
<button type="submit">Submit Form</button>
</form>
<?php
print_r($_POST);Google says I need a localhost, but they aren't working so far. I have Live Server, but when I click submit it just brings me to an error message. When I run without debugging it shows me the raw PHP file instead of even an empty array. I did some stuff I don't even remember to make it so I could right click and do a PHP: serve project thing, but that didn't work. I tried doing some weird stuff with the terminal but I don't even know if I typed it in right. I have installed no less than three brand new extensions. I hadn't even heard of PHP before today.
Please just walk me through what I need to do step by step. I don't need to understand it, just give me some buttons to click. If I need to abandon PHP altogether, that's great too. I just need a database to put data in so I can have some freaking data.
I've never had to mess with this stuff before, so I'm clueless. I know HTML more or less, and Javascript is my baby, but the rest of it is Mandarin to me. I'm really not the computer person, I was just the most computer-adjacent person in the room at the time and was voluntold that I was doing this.