Jump to content

TreeNode

Members
  • Posts

    59
  • Joined

  • Last visited

    Never

About TreeNode

  • Birthday 03/17/1982

Contact Methods

  • AIM
    TreeNode

Profile Information

  • Gender
    Male

TreeNode's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. similar problem and solution here: http://www.hu-forums.com/archive/index.php?t-934.html
  2. combine the variables to the url, for example: var pars = 'content='+new_content+'&edit=true'; var url = 'edit.php' . '?' . $pars;
  3. wildteen88 is right, but also keep in mind that anything in double quotes is "evaluated" by the PHP parser so in a very miniscule way outputting something in double quotes that doesn't need to be takes longer than using single quotes, unless of course you ARE outputting a variable. Additionally, by keeping your HTML only output in single quotes, you'll be able to read it easier (no slashes). I would suggest this: print '<a class="sidelink" href="http://www.lds.org">LDS Church</a><span class="hide"> | </span>' . "\n"; edit: Oops, forgot to say that also in a very miniscule way, technically echo is faster than print, since echo does not return a result.
  4. You will not get the precise bandwidth usage for a file if all you do is multiply the times downloaded by the size of the file. This does not take into account the people who canceled the download. If you don't know PHP, you could always look into server logs, possibly even download another free software program that could parse out that information for you.
  5. It seems as if the solution is more in re-writing how you define the current working directory while you navigate instead of parsing out the required information every time. Maybe you could just keep a record (variable) of the current working directory alongside the ridiculous path string you are building? Just some ideas.
  6. with Ilya's code it should be something like: <?php $hosturl = $_POST["hosturl"]; $mtitle1 = $_POST["mtitle1"]; $content=$hosturl . "," . $mtitle1 . "\n"; $filename="yourfile.txt"; $fin=fopen($filename,"w"); fwrite($fin,$content); fclose($fin); ?> if you're still having problems with this then you don't have proper permissions to write to that file.
  7. Are you always expecting at least one result? Drop the first mysql_fetch_assoc and make your loop a while-loop
  8. <?php ob_end_flush(); ... do a bunch of stuff ... set_time_limit(30); flush(); ... ?> I use set_time_limit(30) if I suspect that the script will run longer than the defaulted time allocated for php (30 seconds). FYI, don't use this unless your script is expected to run for a long time, no script should ever run this long if it's being used publicly.
  9. replace $data = mysql_query("SELECT * FROM stock WHERE upper($field) LIKE'%$find%'"); with $find_array = explode(" ", $find); $find_sql = ""; // init foreach ($find_array as $temp) $find_sql .= "LIKE '%$temp%' OR "; $find_sql = substr($find_sql, 0, -3); // throw away last OR statement $data = mysql_query("SELECT * FROM stock WHERE upper($field) $find_sql");
  10. Re-work your logic from the beginning. Your script is working as you made it, session variables are tied to the specific host and computer in which it is calling it, so if another file is outputting session variables that were assigned in a different file, as long as its the same host/client it'll be the same values. One of the ways to fix your problem is to include the searched text on the page tabs, so it re-runs the query for every tab you choose. Or, you could have all of the pages/tabs outputted and you simply use javascript to navigate from one to the other (they would all be parsed out and unchanged that way).
  11. I'm guessing you mean IIS log files, which are in most cases flat files to begin with. You can find some good comma/tab delimiter classes around for PHP. Also, some logs can be stored directly to an SQL database so that'll just take querying that database.
  12. If you are in fact using an older version of PHP (4.0 or earlier) you'll definitely have problems. Try this code that was directly from PHP.net, it might not be the best but it should work as a more manual way of getting information about a remote file: function getimagesize_remote($image_url) { $handle = fopen ($image_url, "rb"); $contents = ""; if ($handle) { do { $count += 1; $data = fread($handle, 8192); if (strlen($data) == 0) { break; } $contents .= $data; } while(true); } else { return false; } fclose ($handle); $im = ImageCreateFromString($contents); if (!$im) { return false; } $gis[0] = ImageSX($im); $gis[1] = ImageSY($im); // array member 3 is used below to keep with current getimagesize standards $gis[3] = "width={$gis[0]} height={$gis[1]}"; ImageDestroy($im); return $gis; } Another option is to do what I do, create another script on the server that houses the images, that script is just a function that can either manipulate an image and cache it or just return the image information.
  13. You can do a full-text search (which doesn't sound like what you want) or you'll need to build the query more than what you have already. Try exploding the input and build the query like so: $find_array = explode(" ", $find); $find_sql = ""; // init foreach ($find_array as $temp) $find_sql .= "LIKE '%$temp%' OR "; $find_sql = substr($find_sql, 0, -3); // throw away last OR statement $data = mysql_query("SELECT * FROM stock WHERE upper($field) $find_sql");
  14. Is the file local? I know when considering the GD library and images in general with PHP has some problems when trying to get images from non-local machines.
×
×
  • 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.