Jump to content

Auriga

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Auriga's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi! I have a website that will show some pictures along with reviews. Both reviews as pictures will be written & uploaded by the visitors of the website. Each review will have 1 or more pictures attached to it. At the moment, I'm just attaching the link to the image, and showing it to the user by using <img src="$link">. However, this link is to the original picture (which can be quite big). To conserve bandwidth, I'd like to create thumbnails for each of these images. I've found some useful resizing algorithms, which i intend to run in batch using a chronjob. Now, i'm facing a problem though: How can i convert all these images at once to thumbnails, without having to download them to my PC and uploading them manually to my server? So basically, I'd like a script that will: given a list of links to images, i'd like to loop through them, resize each of them, and upload them to a folder on my server. Is this at all possible? And if so, can you give me some tips to get started? At the moment, i only see solutions that involve manual interaction (using <input type="file" ...>). That's not what i'd want to use... Thanks!
  2. Sorry :) Found the solution! :) It appears that you need to give in the path relative to the php file that calls the function... Quite confusing sometimes these paths in php...
  3. Hi, i have a problem with relative paths... I'm using the following: function get_contents() { $filename = "../images/testimg.png"; $filecontents = file_get_contents($filename); return $filecontents; } When i try to run it, it says that the file cannot be found. However, I'm sure that it's placed in /images/ whereas the function above is located in /library/ Even when I replace the relative paths with absolute paths, i still get the error: $filename = "/images/testimg.png"; I don't see what I'm doing wrong... Is there something that i don't see? Thanks!
  4. [quote]maybe you are using php4, private, public is not is implemented in php4..[/quote] That seems to be the case... I'm using PHP 4.4.4... Thank you, i will upgrade asap!
  5. Hey! I'd like to use a special php class that will make it easier to send mail. I've downloaded the class from http://www.phpguru.org/static/mime.mail.html However, it seems that i cannot use it in my project for some reason. I get an error on line 30: <?php /** * This file is part of the htmlMimeMail5 package (http://www.phpguru.org/) * * htmlMimeMail5 is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * htmlMimeMail5 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with htmlMimeMail5; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA * * © Copyright 2005 Richard Heyes */ require_once(dirname(__FILE__) . '/mimePart.php'); class htmlMimeMail5 {     /**     * The html part of the message     * @var string     */     private $html;  <--- here the error will come It appears that the compiler has some trouble with the private directive? My question: do i need to have something installed to use this kind of class (something like PHP Pear or so)? Or is there another problem with it? Thank you!
  6. Thank you for your suggestions! However it didn't work... It's still as slow as before... Any other suggestions?
  7. Hi there! I have a VPS containing some domains of mine. Each domain will only be able to see it's own dedicated space (folders) on the server.  Also, each will get some data from a central database using a php file that contains the queries. This database is located on a dedicated domain, and cannot be directly polled by any of the other domains. This because the database is too large to be copied to every domain. To get text from the database (poll the database), i use a script located on that central domain (with the database). This PHP script is called as follows: print include($PATH_TO_CENTRAL_FILE.'?param=$param'); $param will give the necessary information to the database (will be put in the query) to get the data from it. The data that the file gets from the database will be send back to the resp. webpage and printed there. When i ran the webpage on the domain, i noticed that it's very slow. Now I ran the linux command ab (Apache Benchmarking) on this webpage. Here are the results for different scenarios: Without database polling, without the include (the file at $PATH_TO_CENTRAL_FILE is not used at all in the webpage): 137.36 #/sec The file will only return text, no database polling (no queries run on the database): 0.73 #/sec The file will poll the database, but not return any results (the webpage gets an empty string): 0.96 #/sec The file will poll the database and send the results to the webpage (normal scenario): 0.79 #/sec It appears that whenever I send data back from an included PHP file, the webpage gets incredibly slow. Notice that the webpage still is very slow if i do not poll the database (no query is executed)! (?!) Therefore, I think it has something to do with the way that inclusions of different (absolute) paths are handled by PHP versus calling a procedure inline your html code. If you include a file using print include(http://www.mydomain.com/.../afile.php?params=$params); seems to be a lot slower than include(afile.php); and then call print myFunctionInFile($params); with afile.php in the same folder as the webpage. Do I make any sense at all? And if so, does anybody know a way to speed things up? Thanks in advance! Evarest
  8. Hi! I have two servers: Server A and Server B with a website. Server A contains some general useful code in php functions, which will be used in the website on Server B. Now, how can I include the functionality in a php file on Server A in the website on Server B? For example: [myfunctionfile.php on Server A] function MyFunction(myArgs) {   return "this is a test" + myArgs; } [myWebPage.php on Server B] <?php   include("http://www.servera.com/myfunctionfile.php");   print MyFunction("for server B"); ?> The above should print out on myWebPage.php: this is a test for server B I already tried to rename the myfunctionfile.php to myfunctionfile.php.inc, but that didn't work. Thanks in advance!
×
×
  • 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.