Jump to content

roopurt18

Staff Alumni
  • Posts

    3,746
  • Joined

  • Last visited

    Never

Everything posted by roopurt18

  1. As you print each group of users, do the following: 1) Before printing the group, create an empty list of users printed so far 2) For each user in the group a) If the user exists in the list of users printed so far, skip b) If the user does not exist in the list of users printed so far i) Print the user ii) Add to the list of printed users <?php $info = ldap_get_entries($ds, $sr); $UsersPrintedSoFar = array(); // EMPTY LIST OF PRINTED USERS FOR THE GROUP for ($n=0; $n<$info['count']; $n++) { $part_id = $info[$n]['part_id'][0]; $usr = $info[$n]['cn'][0]; // CHECK IF USER EXISTS IN $UsersPrintedSoFar $PrintedSoFarKey = $part_id . '.' . $usr; if( array_key_exists( $PrintedSoFarKey, $UsersPrintedSoFar ) ) { // USER EXISTS IN LIST, SO HAS ALREADY BEEN PRINTED continue; } // USER HAS NOT BEEN PRINTED YET echo $part_id ." - ". $usr ."<br>"; // Print User $UsersPrintedSoFar[$PrintedSoFarKey] = true; // Add to list } ?>
  2. Assuming that $page and $limit are valid, the query looks ok to me. Are you sure you're not getting any errors? What is your error handling code? What is your script doing? Is it working at all? Blank page?
  3. First off your math is wrong. There are 9 thirds in 3 wholes. Computer math is always stored as integer or floating point. You need to find a math library that supports fractions or write your own.
  4. In MySQL strings are enclosed in single quotes. Thus you have as part of your WHERE clause 'status'!='deleted', which translates to: where the STRING 'status' is not equal to the STRING 'deleted'. Since they are never equal, it's as if you said WHERE TRUE, which is true for every row. You enclose fields in backticks (`, or the unshifted tilde).
  5. I'm not sure if strtotime() understand the m/d/y format, but I use date( 'Y-m-d H:i:s', strotime( $orig ) ) a lot.
  6. Internal Server Error typically means something with your Apache configuration is hosed. If that's the case you may have to turn on Apache logging. If you're on a shared host, then you can try to do it with a .htaccess file. If you're at a total loss of what I'm talking about and you need this resolved quickly, you may want to contact your web hosts support department for help or consider posting a "Help me fix this..." in the freelance section.
  7. You should start by making the site private, because you're going to need to do some debugging to find the source of the error. If you add the following at the top of your page that is giving you problems, it should help you identify the error: error_reporting( 0xffffffff ); ini_set( 'display_errors', true );
  8. Primary keys must be non-null and unique. So if you defiend ID as a primary key auto-increment field and you place a row with ID=0 in the table, you can not place another row with ID=0 in the table. Instead you must use a form of UPDATE: UPDATE `thetable` set ... WHERE ID=0
  9. RewriteRule ^(.*)/$ /$1.php Your last rule is here is matching URLs ending in a forward slash. It's also trying to send them to a file off of the root directory of the server since you left out the . (current directory) symbol in the /$1.php
  10. Try putting rewrite logging in the vhost configuration in httpd.conf I guess.
  11. If it's urgent and you need it finished within 36 hours I suggest you place this in the Freelance forums and be prepared to shell out some money. Anyways I can tell you that one of your files invit.php is trying to include two other files: /BxFb_connect/facebook.php /BxFb_connect/setting.php But it can not find them. Make sure the files are where they're supposed to be. If you have FTP'ed the files to the server, try doing it again. Otherwise it could be a file permissions error.
  12. It sounds like this is a beginning or introductory programming course, probably one semester or less in length, so the teacher's comment on classes is semi-appropriate. Although I disagree that classes are a difficult concept; the concept itself is quite simple, it's the implementation that people (even seasoned developers) struggle with! Anyways, I would say make a project / site that is related to a hobby of yours. If the site is related to another one of your interests, then it's all the more likely you may continue to work on it after the class and also all the more likely you'll want it to be super-cool. Before I landed my first professional programming gig I was a computer science major (final year) and waiting tables. I was running a WoW guild (long since gave that nonsense up) and decided we needed a cool web site. Oh sure I could have found plug-ins and libraries and widgets for what the site needed, but I'm a programmer damn it, I can make this crap myself. So off I went and bought a PHP / MySQL book and within a few months I had a site: User Authentication User Privileges Forum Image Gallery Member Listing Event Calendar w/ Sign Up Sheet DKP Tracker, Listing, etc. I started programming because I wanted to develop games, but I found I quite liked the web / database stuff as well. When it came time to start job searching I was able to show them the guild site, made from scratch, and they were impressed enough to hire me. The End.
  13. I know there are a number of solutions out there, but I've not produced any graphs myself. Depending on the level of complexity you're willing to deal with and the amount of control you have over the server generating the graph images, you can also look into Java solutions. There are ways to make PHP and Java play nicely together. I would really only attempt that as a last resort though as it can cause quite a few headaches.
  14. The following rule will catch everything, so it should probably be last: RewriteRule ^(.*)/?$ /$1.php I also like to append [QSA,L] to my rules (query string append, last), like so: RewriteRule ^tutorial/([0-9]+)/?$ ./view_tutorial.php?tutorial_id=$1 [QSA,L] Whenever I have rewrite problems there are two things I do to identify them. 1) I comment out all of the rewrite rules and test them one by one until I find the broken one. 2) If you check the mod_rewrite documentation, you can turn on rewrite logging and check your apache error log.
  15. Add the following before your dollar sign, which means "optionally may end with a forward slash but do not capture it": /?
  16. The OP is already assigning a variable: ($countryandcodesdata = fgetcsv($myfile, 0, ","))
  17. Oh c'mon! If softwareseeker.com liked it then it must be good!
  18. otslist.eu appears to be a single statistics page that receives updates from many servers. In that case otslist.eu probably has a web services or other page that allows each server to periodically post data about it's status. The stats themselves are probably stored in a database or flat file. What you're trying to accomplish is really simple in principle. 1) Create your site, such as mystats.com 2) Create a PHP file: mystats.com/receive_stats.php This script receives a POST submission of stats data from any of the reporting servers and adds it to the database. 3) Create a PHP file: mystats.com/display_stats.php This page displays the stored stats. 4) Create a PHP file: send_stats.php This is a PHP script that is installed on each server and scheduled as a cron entry. The job of this script is to query the server statistics and then POST them (using cURL or HttpRequest) to mystats.com/receive_stats.php This is exactly the same as creating a form handling script except you don't actually need an HTML form and instead of users submitting the data it's automated scripts. It's also a good idea to store a unique name-key pair for each server so they can identify themselves and not mangle other servers in the stats listing.
  19. Well which is it? Do you want it to return true 20% of the time and false 80% of the time? Or out of 5 calls do you want it to return true at least once without knowing which of the 5 calls it will be? Because they are not the same thing.
  20. You have it backwards. All headers MUST be sent prior to any output. This means all calls to header() and all functions that send or modify headers as a side-effect, such as session_start(), MUST occur before any output has gone to the browser. You can not echo anything, not even a blank line, to the browser before the headers are sent.
  21. Your proof is only correct based on your assumption This is creating energy that did not exist previously. Since it's impractical to know if the assumption is correct or not, your proof is not a proof at all.
  22. <?php $curYear = null; do { $dispYear = $row_Recordset1['ctYear']; if( $dispYear === null ) { $dispYear = ' '; }else{ $curYear = $dispYear; } ?> <tr> <td width="50"><?php echo $dispYear; ?></td> <<<< Problem Line <td><?php echo $row_Recordset1['ctComp']; ?></td> <td width="60"><div align="center"><?php echo $row_Recordset1['ctpYear']; ?></div></td> <td width="50"><div align="center"><?php echo $row_Recordset1['ctLvl']; ?></div></td> <td width="50"><div align="center"><?php echo $row_Recordset1['ctpup']; ?></div></td> <td width="40" align="right"> <a href="vctinfo.php?s=<?php echo $row_Recordset1['o']; ?>">VIEW </a></td> <td width="40">- <a href="ectinfo.php?s=<?php echo $row_Recordset1['o']; ?>">EDIT</a></td> <td width="40">- <a href="dctinfo.php?o=<?php echo $row_Recordset1['o']; ?>&s=<?php echo $row_Recordset1['F1']; ?>">DEL</a></td> </tr> <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
  23. You are misunderstanding something about PHP because that statement makes little logical sense. Perhaps if you clarify what you meant we can steer you in the right direction. If I am misunderstanding something about PHP, I do wish you'd tell me what this is. Your remark is cryptic and, to put it frank, I have no idea what you're talking about nor asking. I'll try and clarify with an analogy. Does that statement make sense? According to Joe and how he understands computers, it must make perfect sense. But if you are like me and have a pretty extensive knowledge of computers, then you are left asking yourself, "What in the Hell is Joe talking about?" Joe has obviously misunderstood something about computers because he is making statements that do not make logical sense. But how am I to know what Joe has misunderstood? Should I give Joe a history of computers, their development, their components, the software they run, etc? That could take weeks! I have a fairly good understanding of programming languages and to say: Is highly ambiguous and can mean a myriad of things. So based on your original statement, which is ambiguous, can be interpreted in who knows how many different ways, and doesn't make sense: The only concrete thing I am able to tell you is: You have misunderstood something about PHP. I have no idea what it is you have misunderstood because your statement doesn't make any sense (it's equivalent to dividing by zero). But perhaps if you clarify what you mean by "embedding PHP in itself", I can determine what exactly you have misunderstood and I can help you understand a particular PHP concept better. I don't know how to be any more clear than that.
  24. You are misunderstanding something about PHP because that statement makes little logical sense. Perhaps if you clarify what you meant we can steer you in the right direction.
×
×
  • 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.