Jump to content

drifter

Members
  • Posts

    189
  • Joined

  • Last visited

    Never

Everything posted by drifter

  1. I am trying to create a table from a query, but the query I have has a left join on user_id - so when there is not match, user_id shows up inthe table twice - once as the ID, once as NULL - this gives me duplicate rows, and the create table fails. What can I do about this? Thanks Scott
  2. do you have an account where you have spam assasin or somthing on? send your self the news letter. it will get a spam score and broken down for what you got points on. Then go to the spam assassin site and look up everything you got points on and then start changing your newsletter to fit. can be things from not enough text, to to much text, to to much HTML, not enough HTML, coming from a .biz domain. Contain words like FREE, VIAGRA, or REMOVE ME takes some research, but you can fix it.
  3. start with the php manual and learn how to connect to the database - it is all there with examples
  4. OK  - I found the problem... not sure the best way to fix it. The problem is in the pear DB class - On my inserts or updates [code] $sql="insert ...." $db->query($sql); [/code] there is no result to clear if I put mysql_query() in place of the $db->query then the memory does not do up. The question is what can I do? Do I really want to have the mysql_query() statement in the middle of one of my pages when I use the DB class for everything else? Do I really want to mess with the call or upgrade to MDB2? and will that have the same problem?
  5. Is there a way to see what is stored in memory? I am watching my process and CPU stats, and I see that one of my imports that takes several hours starts out fine, but as it goes, it takes up more and more memory until if causes problems. I have unset everything I use - every loop through I use the same variables. I got rid of all array_push() and thing like that that grow. I unset everything in my functions... I do use fopen and fgets - as this reads line by line, do this somehow store the previous lines? I am not really sure where all this extra stuff is coming from - this is my only guess.
  6. ok  that is what you I do - I did not realize you mean the web server
  7. I know I am not going to be much help, but this sounds to me like a non php item - but you can look out site php and find something in c for example and call it is a system() or exec() that what I do with a voice synthesizer
  8. why is that? I am really looking for ways to make my cron jobs less priority so they stop getting in the way of the users
  9. not sure exactly what this does and the manual was not too help full. is this saying you can call proc_nice(10) during a script and the script will have less priority? as in is someone else is running a page that needs the CPU they jump in front of you in line?
  10. Hey - I switched it to the loop thought the file thing - I think I like it - I am amazed how fast if can loop through that many lines and take a substr to find a match. I see the CPU is way up but my memory is down to like 10% - I have that code in there to make the program sleep whenever there is traffic, so I am not worried so much about the CPU. Thanks
  11. not sure why you open then close right away... but did you check if the file is writeable?
  12. you need to give a little more here - that sounds like an HTML question to me
  13. do you think there are performance problems though looping through a 40,000 line file 40,000 times? I really have no idea. although on average, the line I am seeking would be at line 20,000, so I would only be looping through an average of 20,000 lines 40,000 times. (not counting those that do not have a match) And I do not care about speed - this is a background process - I care about memory and CPU usage
  14. Just as a note; I use this in there to slow things down when they get busy, but sleep only frees up CPU not memory [code] $load = sys_getloadavg(); if ($load[0] > 4) {   sleep(30); echo "Busy server - sleep 30 seconds<br>"; }else if ($load[0] > 2) {   sleep(5); echo "Busy server - sleep 5 seconds<br>"; }else{ if (time_nanosleep(0, 30000000) === true) {   echo "Slept for 0.03 second.<br>"; } } [/code]
  15. OK I have 2 files that are | delimited - one is like 26MB and holdds image names, the other is 48MB and holds records. Each record has an record/code that coresponds to a line in the image names file... (each is about 40,000 lines and the do NOT match 1 to 1) From the records file data|1234|more|data|other|stuff........................... from the image file 1234|image|names|here So I currently start by looping through the image file- explode each line and write to an image array $photoarray[$id]['pic1']=$lineelement[5]; $photoarray[$id]['pic2']=$lineelement[7]; So I get this whole 26 MB file in an array then loop through the other file and match it with the right element in the array.... Now the problem - this is killing my memory - running 50-60% on this script - any bump in traffic and things start backing up and compounding and crash. I am doing unset on everything that I use - ever photo element that is already used is unset just to save memory... So are there any other ways of doing this? Are there any good ways to scan the image file rather then saving it in an array?
  16. but the user can not navigate to this other site and have the URL passed back - they have to enter the url
  17. then there is not way to pass information from that site to yours... you may want to look at frames? I believe you can get the remote URL of a framed page. Not positive - I would have to look it up. I know javascript can not interact with a frame on a foreign domain, but I think it can read the URL... then you can know the URL and then parse that page? I am not really sure what you are trying to do.
  18. You want to change this so it watermark only over a certain size? if i under stand right, start with.. [code] if (Defined('WATERMARK_TEXT') && WATERMARK_TEXT!='') { // text [/code] change to [code] if (Defined('WATERMARK_TEXT') && WATERMARK_TEXT!='' && ($image_height>60 || $image_width>60)) { // text [/code]
  19. you mean when a visitor is on another site send information back to yours? Do you control this other site?
  20. I think the lines between scripting and programming are not really existant at all - not when you look at everything like php, java, c#, c++ and then try to categories there is not real difference.
  21. [quote author=heckenschutze link=topic=119158.msg487682#msg487682 date=1166478113] your after [color=blue]$_SERVER['QUERY_STRING'];[/color] Which will return the query string (everything after the ?)... Also, its not 'programming' unless its compiled, therefore your a proficient PHP [i]scripter[/i]. [/quote] I thought php was compiled for before it ran.... and if you run a cache system - it stores it in compiled format... So what is really the difference then? manual compiling vs automatic compiling?
  22. well you are going to need to start writing something and then ask if you have questions. Or go to the freelance section... Start by reading the file... use a file() then a foreach() and use the php csv funstions to read the data... once you get that  far, and you have data, you can worry about putting itin the DB.
  23. [code]           $domain="mydomain.com";           $myscript="something.php"; $thisurl="http://" . $domain . $script . "?url="; $regex = "/<\s*a\s+[^>]*href\s*=\s*[\"']?([^\"' >]+)[\"' >]/isU"; preg_match_all($regex,$page,$urls); $urlarray=array_unique($urls[1]); foreach($urlarray AS $url){ //echo $url . " " . $newurl . "<br>"; if($url!='#' && $url!='/'){ $newurl=$thisurl . urlencode($url); if(!strstr($url,'http://')){         $page=str_replace($url,$newurl,$page); } } } [/code] Is this what you want? take all the URLs and put them on a query string?
  24. mgallforever  - your quotes are all messed up on that line and we can not tell what you want to do.. something needs to be escaped? more quotes added. not really sure.
  25. anything you want to do with out reloading the page would be a javascript question you could use AJAX if you want to load a lot of content or you could use layers and hide and show depending on a click
×
×
  • 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.