Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. No, those services don't exist because it can't be done. All mail services use a server-side language.
  2. There are major problems with ORDER BY RAND(). If the table is large the query can run really slow because it has to manipulate every single row of the table at once. Here's an article about it: http://www.titov.net/2005/09/21/do-not-use-order-by-rand-or-how-to-get-random-rows-from-table/
  3. Do you mean to randomize the order of the records? Or to retrieve a random record from the database? To retrieve multiple random rows efficiently is a bit complicated. Here's what seems to be a solution: http://snippetsofcode.wordpress.com/2011/08/01/fast-php-mysql-random-rows/ I don't recommend using the mysql PHP extension as that example does, use MySQLi or PDO. To look for a single random row is simpler: 1. First determine how many rows there are: SELECT COUNT(*) AS numRows FROM data 2. Store the result in a PHP variable, $numRows. 3. Make a PHP variable with a random number: $rand = mt_rand(0, $numRows); 4. Then search for the row with that number SELECT * FROM data LIMIT $rand, 1
  4. When you have an image within a link and there's whitespace between the <img> tag and the <a> tag it causes there to be an underline on either side of the image. I believe "hot graphic" might be a literal translation from another language for an image with a hyperlink. Trying to understand people is an important part of being an educator.
  5. OK, from this code, I think what you're trying to ask is to have the dropdown preselected based on information from the database. That's simple: if ($rsn_brwd == $index) { print ' selected ';} If that's not what you're asking, then I'm not sure. You don't seem to have a database table exclusively for the dropdown list values. On a side note, you don't need a while() loop if you're only retrieving one record from the database, and you should be prepared for the possibility that the record doesn't exist. if($row = $result->fetch()) { // The row was found $first=$row['FName']; $last=$row['LName']; $eqpmnt_brwd=$row['Eqpmnt_Brwd']; $svc_tag=$row['Service_Tag']; $rsn_brwd=$row['Brwd_Rsn']; $date_brwd=$row['Date_Taken']; $ret_date=$row['Exp_Return']; $comments=$row['Comments']; // The rest of the page information should actually be here} else { // Show a message telling the user that no content was found for this ID}
  6. Can you write a query that retrieves information from the database? Without knowing your table structure and which MySQL library you're using I can't show you the right way to do it. I think you might have missed my previous post as well.
  7. Yes, PHP sessions are guaranteed to expire as soon as the browser closes because they use a cookie that expires when the browser session is over. The cookie is on the client's computer, so you don't need to keep track of all the users, each user's browser uses the cookie to determine if the session is still open or not. The last active time isn't really part of the session, it's just to keep a record of when the user was last online so that the program can tell people if it has been longer or shorter than 20 minutes since the user last visited. All the session data is handled by the PHP session system and not by the database.
  8. I'm not sure which MySQL library you're using, but you can generate options with a loop in any case, the syntax will be sligntly different depending on the case. It will look something similar to this: <select name="ud:Borrwd_Rsn"><?phpwhile([assign a result to a variable $row]) { echo "<option value='{$row['value']}'>{$row['name']}</option>";}?></select>
  9. Javascript cannot send e-mails. HTML can use mailto to request the browser to open a mailing client, but if you want anything more than that you'll certainly need a server-side language, such as PHP.
  10. It's an underline. Setting text-decoration to none should solve that, which I see you've already tried. If you show a working example of the problem (the specific HTML and CSS code you're using or an online page that has the problem) then I can see what is causing it.
  11. With the way you're doing things, the only solution would be to have a cron job running every once in a while deleting all sessions that have not been active for 20 minutes or however long your sessions are. The query in the cron job would be something like this: "UPDATE user SET isloggedin='N' WHERE lastActive < " . ($now - 1200) You probably should use PHP sessions instead, they expire automatically when the browser closes. When using PHP sessions, if you want to show the names of people who are logged in, just save the current time every time they load a page: UPDATE user SET lastActive = '$now' WHERE uid=$uid The loggedIn field won't be necessary with this method because the fact that your session is active should be enough indication that the user is logged in. If you want to show a list of logged in users use the lastActive field: 'SELECT username FROM user WHERE lastActive >= ' . ($now - 1200) This assumes your lastActive field is of type INT with a UNIX timestamp in it, which I find is the best way to store dates.
  12. document.getElementBdyId() will select an element by its ID attribute. Your IDs are "id13" and "id14", not "x" and "y". The syntax "document.frm.id3" is obsolete, you should use other methods to access elements, such as document.getElementById() and document.getElementsByTagName(). You can learn more in the DOM tutorial: http://www.w3schools.com/js/js_htmldom.asp It doesn't look like you're using the variable "x" or "y" anywhere, what you really want is the value from the checkbox, not some random variable. You'll have to rely on events to know when a checkbox is changed. You could use the onchange event. The simplest way is this: document.getElementById("id13").onchange = function() { document.getElementById("id3").checked = document.getElementById("id13").checked}
  13. If you don't give them or their container a width then they will take up the full width of the page by default.
  14. It's not part of HTML, it's a "citadel" thing. It's just a piece of text that is replaced with something else before the server sends it to the browser
  15. You first need to wrap your <submit> button in a form. The form attribute has to point to an existing form, the formaction and formmethod attributes are only there to set or change the value a form element that already exists. As I mentioned in my previous post, the <iframe> has to have a name, and then you can use the target attribute of the form to make the form submit to that frame. <iframe id="frame1" name="frame1" src="Q1.php" align="left" height="400" width="450" scrolling="no" ></iframe><!-- target="frame1" tells the form to submit to the iframe element --><form action="score.php" method="POST" target="frame1"> <div><input name="submit" type="submit" id="butt" value="SUBMIT"></div></form>
  16. Well, I guess it's Google time. Searching... ... OK, here's a result: http://www.citadel.org/doku.php/documentation:webcit:customize:templates:start#doboxed It says that the template engine will replace <?SERV:HUMANNODE> with a human readable version of the name of the citadel.
  17. It's hard to understand your question. If your iframe has a name you can use the form's target attribute to make the form submit to that iframe: <iframe name="frame"></iframe><form target="frame" action="action.php">
  18. They have their box positioned relative to its container, yours is positioned relative to the entire page. Elements with position absolute are positioned from the edges of closest ancestor that has position absolute, relative or fixed, if no ancestor is found it will be relative to the page's edges
  19. This isn't a good idea. Absolute positioning, fixed heights and 100% width are going to really mess up a layout. You're looking for what's called a sticky footer. http://ryanfait.com/sticky-footer/
  20. The offsetTop and offsetLeft properties are numbers indicating the actual distance in pixels from the top and left of the parent. style.left and style.top only have values if they were set earlier using the element's style attribute or Javascript. They are strings that include a number and a unit, such as "30px".
  21. It looks like it's supposed to be interpretted by a template engine. Without knowing what engine your server is using to parse the files we can't know what it's supposed to do.
  22. Until you get into server-side programming (quite a complicated subject), you should be saving all your files as .htm or .html so that the browser knows it's HTML.
  23. In the first case you're telling it the name of the function it has to use when the event happens, in the second case you're actually running the function right on that line and assigning whatever value the function returns to the "onmousemove" property.
  24. What code did you use to align it?
  25. It can only be because of a problem in your code. If you can't identify the problem then show the code here and we can look for it. Both HTML and CSS are involved.
×
×
  • Create New...