Jump to content

cyberRobot

Moderators
  • Posts

    3,145
  • Joined

  • Last visited

  • Days Won

    37

Everything posted by cyberRobot

  1. When you say double spacing, do you mean there's extra space between each line. So it goes host:port... host:port... etc. If so, it's because each line is surrounded with a paragraph tag. By default, browsers add space between paragraphs. You could use CSS to adjust the spacing...or you could switch to the break or list tag.
  2. Once you adjust micky007's solution to work with PHP variables, it's not going to be much different than what I-AM-OBODO posted. echo 'Download <a href="' . $file_path . '">Here</a>'; In case it comes up, I agree that attribute values should be enclosed in quotes. It's also unclear as to why there's an extra "download" in the open anchor tag. Personally, I would likely change the code to the following: <a href="<?=$file_path?>">Download Here</a> Of course, my decision to change the code would be dependent on whatever code surrounds the above link. Note that I would also change the "Download Here" text to something that made more sense when read out of context (e.g. Download Brochure). That way people using assistive technologies, like screen readers, would better understand what the link is for when they are using the technology to jump from link to link.
  3. Using quotes is especially important if you ever get a file that contains spaces. Whether you use single or double quotes for your attribute values shouldn't matter. I typically use double quotes because I had problems in the past with specific attributes not working with single quotes when the value contained spaces. I have no idea if that's still the case. I also don't remember which tag/attribute I was having problems with.
  4. For your data.php file, you could return the value you want to use for the "src" attribute...instead of echoing. An example of using a return in an include file can be found here: http://php.net/manual/en/function.include.php#example-127 Note that you'll want to read the text below the example, which talks about what will be returned if PHP is unable to include the file.
  5. You'll be better off if you can find a function that returns the string, instead of outputting it as already mentioned. If one's not available, you could also consider catching the output with Output Buffering. http://php.net/manual/en/book.outcontrol.php
  6. For information on how to use the query string, check out $_GET. http://php.net/manual/en/reserved.variables.get.php
  7. Does the box scale for normal words? If you are expecting strings like the ones shown in the screenshots, you could look into CSS' overflow property: https://developer.mozilla.org/en-US/docs/Web/CSS/overflow
  8. The following block of code assigns the message to a variable: if ($DBcon->query($q)) { $msg = "<div class='alert alert-success'> <span class='glyphicon glyphicon-info-sign'></span> Message Sent ! </div>"; }else { $msg = "<div class='alert alert-danger'> <span class='glyphicon glyphicon-info-sign'></span> Message not Sent! ! </div>"; } You need to echo/print $msg for the message to appear on screen.
  9. Additionally, you will want to be careful with concatenation that spans over multiple lines of code. Note that the following block has an extra semi-colon: $body .= "<h1>" . $motionname . "</h1> <h2>Date Added:</h2>" . $dateadded . "<br /> <h2>Motion Text</h2>" . $motiondesc; "<h2>Disposition:</h2>" . $disposition;
  10. You could add all the information that you are using for the <div> tags to an array. Then just add the special <div> tag information to the end of the array and output the tags.
  11. When you are done with a reference variable, you can unset it. http://php.net/manual/en/language.references.unset.php
  12. You could check the manual. http://php.net/manual/en/function.date.php
  13. For what it's worth, there are a number of free share-button widgets. https://www.google.com/search?q=share+buttons The widgets I've used in the past let you choose which buttons appear on your website. They also let visitors share with their preferred social network, but those options are tucked away under a more options button.
  14. Also, are you familiar with the code inspector available in browsers like Chrome? The inspector may provide clues as to what is causing the issue. More information can be found here: https://developers.google.com/web/tools/chrome-devtools/inspect-styles/
  15. Click the "More Reply Options" under the reply box. From there, you can upload an attachment.
  16. Side note: since there should only be one entry with any given username, you could optimize the query using the LIMIT clause. $stmt = $dbh->prepare("SELECT * FROM administrator WHERE korisnicko_ime = :username LIMIT 1"); That way MySQL stops looking for more records as soon as it finds the first match.
  17. Since the password validation happens on the PHP side, you don't need to include it in the query. The username also doesn't need to be validated on the PHP side since that is already done in the query. Unless I'm not thinking clearly...or maybe I missed something, this should be fine: $stmt = $dbh->prepare("SELECT * FROM administrator WHERE korisnicko_ime = :username"); $stmt->bindParam(':username', $username); $stmt->execute(); $p = $stmt->fetch(); if (password_verify($password, $p['lozinka'])) { $_SESSION['laa'] = $username; header('Location: index.php'); exit; }
  18. You would use the table names to specify the column you want to use. For example domeniu_activitate.cat_id and user_pers_juridica.cat_id For shorter table names, you create table aliases. More information can be found here: https://dev.mysql.com/doc/refman/5.7/en/select.html
  19. Could you provide a little more information by what you mean by spill over? Maybe a screenshot? When using the following test code, I see that the vertical scrollbar appears because the comments box is too wide for the screen: <style type="text/css"> .comment-box { width: 100%; height:auto; padding:5px; margin-top:0px; margin-bottom: 5px; background-color: white; border-radius: 4px; } .comment-box p { font-family: 'cooper black'; font-size: 14px; line-height: 16px; color: green; font-weight: 100; } </style> <div class='comment-box'><p>Here are some comments. The comments will be really long to see how the comments box works. So here we go. Let's add a few more sentences so that the box can be tested properly. That should be good.</p></div> Is that the issue you are describing? If so, the issue goes away for me with I remove the "width: 100%;" declaration for the <div> tag. With the 100%, CSS make the <div> tag fill the space entirely. Then it adds 5 pixels to each side from the padding declaration. So you have 100% + 10px.
  20. What does your code look like?
  21. Agreed Hmm...I didn't think about that. Good point.
  22. I miss Philip! For what it's worth, Barand's "Like" tab has 62 pages and Philip has 9. I imagine there was some "like" testing going on in Philip's case.
  23. You could also pass a flag to tryagain.php using a header() redirect. Then display the error message on the tryagain.php page.
  24. Are you trying to get the page to display "User Not Found" before the redirect happens? If so, you can see the example at the bottom of the following page: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta I think the issue is with the "User Not Found" text in the content attribute. Unless I missed something in the documentation, linked above, the value before the semi-colon needs to be a number. Side note: PHP has a function for redirecting the page. More information can be found here: http://php.net/manual/en/function.header.php
  25. You are missing "echo" in a few spots. Take a closer look at the following line: <td><input type="radio" name="<?php $row['motion_id']?>" id="<?php $row['motion_id']?>" value="<?php $row['motion_id']?>"</td>
×
×
  • 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.