Jump to content
Killersites Community


Popular Content

Showing content with the highest reputation since 07/19/2018 in all areas

  1. 4 points
    I also tried this at first, and it was almost the same experience, most people don't know what they want, so I mainly use templates, show them, and change things up for them, its troubling when they yes too everything and trying to start from scratch, so by having a "menu" that I can serve to them on a silver platter made the whole processes much simpler. By that I mean, here are a few Menu - Home Page - Color Pallet Combinations, here are the most popular trending fonts, used in 2018 for clear visuals, and so on. Most people don't pay attention to small details at first but when its all put together, boom Although I have stopped offering this service, its something that I do believe worth doing, get to learn ALLOT just by trying to solve problems client have. keep it up! and don't give up
  2. 3 points
    Hello guys,you can call me Dammy,am new here.Its good to have a place like this to call home.😎😎😎😎 Nerds up! Hope am welcome!
  3. 2 points
    Hi all, Kakie here! I have some old programming background in languages like ( Pascal, Basic, VB) which is really old and I never used it to do some thing in the reall world, I watched some of Stefan's vids on you tube, I liked his teaching methodes, and hey I joined and I like the course so far :), I that hope I will be able to make some money with it
  4. 1 point
    A few things will cause your site to not appear in the search engines. First thing is to be sure this line of code IS NOT in your pages: <meta name="robots" content="noindex,nofollow"> ... The above code tells the search engines to ignore your page and any links in the page. Instead, use this code: <meta name="robots" content="all"> You can learn more here: https://developers.google.com/search/reference/robots_meta_tag Check out this screenshot for details:
  5. 1 point
    Hi, So I've been checking out the numbers and have found that email marketing is still much more effective that social media. In fact, some people say it can be as much as 30-40x more effective! ... The problem is, you have to get those email addresses! So how do you do that? Build a content rich site. Use social media to get some attention. Have good spam filters in place so your list of emails/subscribers doesn't get polluted with the fake accounts. This is a problem btw that everyone on the Web faces. Even Facebook has admitted that a huge percentage of their users are just fake accounts. At killersites, I ignored this whole thing for years ... I let the lists go bad and now we are playing catch-up after years of neglect. The problem with not keeping your lists and user-base clean ... is that the spammers saturate things and the real people get lost. Stefan
  6. 1 point
    Check out our new Interactive Web Developer course (created in 2016) that covers this, and much more: shop.killervideostore.com This is a revised version of my previous tutorial (http://www.killersites.com/community/index.php?/topic/1969-basic-php-system-vieweditdeleteadd-records/) which uses MySQLi rather than regular MySQL to connect to the database. MySQLi, often called MySQL Improved, has several advantages over regular MySQL, including support for prepared statements (which helps prevent SQL injection, a common security issue) and object-oriented code. I've also provided a modified view.php file that shows one way to do basic pagination. I have also recorded a 8 part video tutorial (a bit over an an hour worth of video) showing how to build this system and explaining it as I go. It's available in the KillerSites University (http://www.webmentor.org - subscription required) under PHP > PHP CRUD Videos. --- (Anyone with PHP knowledge is welcome to comment on the code. If there are issues I haven't noticed, please let me know. Do realize that it is intended for beginners, so I didn't want to do anything too advanced that might lead to confusion. Yes, I realize I could use OOP, or could separate some of these out into methods, etc. etc.) OK... Here's some code for you to play with. It's a basic system that allows you to: -- view existing records -- edit existing records -- delete existing records -- add new records Online demo: http://www.falkencreative.com/forum/records-mysqli/view.php Basically, just imagine that you are in charge of a sports team, and you want to keep a list of all your player's contact information. The code I've created could be a starting point for that (it only includes fields for their first name/last name, but could obviously could be expanded to use more fields). This is just a basic starting point for projects that require view/edit/delete functionality. I know it may seem a lot to understand at first, but read all the comments in the code -- I try to explain what I am doing step by step. I'm also happy to help with any questions (please post questions in a new topic.) How to create a system that allows a user to add/edit/remove data in a database seems to be a commonly asked topic, so I may adapt this into an actual tutorial at some point in the future. DATABASE: -- You'll need to create a database (I named mine 'records' but it can be changed) using PHPMyAdmin -- Save the included sql file on your desktop as a .txt file -- Once you've created the database, make sure the database is selected, then click the "import" tab -- Select the .txt file on your desktop, and import it into your database. PHPMyAdmin will create all of the necessary tables/import some test data for you to play with SQL file: -- -- Table structure for table `players` -- CREATE TABLE `players` ( `id` int(11) NOT NULL auto_increment, `firstname` varchar(32) NOT NULL, `lastname` varchar(32) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ; -- -- Dumping data for table `players` -- INSERT INTO `players` VALUES(1, 'Bob', 'Baker'); INSERT INTO `players` VALUES(2, 'Tim', 'Thomas'); INSERT INTO `players` VALUES(3, 'Rachel', 'Roberts'); INSERT INTO `players` VALUES(4, 'Sam', 'Smith'); Save these php files all in the same folder in a place where you can run them using your server (I'm assuming you are using something like WAMP for the server? I'm not sure if Dreamweaver includes something like that by default.) connect-db.php <?php // server info $server = 'localhost'; $user = 'root'; $pass = 'root'; $db = 'records2'; // connect to the database $mysqli = new mysqli($server, $user, $pass, $db); // show errors (remove this line if on a live site) mysqli_report(MYSQLI_REPORT_ERROR); ?> view.php (non-paginated -- will just display one long list of members) <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>View Records</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> </head> <body> <h1>View Records</h1> <p><b>View All</b> | <a href="view-paginated.php">View Paginated</a></p> <?php // connect to the database include('connect-db.php'); // get the records from the database if ($result = $mysqli->query("SELECT * FROM players ORDER BY id")) { // display records if there are records to display if ($result->num_rows > 0) { // display records in a table echo "<table border='1' cellpadding='10'>"; // set table headers echo "<tr><th>ID</th><th>First Name</th><th>Last Name</th><th></th><th></th></tr>"; while ($row = $result->fetch_object()) { // set up a row for each record echo "<tr>"; echo "<td>" . $row->id . "</td>"; echo "<td>" . $row->firstname . "</td>"; echo "<td>" . $row->lastname . "</td>"; echo "<td><a href='records.php?id=" . $row->id . "'>Edit</a></td>"; echo "<td><a href='delete.php?id=" . $row->id . "'>Delete</a></td>"; echo "</tr>"; } echo "</table>"; } // if there are no records in the database, display an alert message else { echo "No results to display!"; } } // show an error if there is an issue with the database query else { echo "Error: " . $mysqli->error; } // close database connection $mysqli->close(); ?> <a href="records.php">Add New Record</a> </body> </html> view-paginated.php <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>View Records</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> </head> <body> <h1>View Records</h1> <?php // connect to the database include('connect-db.php'); // number of results to show per page $per_page = 3; // figure out the total pages in the database if ($result = $mysqli->query("SELECT * FROM players ORDER BY id")) { if ($result->num_rows != 0) { $total_results = $result->num_rows; // ceil() returns the next highest integer value by rounding up value if necessary $total_pages = ceil($total_results / $per_page); // check if the 'page' variable is set in the URL (ex: view-paginated.php?page=1) if (isset($_GET['page']) && is_numeric($_GET['page'])) { $show_page = $_GET['page']; // make sure the $show_page value is valid if ($show_page > 0 && $show_page <= $total_pages) { $start = ($show_page -1) * $per_page; $end = $start + $per_page; } else { // error - show first set of results $start = 0; $end = $per_page; } } else { // if page isn't set, show first set of results $start = 0; $end = $per_page; } // display pagination echo "<p><a href='view.php'>View All</a> | <b>View Page:</b> "; for ($i = 1; $i <= $total_pages; $i++) { if (isset($_GET['page']) && $_GET['page'] == $i) { echo $i . " "; } else { echo "<a href='view-paginated.php?page=$i'>$i</a> "; } } echo "</p>"; // display data in table echo "<table border='1' cellpadding='10'>"; echo "<tr> <th>ID</th> <th>First Name</th> <th>Last Name</th> <th></th> <th></th></tr>"; // loop through results of database query, displaying them in the table for ($i = $start; $i < $end; $i++) { // make sure that PHP doesn't try to show results that don't exist if ($i == $total_results) { break; } // find specific row $result->data_seek($i); $row = $result->fetch_row(); // echo out the contents of each row into a table echo "<tr>"; echo '<td>' . $row[0] . '</td>'; echo '<td>' . $row[1] . '</td>'; echo '<td>' . $row[2] . '</td>'; echo '<td><a href="records.php?id=' . $row[0] . '">Edit</a></td>'; echo '<td><a href="delete.php?id=' . $row[0] . '">Delete</a></td>'; echo "</tr>"; } // close table> echo "</table>"; } else { echo "No results to display!"; } } // error with the query else { echo "Error: " . $mysqli->error; } // close database connection $mysqli->close(); ?> <a href="records.php">Add New Record</a> </body> </html> </html> records.php (create a new record/edit existing records) <?php /* Allows the user to both create new records and edit existing records */ // connect to the database include("connect-db.php"); // creates the new/edit record form // since this form is used multiple times in this file, I have made it a function that is easily reusable function renderForm($first = '', $last ='', $error = '', $id = '') { ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title> <?php if ($id != '') { echo "Edit Record"; } else { echo "New Record"; } ?> </title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> </head> <body> <h1><?php if ($id != '') { echo "Edit Record"; } else { echo "New Record"; } ?></h1> <?php if ($error != '') { echo "<div style='padding:4px; border:1px solid red; color:red'>" . $error . "</div>"; } ?> <form action="" method="post"> <div> <?php if ($id != '') { ?> <input type="hidden" name="id" value="<?php echo $id; ?>" /> <p>ID: <?php echo $id; ?></p> <?php } ?> <strong>First Name: *</strong> <input type="text" name="firstname" value="<?php echo $first; ?>"/><br/> <strong>Last Name: *</strong> <input type="text" name="lastname" value="<?php echo $last; ?>"/> <p>* required</p> <input type="submit" name="submit" value="Submit" /> </div> </form> </body> </html> <?php } /* EDIT RECORD */ // if the 'id' variable is set in the URL, we know that we need to edit a record if (isset($_GET['id'])) { // if the form's submit button is clicked, we need to process the form if (isset($_POST['submit'])) { // make sure the 'id' in the URL is valid if (is_numeric($_POST['id'])) { // get variables from the URL/form $id = $_POST['id']; $firstname = htmlentities($_POST['firstname'], ENT_QUOTES); $lastname = htmlentities($_POST['lastname'], ENT_QUOTES); // check that firstname and lastname are both not empty if ($firstname == '' || $lastname == '') { // if they are empty, show an error message and display the form $error = 'ERROR: Please fill in all required fields!'; renderForm($firstname, $lastname, $error, $id); } else { // if everything is fine, update the record in the database if ($stmt = $mysqli->prepare("UPDATE players SET firstname = ?, lastname = ? WHERE id=?")) { $stmt->bind_param("ssi", $firstname, $lastname, $id); $stmt->execute(); $stmt->close(); } // show an error message if the query has an error else { echo "ERROR: could not prepare SQL statement."; } // redirect the user once the form is updated header("Location: view.php"); } } // if the 'id' variable is not valid, show an error message else { echo "Error!"; } } // if the form hasn't been submitted yet, get the info from the database and show the form else { // make sure the 'id' value is valid if (is_numeric($_GET['id']) && $_GET['id'] > 0) { // get 'id' from URL $id = $_GET['id']; // get the recod from the database if($stmt = $mysqli->prepare("SELECT * FROM players WHERE id=?")) { $stmt->bind_param("i", $id); $stmt->execute(); $stmt->bind_result($id, $firstname, $lastname); $stmt->fetch(); // show the form renderForm($firstname, $lastname, NULL, $id); $stmt->close(); } // show an error if the query has an error else { echo "Error: could not prepare SQL statement"; } } // if the 'id' value is not valid, redirect the user back to the view.php page else { header("Location: view.php"); } } } /* NEW RECORD */ // if the 'id' variable is not set in the URL, we must be creating a new record else { // if the form's submit button is clicked, we need to process the form if (isset($_POST['submit'])) { // get the form data $firstname = htmlentities($_POST['firstname'], ENT_QUOTES); $lastname = htmlentities($_POST['lastname'], ENT_QUOTES); // check that firstname and lastname are both not empty if ($firstname == '' || $lastname == '') { // if they are empty, show an error message and display the form $error = 'ERROR: Please fill in all required fields!'; renderForm($firstname, $lastname, $error); } else { // insert the new record into the database if ($stmt = $mysqli->prepare("INSERT players (firstname, lastname) VALUES (?, ?)")) { $stmt->bind_param("ss", $firstname, $lastname); $stmt->execute(); $stmt->close(); } // show an error if the query has an error else { echo "ERROR: Could not prepare SQL statement."; } // redirec the user header("Location: view.php"); } } // if the form hasn't been submitted yet, show the form else { renderForm(); } } // close the mysqli connection $mysqli->close(); ?> delete.php <?php // connect to the database include('connect-db.php'); // confirm that the 'id' variable has been set if (isset($_GET['id']) && is_numeric($_GET['id'])) { // get the 'id' variable from the URL $id = $_GET['id']; // delete record from database if ($stmt = $mysqli->prepare("DELETE FROM players WHERE id = ? LIMIT 1")) { $stmt->bind_param("i",$id); $stmt->execute(); $stmt->close(); } else { echo "ERROR: could not prepare SQL statement."; } $mysqli->close(); // redirect user after delete is successful header("Location: view.php"); } else // if the 'id' variable isn't set, redirect the user { header("Location: view.php"); } ?>
  7. 1 point
    Hi, The easiest way to do this is to go back to old-school web design and HTML. Something called an image map.
  8. 1 point
    To go along with this month's M$ patches, Adobe has released some as well. Adobe Releases Security Patch Updates for 11 Vulnerabilities https://thehackernews.com/2018/10/adobe-security-updates.html
  9. 1 point
    Most internet network cables are installed along the coasts. With rising sea levels, the placement of these cables needs to be moved if the internet is going to survive. https://cheddar.com/videos/the-internet-is-in-danger-of-drowning/
  10. 1 point
    Hi Carly and Toni, Welcome to the forum! Stef
  11. 1 point
    Hi all, I am Carly from Manchester UK. I had a bachelor degree in science and studied web design. I love my work, cats and happy meals. hope i will learn from you all and share my experiences too.
  12. 1 point
    Just an article that I thought some of you may find useful speeding up your wi-fi networks. 5 things that will slow your Wi-Fi network by NetworkWorls Magazine https://www.networkworld.com/article/3256026/lan-wan/5-things-that-will-slow-your-wi-fi-network.html
  13. 1 point
    JavaScript will do this. Just apply an onClick event on the bottom that scrolls the page up.
  14. 1 point
    I actually got lucky. She got back to me. She just need to talk to her bosses and make sure everything was okay. So, I'm good. I definitely breathed a sigh of relief.
  15. 1 point
    I am starting up in this freelance game myself... My experience so far has been similar, flaky clients. My first was an unpaid gig for a local law firm. I literally spent months doing this huge site redo for her, about 90% of the site is done, she was giving me feedback and was "yes-ing" everything I suggested. When it came down to finalizing the design decisions she stopped responding to my emails and calls. The second client I've been waiting for feedback and content for months now. These experiences sort of killed my momentum and very demoralizing wasting all this time, I learned a lot I suppose so not 100% waste. I'm going to keep at, you should too, Stef said it'd be rough at first.
  16. 1 point
    Hey hey, welcome to the forum. Best of luck
  17. 1 point
  18. 1 point
    its all here started learning all ready told someone i was a programmer it fits important tip Scheduling is everything if you schedule your lessons it goes a lot easier and you can start small 30 then 45 then hour so try that see if it goes better Rocmen bye
  19. 1 point
    Hey there, I'm taking notes but best way to memorize thoose notes would be through using them in coding I guess, so no matter how simple the code is at beginning I still write my own code just to help my brain register it faster. Not sure does this help in any way but hope you figure it out ! Cheers
  20. 1 point
  21. 1 point
    We have a new employee with a two year old. For some reason he had to pick her up from daycare and bring her to the office. He brought her books along: JavaScript for Babies HTML for Babies CSS for Babies Amazon: Coding for Babies Every professional should have these on their desk to prove you are advancing your training and have references if your Boss asks! 👌
  22. 1 point
    Hello Stefan. Greetings from Tasmania. Same as others above. I have already sent email. :) Please note email was from my gmail, the email associated with purchase was my hotmail however, I mentioned that in the gmail email though. (That doesn't read to well but it will make sense when you see your email) . I am liking what I have seen so far.This is off topic now but I am getting quite excited at future possibilities once I know what I am doing. I am disabled and I can really see how its possible for me to develop my own physical control systems that will give me more independence and more to the point completely customisable solutions for others.
  23. 1 point
    Awesome, thank you! I will take a look at your series and check out my options:) I used to be a professional MMA fighter but currently am a black belt in BJJ and coach my high school wrestling team.
  24. 1 point
    I just watched the video 'Is Freelancing just Trading one Boss for Many?' I agree with the strategy that "Its far better to have 100 small clients rather than a couple of big ones". I like to kickstart some discussion here to discuss about how should we go about it implement this strategy to build a stable freelance business. My first thought on this topic is that we should target small business that require to change their website regularly(e.g. restaurant, florist, mobile shop).
  25. 1 point
    Sure. Send me an email with your purchase email address, I can arrange download of the videos. Stef