Jump to content

spudly1987

Members
  • Posts

    61
  • Joined

  • Last visited

spudly1987's Achievements

Member

Member (2/5)

0

Reputation

  1. i've tried that but every time i switch to mysqli everything breaks on me again <?php $hostname = "localhost"; $username = "root"; $password = ""; $dbname = "pc_notes"; // Create Connection $dbhandle = mysqli_connect($hostname, $username, $password, $dbname); mysqli_select_db("notes", $dbhandle); $mysqli ="INSERT INTO notes (techname, date) VALUES ('$_POST[techname]','$_POST[date]')"; $var = ''; if (isset($var)) { } $a = "techname"; $b = "date"; var_dump(isset($a)); var_dump(isset($a, $b)); unset ($a); var_dump(isset($a)); var_dump(isset($a, $b)); $foo = NULL; var_dump(isset($foo)); ?> Warning: mysqli_select_db() expects parameter 1 to be mysqli, string given in C:\xampp\htdocs\notes\db_connection.php on line 9 Notice: Undefined index: techname in C:\xampp\htdocs\notes\db_connection.php on line 12 Notice: Undefined index: date in C:\xampp\htdocs\notes\db_connection.php on line 12 bool(true) bool(true) bool(false) bool(false) bool(false)
  2. <?php $hostname = "localhost"; $username = "root"; $password = ""; $dbname = "pc_notes"; // Create Connection $con = mysql_connect($hostname, $username, $password, $dbname); mysql_select_db("notes", $con); $mysql ="INSERT INTO notes (techname, date) VALUES ('$_POST[techname]','$_POST[date]')"; $var = ''; if (isset($var)) { } $a = "techname"; $b = "date"; var_dump(isset($a)); var_dump(isset($a, $b)); unset ($a); var_dump(isset($a)); var_dump(isset($a, $b)); $foo = NULL; var_dump(isset($foo)); ?> okay i set this up and i get the results of bool(true) bool(true) bool(false) bool(false) bool(false)
  3. okay i think i have it set correctly $hostname = "localhost"; $username = "root"; $password = ""; $dbname = "pc_notes"; // Create Connection $con = mysql_connect($hostname, $username, $password, $dbname); mysql_select_db("notes", $con); $mysql ="INSERT INTO notes (techname, date) VALUES ('$_POST[techname]','$_POST[date]')";
  4. I have updated my insert.php code <?php $selcted = mysql_select_db("notes"); $mysql ="INSERT INTO notes (techname, date) VALUES ('$_POST[techname]','$_POST[date]')"; if(!mysql_query($mysql)) die(mysql_error()); echo "data inserted"; mysql_close(notes); ?> and now i am getting the following errors Notice: Undefined index: techname in C:\xampp\htdocs\notes\insert.php on line 6 Notice: Undefined index: date in C:\xampp\htdocs\notes\insert.php on line 6 No database selected
  5. Okay I have worked on some things and now i'm kinda stuck first thing is i got my database connection working great <?php $hostname = "localhost"; $username = "root"; $password = ""; $dbname = "pc_notes"; // Create Connection $con = mysql_connect($hostname, $username, $password, $dbname); mysql_select_db("notes", $con); echo "connected"; ?> when i run it with the url "localhost/notes/db_connection.php, it runs and says connected I also created what is called an insert.php to get the data from the index.html to the database here is the html code <html> <title> PC Note Template </title> <head> </head> <body> <form action="insert.php" method="post"> <label for="">Tech Name: <input type="text" name="techname" /><br><br> <label for="">Date: <input type="date" name="date" /><br><br> <input type="submit" name="submit" value="submit" /> </form> </body> </html> and the below is the insert.php data <?php $sql="INSERT INTO notes (techname, date) VALUES ('$_POST[techname]','$_POST[date]')"; ?> how ever none of the information is being submitted to the database I also noticed that when i run the insert.php by its self i get the following two notices http://localhost/notes/insert.php Notice: Undefined index: techname in C:\xampp\htdocs\notes\insert.php on line 4 Notice: Undefined index: date in C:\xampp\htdocs\notes\insert.php on line 4 i did have it working at one point but it was inserting the data blank into the database, so this is where i'm at any help would be great
  6. How do i know if its connected, all i get is a blank white screen no error
  7. I use xampp and yes after i adjusted the php.ini file i closed out and reopened, and i have corrected the errors, still does not show the "connected succesfully" echo <?php $host = "localhost"; $my_user = "root"; $my_password = ""; $my_db = "notes_db"; $con = mysqli_connect("$host","my_user","my_password","my_db"); echo ("Connected Successfully"); ?>
  8. Okay i found the php.ini file and i edited and saved the settings, however i am still not receiving the connected succesfully and also not seeing any errors
  9. I have the following code created, however when i run it it doesn't come back as saying connected successfully? <?php $host = "localhost"; $my_user = "root"; $my_password = ""; $my_db = "notes_db" $con = mysqli_connect("localhost","my_user","my_password","my_db"); echo ("Connected Successfully"); ?>
  10. Okay so i have the new following code with a submit button and i installed and downloaded xampp i believe i created the colums and everything in the phpmyadmin sql database now how do i connect it from the html file to the data base? this is step 1 i need assistance with? <html> <title> Note Template </title> <head> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <h1>Pc Note Template</h1> <form action="notes_db"> Tech Agent:<br> <input type="text" name="firstname"><p> <br> Date:<br> <input type="text" name="Date"><p> <br> Primary Issue:<br> <textarea rows="4" cols="50"> </textarea> <p> <br> Beginning Webroot Score: <input type="text" name="beginningscore" size="2"><br><br> Did You Run Mbar: <select> <option value=""></option> <option value="Yes">Yes</option> <option value="No">No</option> </select> <br><br> How Many Threats Found And Removed: <select> <option value=""></option> <option value="Yes">Yes</option> <option value="No">No</option> </select> <br><br> Did Customer Purchase Webroot: <select> <option value=""></option> <option value="Yes">Yes</option> <option value="No">No</option> </select> <br><br> Did You Install Webroot: <select> <option value=""></option> <option value="Yes">Yes</option> <option value="No">No</option> </select> <br><br> How Many Threats Removed: <input type="text" name="threatsremoved1" size="2"><br><br> Webroot Info:<br> <textarea rows="10" cols="30" required> </textarea><br> <br> Did You Run Ccleaner: <select> <option value=""></option> <option value="Yes">Yes</option> <option value="No">No</option> </select> <br><br> How Much Was Removed: <textarea rows="1" cols="25"> </textarea><br><br> Did You Adjust Startup: <select> <option value=""></option> <option value="Yes">Yes</option> <option value="No">No</option> </select> <br><br> How Many Items: <input type="text" name="items" size="2"><br> Which Of The Following Browsers Were Cleaned: <select multiple> <option value="Internet Explorer">Internet Explorer</option> <option value="Google Chrome">Google Chrome</option> <option value="Firefox">Firefox</option> <option value="Safari">Safari</option> </select> <br><br> What Was Done To Clean The Browsers:<br> <textarea rows="4" cols="50"> </textarea><br><br> Ending Webroot Score: <input type="text" name="endingscore" size="2"><br><br> Did You Create A Restore Point: <select> <option value=""></option> <option value="Yes">Yes</option> <option value="No">No</option> </select> <br><br> Additional Information:<br> <textarea rows="4" cols="50" placeholder="Optional"> </textarea> <br><br> <input type="submit" value="Submit"> </input> </form> </body> </html>
  11. I Installed Xamp on my system but for some reason it will not run?
  12. I do not know if i'm in the right forum section for this however I will let you know what I need assistance with and if anyone can guide me or assist me I would be greatly appreciated. I have a notepad file that i created on my system, i do not have any software installed that is allowing me to host and nor am I signed up for a website as of yet but the following code. I would like to some how have the information that is entered and then when click on submit i would like it to be able to go to another screen with the results of what was entered and have two additional buttons to download resutls and then an option to start new entry, I am not to sure if I will need to create a sql database for this to happen or if its even phesable. Thank you for the support in advanced, I am also not an expert so if you can break it down and educate me a bit so i can learn what to do thank you <html> <title> Note Template </title> <head> <style type="text/css"> body{ background-color: lightgreen; } h1{ text-align:center; text-decoration: underline; } </style> </head> <body> <h1>Pc Note Template</h1> <form> Tech Agent:<br> <input type="text" name="firstname"><p> <br> Date:<br> <input type="text" name="Date"><p> <br> Primary Issue:<br> <textarea rows="4" cols="50"> </textarea> <p> <br> Beginning Webroot Score: <input type="text" name="removed" size="2"><br><br> Did You Run Mbar: <select> <option value=""></option> <option value="Yes">Yes</option> <option value="No">No</option> </select> <br><br> How Many Threats Found And Removed: <select> <option value=""></option> <option value="Yes">Yes</option> <option value="No">No</option> </select> <br><br> Did Customer Purchase Webroot: <select> <option value=""></option> <option value="Yes">Yes</option> <option value="No">No</option> </select> <br><br> Did You Install Webroot: <select> <option value=""></option> <option value="Yes">Yes</option> <option value="No">No</option> </select> <br><br> How Many Threats Removed: <input type="text" name="removed" size="2"><br><br> Webroot Info:<br> <textarea rows="10" cols="30" required> </textarea><br> <br> Did You Run Ccleaner: <select> <option value=""></option> <option value="Yes">Yes</option> <option value="No">No</option> </select> <br><br> How Much Was Removed: <textarea rows="1" cols="25"> </textarea><br><br> Did You Adjust Startup: <select> <option value=""></option> <option value="Yes">Yes</option> <option value="No">No</option> </select> <br><br> How Many Items: <input type="text" name="removed" size="2"><br> Which Of The Following Browsers Were Cleaned: <select multiple> <option value="Internet Explorer">Internet Explorer</option> <option value="Google Chrome">Google Chrome</option> <option value="Firefox">Firefox</option> <option value="Safari">Safari</option> </select> <br><br> What Was Done To Clean The Browsers:<br> <textarea rows="4" cols="50"> </textarea><br><br> Ending Webroot Score: <input type="text" name="removed" size="2"><br><br> Did You Create A Restore Point: <select> <option value=""></option> <option value="Yes">Yes</option> <option value="No">No</option> </select> <br><br> Additional Information:<br> <textarea rows="4" cols="50" placeholder="Optional"> </textarea> </input> </body> </html>
  13. I'm not sure I'm doing it right, I keep trying to correct it but every time its giving me errors, when trying to type the code out.
  14. Not exactly sure on how to write the code for that, or did i know that could be done
  15. Hey guys, need some minor assistance again. It should be simple i got some of the code working however confused on the rest. The concept I am trying to accomplish is that when they click on the "checkbox" to agree to the terms and then click on "continue to site" it will let them in, to which I do have that working properly. However, what I would like to have done is, if they don't click on the "checkbox" and try to click "continue to site" it will come up to a page saying "you have not agreed to terms" and i'm not sure If i have to create an additional page just for that line of text to call for that option. the third thing is yes this is a semi adult content site. so I'm not sure if it would be better to have it be where people would have to enter their birth day in as well on that page as a double verification if so wouldn't know where to start on that, but I would like to focus right now on the main issue. </title><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="practice.css" /> <script type="text/javascript"> function enable(){ if(document.getElementById('opt-in-checkbox').checked = false){ document.getElementById('wpsp-continue').disabled = true; }else{ document.getElementById('wpsp-continue').disabled = false; document.getElementById('opt-in-checkbox').checked = true; } } </script> <title>Untitled Document </head> <div id="wpsp-container"> <h1 id="wpsp-title"></h1> <div id="wpsp-reject">You don't agree with the terms and conditions.</div> <div id="wpsp-text">You are about to enter a website that may contain content of an adult nature. These pages are designed for ADULTS ONLY and may include pictures and materials that some viewers may find offensive. If you are under the age of 18, if such material offends you, or if it is illegal to view such material in your community, please click away from this site now.</div> <form method="post"> <span id="wpsp-opt-in"> <input id="opt-in-checkbox" type="checkbox" onclick="enable();" name="opt-in-checkbox" /></input> <label for="opt-in-checkbox">I agree with the terms stated above.</label> </span> <input id="wpsp-continue" type="submit" value="Continue to Web Site" formaction="index.html" disabled/></input> </form> </div> </body> </html>
×
×
  • 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.