I'm losing my mind here. I've put in countless days on this one issue alone and at one point probably did it right but a battery drained laptop, lack of sleep and touching keys, and or just plain inexperience has held me in stasis for the time being. I designed and built the front end of a website from scratch for my business. Its probably 83% of being perfected, but I need to work and as long as I can't move through this simple task, its just an overgrown paperweight. Can someone please help.
The issue is this. I have connection to the database. I see the information that i want to insert into the database in the url but for some reason, the code doesn't see it and nothing ends up in the database. If I can get through this issue, I can finish the contact and registration forms, as well as the signup login mechanism.
There's lots of old videos and a few that move way to fast for me. I attempted mysql, mysqli, prepared statements but this method finally put air into the database. Thanks for your help.<?php $servername = "localhost"; $username = "root"; $password = "rootagain"; $dbname = "rootforthehometeam";
$db_conx = new mysqli("localhost", "root", "rootagain", "rootforthehometeam"); $level = ($_POST['level']); $co = ($_POST['co']); $fname = ($_POST['fname']); $lname = ($_POST['lname']); $mailfrom = ($_POST['mailfrom']); $emailtopic = ($_POST['emailtopic']); $message = ($_POST['message']); $sql = "INSERT INTO form_contact (level,co,fname,lname,mailfrom,emailtopic,message) VALUES ('$level','$co','$fname','$lname','$mailfrom','$emailtopic','$message')"; $mailmessage = 'You have a message from: '.$fname.' '.$lname.' for' .$emailtopic; $to = 'Directed to: '.$emailtopic; $headers = 'From: '.$mailfrom.'\n'; $headers .= 'MIME-Version: 1.0\n'; $headers .= 'Content-type: text/html; charset=iso-8859-1\n'; mail($to, $emailtopic, $message, $headers); header('Location: https://www.minniecooperdrivesher.com'); mysqli_close($db_conx);