Jump to content

CroNiX

Staff Alumni
  • Posts

    1,469
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by CroNiX

  1. You can't mix mootools and another framework that uses the ($) function. You should stick to one framework. There are tons of image scripts for mootools that does what you are trying to do using prototype.
  2. I just gave the basic example. In mine, within the temp file I put a timestamp. If the timestamp is older than 1 hour (for example) it assumes its 'stale' and creates a new one.
  3. LOL
  4. Ive done this by creating a temporary file at the start of the cron job. The cron job then looks to see if this temp file exists, if it does it exits the cron job. At end of cron job, delete the temp file.
  5. instead of dumping your output directly, why not store the filename in an array, sort the array, then create the links from the array? <?php $filearray=array(); while ($file = readdir($dir_handle)) { if($file!="." && $file!="..") $filearray[]=$file; //store filenames in array } sort($filearray); //sort the array foreach($filearray as $filename) { //loop through array and output data echo "<a href=\"/files/$filename\" target=\"_blank\">$filename</a>"; }
  6. You should also consider using a stylesheet instead of inline styles. It will make your code much more readable and shorten it. It will also help maintaining the code. <head> <style type="text/css"> .module { position:absolute; background-color:#222222; overflow:auto; scrollbar-face-color: #000000; scrollbar-highlight-color: #000000; scrollbar-3dlight-color: #454545; scrollbar-shadow-color: #000000; scrollbar-darkshadow-color: #000000; scrollbar-track-color: #000000; scrollbar-arrow-color: #007799; } </style> </head> <body> <?php echo "<div class=\"module\">"; //see how much cleaner it is? include('modules.php'); echo "</div></td>"; ?> </body>
  7. When you are putting data in the database, use addslashes() (or better yet mysql_real_escape_string) and when you retrieve data use stripslashes() to remove them.
  8. Its because you were using parenthesis on your array elements when they should be square brackets. Wrong: <? echo "$liste(0)"; ?> Right: <?php echo $liste[0]; ?> You shouldnt need quotes around your array element. Also, its bad practice to use php short tags (<?), use the full tag (<?php)
  9. Heres one that works in 1.2 http://tools.uvumi.com/textarea.html
  10. you forgot the quotes in your associative array in the 2nd file at the bottom: while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo $row['instruct']. '<br />'; echo $row['comment']. '<br />'; echo $row['digit']. '<br />'; }
  11. Well of course you can't install spambots or host a warez site or anything illegal. Who but China allows that?
  12. I saw a piece of code with a large function and inside the function was <?php //this does nothing
  13. I don't believe so. Parameters are passed via URL. You could do this: <script type='text/javascript' src='javascriptfilename.js></script> <script type='text/javascript'>var paramname=paramvalue;</script>
  14. Heres a short read from the w3c (the group that sets the web standards) http://www.w3.org/2002/03/csslayout-howto If you look at the definition of what a table is from the w3c, it is to layout tabular data. A website layout is not tabular data. A chart showing a list of peoples name, age, phone, etc. IS tabular data. If you layout a website using a table, you are not following web standards and many companies want (obviously) to follow standards because it is a reflection of the company.
  15. You can kinda. Most ISPs use dynamic ip addressing for customers, so this IP address changes occasionally. You can use a service like dyndns (http://www.dyndns.com/) that will make it so if you own a domain name (yourdomain.com) it will redirect to your home (or whatever) ip address even if it changes. The thing is most ISPs block incoming port 80 (http) to prevent you from running a server from home. You also need to read the Terms of Service agreement that you signed when getting your internet access to see if they specifically disallow this. If they do, you might be able to get away with it anyway, but at the risk of them shutting you off. They usually do monitor traffic going to your connection. You are also very limited on your upstream connection while the downstream is usually pretty fast. This means that your website will be kind of slow sending data out to anybody connecting to it. The best thing is to have your own server with dedicated IP plugged in at a data center. I have 3 for my clients and it is the best solution because you DO set the rules and can install anything that you want without having to go through some shared hosting company that may or may not want to install something for you.
  16. I would also use mysql_affected_rows() to tell the user how many records were deleted.
  17. Um, I fail to see the connection between a college cutting hours and gas prices. How much gas does a college purchase? I'd bet close to none. Wheres the connection?
  18. Sure, you buy or lease a server and put it in a data center. There are also virtual private servers you can rent.
  19. 1) Are you sure there are entries in the db with status = 0? 2) You should probably post more code dealing with the database calls in addition to just the query.
  20. sure, google "php cron" Do you have the ability through your server to setup cron jobs? If not it would be pointless to explain.
  21. No. You most likely won't be able to change the setting unless you own the server.
  22. Try taking the quotes off of the 0 in the query
  23. Then as suggested above the timeout is your HTTP server and there's nothing you can do about that from php. You would need to change the server timeout, like if it is apache edit the httpd.conf.
  24. If you want a more consistent look of all of the entries, I would limit by characters, not words.
  25. Why wouldn't you pull this from a database?
×
×
  • 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.