Jump to content

Trium918

Members
  • Posts

    883
  • Joined

  • Last visited

Everything posted by Trium918

  1. The script below works for the shorten part, but what would I have to do in order to show the entire string when the mouse roll over it? Can this be done using PHP? <?php // Article Title $title = $row_articles['title']; $titlelenght = strlen($title); $charlimit = "35"; if ($titlelenght >= $charlimit) { $outputTitle = substr($title,0,$charlimit) . "..."; print $outputTitle; //echo $titlelenght; }else{ print $title; } ?>
  2. Thanks, but I've read that already. I am trying to install an API but I do not know where to start. Could someone point me in the right direction?
  3. How would you embed an API interface into a PHP application? What is the easiest way to implement the embed? I don't think I fully understand what an API really is, so I will example what I think it is. I think that an API is an actual program or application. Maybe an API is just a piece of script where the developer just embed it. Please, can someone fill me in on what it really is. Thanks!
  4. There are only some many different ways code can be written from what I've seen here on phpfreaks. I could be wrong, but the code that I have seen are similar. How can someone determine what is their code and what isn't?
  5. Where can I learn about copyrights for PHP? There are a lot of code that is similar. If PHP is open source, how come there are copyrights rules any ways?
  6. What if the code was re-written but using the same format? Whos code is it then?
  7. I created to users accounts. User1 and User2 If I log in as User1 everthing is fine, but when I log User2 in then User1 online status is deleted from the members_online table. There should be a count of two users online. What is causing the problem of one User account being deleted? <?php // connect to database // retrieve # of users online // I am having problems with this section $timeoutSeconds = 60; $timeout = time() - timeoutSeconds; $query = "DELETE FROM members_online WHERE timestamp < $timeout"; mysql_query($query); /////////////////////////////////////////////////////////// $query = "SELECT username FROM members_online"; $result = mysql_query($query); while($row = mysql_fetch_assoc($result)) { echo $row['username']." "; } ?>
  8. Here is the query that I implemented and it is not working. There are no errors, but I am getting an echo "No results"; I am trying to determine all active users online. <?php $timeoutSeconds = 600; $num_online = 0; $currentTime = time(); $timeout = $currentTime - timeoutSeconds; $online_query = "SELECT * FROM members_info WHERE last_visit < $timeout"; if($online_result=mysql_query($online_query)){ if (mysql_num_rows($online_result)) { $num_online = mysql_num_rows($online_result); if($num_online == 1) { echo "$num_online"; }else { echo "$num_online"; } }else { echo "No results found"; } } else { echo "Query failed<br />$online_query<br />" . mysql_error(); } ?>
  9. I already have a field in the members table called last_visit. I was thinking maybe I can just update last_visit, so my query would look something like the one below, correct? <?php $timeoutSeconds = 600; $timeout = time() - $timeoutSeconds; $query ="SELECT * FROM user_table WHERE last_visit < $timeout"; ?>
  10. I was thinking more of a switch that counts each individual user when they log in.
  11. If you look closely, then you will notice that the Home link is the only word that is aligned center. Hover over the links such as Browse, Search etc, and you will notice that the space in the left corner.
  12. It looks great. Now how are the oval edges created?
  13. Basically, I just need to count the session that are activated when the users logs in?
  14. I am trying to keep track of the active users who are online. How would I implement a system of this nature? Thanks in Advance!
  15. The nav-bar looks just fine at first site, but when you roll the mouse over the nav-bar the "a:hover" isn't aligning up properly. Please try the example below in order to get a better understanding. I figure that the problem has something to do with the padding, but I can not get it to align correctly. <html <head> <style type="text/css"> #topnav{ width: 760px; font-weight: bold; height 25px; padding-top: 2px; padding-bottom: 2px; margin-bottom: 10px; } #topnav ul{ border: 1px solid #BBB; background-color: #0000CC; padding: 4px 0; margin: 0; text-align: left; } #topnav ul li{ display: inline; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9pt; } #topnav ul li a{ color: #FFFFFF; padding: 4px 7px; text-decoration: none; margin: 0; border-right: 1px solid #DADADA; } /* Controls topnav after users clicks link */ #topnav ul li a:visited{ color:#FFFFFF; text-decoration: none; } /* Topnav acts like a rollover */ #topnav ul li a:hover{ background-color: #FFFFFF; color: #003366; } </style> </head> <body> <div id="topnav"> <ul> <li><a href="index.php">Home</a></li> <li><a href="">Browse</a></li> <li><a href="search.php">Search</a></li> <li><a href="">Forum</a></li> <li><a href="blog.php">Blog</a></li> <li><a href="login.php">Login</a></li> <li><a href="register_form.php">Register</a></li> </ul> </div> </body> </html>
  16. 5. How does this help? I am trying to get a better understanding. By the way, Great Post!
  17. Try this! <html><head><title>AlibreCam Verification System</title></head> <center><h3>AlibreCam Verification System</h3></center> <center><TABLE border=0 cellpadding=3><form name="input" action="verification.php" method="get"> <tr><td><center>Customer ID:</center></td> <td><input type="text" name="user"></td></tr> <tr><td colspan=2><center><input type="submit" value="Submit"></center></td></tr> </form> </table> <?php $hostname = "localhost"; $username = "root"; $password = "xxxxxxxx"; $dbname = "licensinginformation"; mysql_connect($hostname, $username, $password) or DIE("Unable to connect to MySQL server $hostname"); $selected = mysql_select_db($dbname) or DIE("Could not select requested db $dbname"); $customer = $_GET['user']; $query= sprintf("SELECT * FROM invoiceid WHERE customerid='$customer'"); //$query= mysql_real_escape_string($query); $cResult = mysql_query($query); $value=0; while($row=mysql_fetch_array($cResult)){ $value=$value+$row['numoflicenses']; } echo "Total number of licenses purchased: ".$value; ?> </html>
  18. Trying clearing the cache then reload the file. If you are able to see the login page, the session isn't being destroyed.
  19. I would just create a presentation by using Microsoft Power Point. Use print screen to create an image and have a link that links to the website.
  20. Could you be more specific. What is the problem that you are having with the script?
  21. This what I have now. Could someone please help me out here? I am trying to write a script that displays the number of active users online. <?php $timeoutSeconds = 900; $num_online = 0; $currentTime = time(); $timeout = $currentTime - timeoutSeconds; $online_query = "SELECT id FROM members_info WHERE last_visit <= $timeout"; if($online_result=mysql_query($online_query)){ if (mysql_num_rows($online_result)) { $num_online = mysql_num_rows($online_result); if($num_online == 1) { echo "$num_online"; } else { echo "$num_online"; } } else { echo "No results found"; } } else { echo "Query failed<br />$online_query<br />" . mysql_error(); } ?>
×
×
  • 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.