Jump to content

ciber

Members
  • Posts

    102
  • Joined

  • Last visited

    Never

Everything posted by ciber

  1. Can anyone suggest any good book I can purchase for learning how to setup DNS properly, how DNS works and working with BIND? Thanks
  2. I have created a site from scratch that generated all its content from a database, I want to cache these pages - but dont want to modify my code excessively. I have tried to find something that can do this, but since I have never had the need to do it before, I dont know how or what to look for. Is there any easy solutions to caching a page so that it can be accessed immediately without needing to access the database. Even if the cache folder needs to be manually emptied. Thanks!
  3. @ChemicalBliss I kinda want to keep the mysql queries to a minimal since it slows the execution time down. So executing multiple queries is kinda out, however that link you provided was quite helpful. @PFMaBiSmAd thats actually perfect idea, thanks Thanks to both!!
  4. I have a product database, with 5 different types of products, im wanting to list each of these products under a sub header on a single page. this is how im currently, perhaps someone can give me an idea how I can optimize this. execute mysql query echo type header while { output data for type 1 } reset mysql position echo type header while { output data for type 2 } reset mysql position etc, process is repeated In addition to this, the types are fixed, and wont be changing so variables were not necessary - headers are "hard coded" any suggestions??
  5. I want to extract the path from a url string, how do I do this?? I included an example below to describe what I mean. input : http://www.remotesite.com/images/folder/image.jpg php magic happens output : /images/folder/image.jpg thanks.
  6. I have created a PHP application, which uses apache rewrite for the URLs, my problem is the rewritten urls are very similar to some of the files im using, is there a way to deny direct access to these files using htaccess? for example x.php, y.php and z.html
  7. Got it to work, made use of subqueries
  8. I am performing a query in my database to fetch information, and count how many of a specific type of articles there are. My database stores 3 types of articles, a review, preview and article - however, if one of them counts a zero value, it does not show the entry. ie: if I have 3 reviews, 4 previews and 1 article it will show. But it I have 3 reviews, 0 previews and 1 article it wont show (or what ever combination of items = zero) how can I fix this? here is my code: COUNT(articles_1.type) AS reviews, COUNT(articles.type) AS previews, COUNT(articles_2.type) AS articles this extract counts the types of articles such as review, preview or just a normal article SELECT product.screenshots, product.renders, product.moreimages, product.ytplaylist, product.minreq, product.download, COUNT(articles_1.type) AS reviews, COUNT(articles.type) AS previews, COUNT(articles_2.type) AS articles, product.title FROM inf81_product.product INNER JOIN inf81_product.categories ON categories.id = product.cat INNER JOIN inf81_product.articles ON articles.game = product.id INNER JOIN inf81_product.articles articles_2 ON articles_2.game = product.id INNER JOIN inf81_product.articles articles_1 ON articles_1.id = product.id WHERE categories.slug = '$var1' AND product.slug = '$var2' AND articles.type = 'review' AND articles_1.type = 'preview' AND articles_2.type = 'article' GROUP BY product.id LIMIT 1
  9. thanks for your help ... if i try spelling .htaccess correctly maybe it will work -.-
  10. nevermind, im just going to use subdirectories
  11. I tried this already ... it just keeps giving me an error 404, as wordpress is unable to find it, even though im trying to access it via the games folder. This is what my wordpress htaccess is AddHandler application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml Options +FollowSymLinks # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} !^games/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_URI} !^games/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress This is what my games folder htaccess is RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule index.php [L]
  12. I am currently having a problem, my site makes use of 2 scripts www.mysite.com makes use of an .htaccess file for wordpress and www.mysite.com/games/ makes use of its own .htaccess script too problem is the root directories htaccess file is interfering with the /games/ htacess as they both use rewriting of URLs, besides putting these into 2 sub directories of their own, is there any way of disabling the roots htaccess from interacting with the /games/ one? Thanks
  13. Personally I think feed2js is a better option as it does not slow down your servers execution time - when using feeds I always end up having to cache the files, as to increase loading time. But then again, it may not suite what your doing.
  14. Hi, I am looking for some sort of a tutorial or information about how permalinks work when creating a plugin, in addition to development of plugins. I have yet to find a good source for developer related content for wordpress, as the codex site only explains the very basics of wordpress. Thanks
  15. Hi, I am getting a problem with my CSS, I cant get my boxes to align properly without them dropping to the next line, see picture and code below. If anyone can please help! <div id="content"> <!-- Top Block --> </div> <div id="content" class="adj" style="width: 46%"> <!-- Left Block --> </div> <div id="content" class="adj" style="width: 46%"> <!-- Right Block --> </div> <div id="content"> <!-- Bottom Block --> </div> As you can see I set it to be 46%, but if I increase it, the blocks drop below each other instead of next to each other. .adj { height: 270px; float:left; } #content { width: 100%; margin:5px; border: 1px solid #2f78a5; padding:10px; -moz-border-radius: 5px; background: #e5f5ff; } Thanks [attachment deleted by admin]
  16. via a webpage, its a GUI for our staff to access the clients DSL accounts. And sometimes they are required to kick a client.
  17. Hi, I have a perl script, which kicks my clients session when they have reached their usage limit on DSL. Currently I use a Perl script, to do this shell_exec("perl /usr/local/etc/raddb/scripts/rad-disc.pl -u ".$_GET['username']." -i ".$_GET['ip']." -n ".$_GET['nas']." -s 'secretgoe\$here'"); // -i --> IP // -u --> Username // -n --> NAS Server // -s --> Servers Secret (ie: Password) When I execute this script: perl /usr/local/etc/raddb/scripts/rad-disc.pl -u xyz@abc.com -i xxx.xxx.xxx.xxx -n xxx.xxx.xxx.xxx -s 'secretgoe$here' in SSH, I get ACK response saying that the server has Acknowledged my request and disconnected the client, but when I execute it using PHP's shell_exec() (or exec()) (as show in the first line of code), the server responded with a NAK, Negative Acknowledgment. The files are set on root, and are set to execute 6777. I don't see why it would be doing this, unless shell_exec is doing something different that would be done in SSH. ------------------->>> In addition to this, I tried writing the script with the information from the database to a file, and then tried to execute that file using PHP. Again NAK. However when I try to execute that exact generated script using SSH - it executes perfect. Please if anyone can assist, I will be very grateful!!
  18. I am currently trying to create a plugin for wordpress, basically I need the main page to show a list of all the items, when I click the title of an item I want it to edit. There is also an add feature, and all this is stored in a database. Now creating in PHP for me would be easy, but with wordpress I am confused as hell as to how it queries stuff and accesses the database. Does anyone know of any basic applications I can use to see how it works, or even better a tutorial or book that shows this. Thanks
  19. OK hopefully this makes sense I have a mysql table, which has an id, an a category name. My product table has its information, and a category id. Now my problem, when I am editing a product, I want the category to be selected. How do I get php to echo all the items in the category, but get it to also add the selected attribute to the item which is selected in the products database Thanks
  20. Thanks so much, worked perfect!!
  21. Hi, I have 2 tables, I am currently trying to get my query to get information from the one given information of the other: I am inputting a slug value for the categories database, in which I am wanting the database to return values from the games database. I am currently able to do this in 2 queries, but want to reduce it. This is how my two queries work. $result = mysql_query("SELECT * FROM categories WHERE slug = '$directory[1]' ") or die (mysql_error()); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $cid = $row['id']; } Then the second query $result = mysql_query("SELECT * FROM games WHERE cat = '$cid' ") or die (mysql_error()); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { // Information is outputted } Does anyone know how I can get this information using one query?
×
×
  • 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.