Popular Content

Showing most liked content since 06/28/2017 in all areas

  1. 1 like
    Well it would using MS Paint, but using FastStone Photo Resizer, it will do multiple selected images, to a specific size proportionately, rename adding custom suffix like '_thumb', and save to alternative format, to a destination you chose.
  2. 1 like
    Really? maybe is a Spain hosting problem, because they show how to install here https://help.1and1.com/hosting-c37630/webspace-and-access-c85098/ssh-c37775/install-imagemagick-via-ssh-a649013.html
  3. 1 like
    There is no Php.ini file, where would be if not in the file manager? Nothing occurs. Blank screen once I tested the email form. The code doesn't go back to the form page, I removed that, but the Mysql db should contain the record, but nothing.
  4. 1 like
    div>p {background-color: yellow;} Will set paragraphs that's a direct child element of parent element div with background yellow https://www.w3schools.com/cssref/tryit.asp?filename=trycss_sel_element_gt it won't change paragraphs nested within other child elements of the div parent. div p {background-color: yellow;} will change ALL child paragraphs within parent div whether they are nested or not. :root will target the <html> element, it being the outermost containing element (root) * universal selector: meaning target ALL elements. : single colon used for pseudo classes such as :hover, :link, : visited :: used for pseudo element ::after, ::before used to create content before or after a elements content, NOTE: older IE browsers use the single colon, but both can be used for modern better browsers than IE and Edge.
  5. 1 like
    (1) All form element in your current setup should appear in between <form> and </form> (2) IF using $_POST! The idea is to set a value for each checkbox so when it is submitted it is sent as $_POST array with these values. (4) IF using $_GET! THIS " window.location.assign("deleteVideo.php?id=" + id); " is a $_GET querystring, so ALL $_POST['...'] in 'deleteVideo.php' should be $_GET['...'] instead (3) As these can be multiple values the value of name attribute, should reflect it will be an array of values as in "name='checkbox[]'" (4) The 'id' argument equals WHAT? in onclick="myFunction(id)", its just text or undefined variable? (5) How can $id exist or be defined if it has not retrieved yet! $sql = mysqli_query($database, "SELECT * FROM video WHERE id='$id'"); (6) You need to make your mind up which to use $_GET or $_POST, if using the $_GET by using JavaScript to open this page then empty($_POST['delete'] will never exist. IF sent through GET querystring you would have to use $_GET['..']; instead (6) This if($val=='checked') will never be true, the $id will equal index value of array holding the value which current does not exist? as there is no value assigned to that checkbox.
  6. 1 like
    I have a issue and there might be multiple ways to solve it. I want a button to reveal extra content when it is clicked. I want to slide the extra content in from the left using the w3.animations or any other method that would be easy to follow and have it stop in the center of the screen. The content is a image and a few words describing it in a organized container. How would I do this or do you have any general advice for me to follow?
  7. 1 like
    * Is known as wildcard symbol so if value appears anywhere within class attribute value ^ Is 'begin with', so if value appears at beginning of class attribute value. $ Is 'end with', so if value appears at end of class attribute value. https://www.w3schools.com/css/css_attribute_selectors.asp
  8. 1 like
    Try using w3css modal, with w3-animate-left class with w3-modal-content class https://www.w3schools.com/code/tryit.asp?filename=FHE8DTJR3F2P working solution https://www.w3schools.com/code/tryit.asp?filename=FHE95QEVR6BC
  9. 1 like
    You can use Ajax to load data(images, text ....) from a separate file which contains php,asp, txt depending on what you are using once the data is ready to be displayed you can use w3 animation to make it look fancy . Here's the ajax tutorial Ajax.
  10. 1 like
    toGMTString() -> Deprecated. Use the toUTCString() method instead, as stated from here https://www.w3schools.com/jsref/jsref_obj_date.asp
  11. 1 like
    That refers to a constant. It would be defined in the Feed class as const ATOM = 'Some value'
  12. 1 like
    If sco is an ADO recordset object, you can look at the documentation for open here to figure out what the parameters are used for: https://docs.microsoft.com/en-us/sql/ado/reference/ado-api/open-method-ado-recordset You can click through to see the various options for the cursor and lock types.
  13. 1 like
    I'm not sure what code you're using to get the mouse offset, but once you have it you can calculate the correct position by dividing the canvas real size by its visible size. // Assuming we already have a reference to canvas and the mouse's position // relative to it is in visibleX and visibleY var horizontalRatio = canvas.width / canvas.offsetWidth; var verticalRatio = canvas.height / canvas.offserHeight; var realX = horizontalRatio * visibleX; var realY = verticalRatio * visibleY; // Do something with realX and realY
  14. 1 like
    You'll have to link to a specific PHP file that's designed to display the source of a file. <a href="show-source.php?file=interface">Interface</a> <a href="show-source.php?file=class">Class</a> show-source.php <?php if(isset($_GET['file'])) { switch($_GET['file']) { case 'interface': highlight_file('./composer/php_rss_generator/RSSGenerator/ItemInterface.php'); break; case 'class': highlight_file('./composer/php_rss_generator/RSSGenerator/Item.php'); break; } } ?>
  15. 1 like
    Open your browser's developer tools and go to the Network tab, refresh the page and look for any failed requests to see what's missing.
  16. 1 like
    Place both if conditions for setting modal and login to display none, in a single window.onclick function
  17. 1 like
    Actually what you can do is give the input a id reference and use attribute 'for' in the label with the value of the id ref to link them and do the same as placing input within a label. <label for="male">Male</label> <input type="radio" name="gender" id="male" value="male"><br>
  18. 1 like
    First, IDs need to be unique, it's not correct to have the same ID on more than one element. And option elements don't have a "checked" attribute, checkboxes do. Option elements have a "selected" attribute. To make it easier, you can add a hyphen or something to each name, like "q1-opt1". In PHP you can get each of the values in $_POST (if the only things in $_POST are the select values, then you can just loop through $_POST), you can use explode to split up the name into parts like "q1" and "opt1", check the value they selected, and then you can save which questions they picked yes for.
  19. 1 like
    First of all you don't need to save the all URL in the database, you just need to save the path like if your view_video.php (example) is in the home directory, where index and other pages are and your video is in uploaded/$name, then you need to insert into the DB only uploaded/$name. If your php page is in other folder like a folder named "videos" and there is your page but then you have your video in the "uploaded" folder outside the videos folder then the path will be ../uploaded/$name and so on. And to stop uploading the URL in the DB you need to check whether the video has done uploading or not (and that's a bit hard cuz you need some kind of a library to check the percentage of the video uploading status) or you can just create a simple function that is being called every time you access the page, so the logic will be something like this "if(DB_URL == HOST_URL) { then show video } else { REDIRECT 404 NOT FOUND AND DELETE URL FROM DB}" this will be the logic, so if in the DB the url will be uploaded/$name but in the folder there is no such video with that url then it will redirect the user to 404 not found. I hope i helped you.
  20. 1 like
    If you're going to ask the same question, then it's going to be the same answer: If you don't want to use PDO and have it throw exceptions when you make a mistake, then you need to check for errors yourself. If prepare returned false, then you need to print the error message from MySQL. You have a problem with the SQL query you're trying to prepare. You changed the format of that UPDATE query between the two pieces of code and now the query is wrong. UPDATE queries do not use the same format as INSERT queries.
  21. 1 like
    There are several problems with that upload code. The major one is that you are doing no error checking or validation on the file that was uploaded. If someone uses that form to upload a .php file, you'll just copy it to your server where someone can then access the URL, and now you're running some random PHP code that someone uploaded. That's probably the single easiest way to get your server hacked. You need to validate the file to make sure that it's allowed, and you also need to check for errors that may have happened during the upload: http://php.net/manual/en/features.file-upload.errors.php You also need to use prepared statements when you're sending data to the database. Don't put variables right into the query, use a prepared statement with placeholders that you can use to send the data separately to protect your database. The mysqli extension supports prepared statements: http://php.net/manual/en/mysqli.quickstart.prepared-statements.php To avoid re-submitting the form when someone refreshes the browser, after you finish processing the form you should send a location header to redirect the user. Then if they refresh they will only refresh the redirected URL instead of the form submission. You can redirect them to a thank you page, some other page that shows a message from the form, back to the form, etc. You should also move all of your form processing code to the top of your file, before any HTML output. If you're just going to end up redirecting the user there's no reason to send any HTML at all. The first thing the file should do is figure out if it needs to process or display the form, and go from there. For some reason you used an embed tag, you only need to use a video tag. Look up the video reference to see how to use that. You also messed up with the quotes in that string, if you view the source code of that page in the browser you'll see the problem.
  22. 1 like
    It is so much much easier to do it in PDO, why don't you use it ? And it is even more secure. dbconnection: try { $username = "db_username"; $password = "db_password"; $db = new PDO("mysql:host=localhost;dbname=your_dbname", $username, $password); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); echo "Connected !"; } catch (PDOException $e) { echo $e->getMessage(); } then your script to insert those values: try { $sql = "UPDATE users SET Username=:username, Email=:email, EmployeeID=:empid, Designation=:design, Password=:password WHERE Id = :id"; $stmt = $db->prepare($sql); $stmt->bindParam(":username", $username); $stmt->bindParam(":email", $email); $stmt->bindParam(":empid", $employee); $stmt->bindParam(":design", $designation); $stmt->bindParam(":password", $password); $stmt->bindParam(":id", $id); if($stmt->execute()){ echo "<font face='Verdana' size='2' color='green'> You have successfully updated your profile <br /> </font>"; } else { $msg = "<font face='Verdana' size='2' color='red'> There is some problem in updating your profile. Please contact site admin <br /></font>"; } } catch (PDOException $e) { print_r($e->getMessage()); } This is a clean way to do what you want but in PDO not MySQLi.
  23. 1 like
    Upon refreshing, the video is still uploaded to database ? Not the folder, because i might be thinking that it displays you the page because in database there is a video saved with an url but on your host in the videos folder there is no video with the url from db, that's mostly why you have that error.
  24. 1 like
    You have not bound a parameter for the WHERE statment, for every ? There must be a type and variable/value defined in the same order.
  25. 1 like
    That custom 404 page doesn't give a lot of information, it doesn't help that it redirects to 404.html. Maybe the redirection isn't working. The normal way to redirect though is to send a Location header with the new URL. But, for testing, I would suggest not redirecting and making sure the PHP code works. Your PHP code has some errors in it, so maybe the server sees the PHP errors and redirects to 404 for some reason. Here are some of the issues with your PHP code: You're trying to call a function called $POST, but $POST isn't defined. If you want to get submitted values you get them from $_POST, which is an array, not a function. So, for example, you would use $_POST['name']. If your database connection fails you don't stop the script, the rest of the code still runs without a database connection. When you call mysqli_query, you used !$con which is going to send a boolean value instead of the actual connection. You need to use prepared statements when you're sending data to the database. The mysqli extension supports prepared statements, you need to use them to make sure your queries run and protect against SQL injection attacks. You send the same text ('Not inserted') regardless of whether or not the record was inserted in the database. If you use echo to send any output, sending a header after that will not work.
  26. 1 like
    These Email = $Post('email'}; $Password = $Post('Password'}; are supposed to be $_POST['email']; AND $_POST['Password']; and the coloured names are suppose to match the values of name attributes of inputs you are trying to read <input type="text" value="username"><br> Password:<br> <input type="text" name="lastname" value="password"><br><br> AS you can see, they match neither, and one does not even have a name attribute which is required for ALL inputs, AND name values must match exactly as 'password' is treated differently to 'Password'.
  27. 1 like
    You have to login to google and create a project then select get JavaScript API under MAPS, you are then create a API key, which you use in your coding. The Iframe embed is similar, but apparently you have to create a secondary API key to ref. After that they should both show. Just follow instructions.
  28. 1 like
    It's possible using data URLs as the src attribute of the <img> element: https://developer.mozilla.org/en-US/docs/Web/HTTP/data_URIs I don't recommend it because older versions of Internet Explorer wouldn't support it and because it could really slow down the page loading depending on how large the images are. Normally, the page continues loading while requests for images are being processed but by using Data URLs, the image has to be fully loaded before loading the next element in the page. Also, base64 encoding increases the size of the image by 33%. Just include the PHP files in the src attribute of the <img> elements.
  29. 1 like
    It is a nice way to interact with GitHub, but it isnt a GUI for just using Git. Still, very useful since sometimes its hard to remember the commands for pushing to GitHub like "git push origin master"
  30. 1 like
    Vi.. not unless I have to! Nano is superior, in my opinion. It is much easier to use and just as functional. I can't imagine a situation that I would use Vi, although, if I needed to, I can manage with it.unrelated: glad to see my list got added to the poll
  31. 1 like
    wow im really old to i use notepad
  32. 1 like
    You should add Notepad++ to that list.
  33. 1 like
    Please don't rot your mind with an editor!!!! :)You learn so much more by using notepad and hand coding. You develope much stronger coding skills. Even with .Net I use Notepad at home...I only us VS.net at work because I have to.Just my opinion though.
  34. 1 like