Jump to content

lifeson2112

Members
  • Posts

    43
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

lifeson2112's Achievements

Member

Member (2/5)

0

Reputation

  1. Thanks so much for the help with this. I am not well versed in regex yet and this saved me
  2. hello, I am writing a blog program and I would like to keep intact the spaces that the author includes, but I don't want to replace every space with an entity. pretend the hyphens are space characters and the plus signs are entities; Here's what I want to do: - = - -- = -+ ---- = -+++ I tried preg_replace("/[\s](\s){1,}/"," ") ,but that doesn't work. I need something that will exclude the first space. Any tips?
  3. I'm having problems with a left-floating div in IE. It works fine if you keep the window the same size but if you resize it or bring the history side bar up, it moves the floating div to the right and stays there even after you remove the history side bar or re-expand the window. Any clues on why it would be doing this?
  4. Maybe the array you are accessing contains an array in each element (two-dimensional array)? your example above looks oddly declared. Shouldn't you have something like $reserved_key[0] = 'a'; or something. Or does it automatically assign the value to whatever the 0 points to? either way, maybe you should try assigning values in your array differently.
  5. A simple "you can't do that, moron" would even suffice. It's consuming me and I need to know if anyone has a solution. If not, screw it. I'm almost there and the fix looks like it's so close it's about to bite my head off. One line, causing me countless days (or has it been hours?) of torture!!
  6. yeah, but if you store the information in a text file or a database it will be there for as long as you specify and you can access it any time. Check out some of the stuff you can do with file() and fopen().
  7. Is this some wierd security feature that php has? all I want to do is download a bunch of images from amazon. Again, the url's work fine when I manually paste them into the copy feature, but when I try to get the url from the array it gives me this error: "Warning: copy(http://ec1.images-amazon.com/images/I/41Bd98krbnL._AA280_.jpg ) [function.copy]: failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found in C:\Program Files\xampp\htdocs\copy.php on line 30" but when I paste the exact url (http://ec1.images-amazon.com/images/I/41Bd98krbnL._AA280_.jpg) into the copy function it works. I don't know what to do. I tried putting the array element into another variable before it hit the copy function but it still does the same thing. I also messed around with putting double and single quotes (and no quotes) around the rowArray[1]. I don't want to give up on this though because it would save a hell of a lot of time and the solution is right there... Anyone? should I find another fix to this problem? thanks
  8. I havent had any problems with the file paths if I just paste one from the text file, but the copy function won't read the file path correctly from an array.
  9. Hello, I have a spreadsheed with names and image urls that I have converted to a tab delimited text file. Column one has the product name and column two has a url to an image on another site. I am trying to loop through the file and copy the image onto my computer, but it is giving me this error: "Warning: copy(http://ec1.images-amazon.com/images/I/41Oj92a63gL._AA280_.jpg ) [function.copy]: failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found in C:\Program Files\xampp\htdocs\copy.php on line 16" here's some of the code. I have the problem area commented so you can get a better idea of what's wrong here: <?php $sourceFile=file("C:\Documents and Settings\Jared\My Documents\amazoninventory\amazon_pics.txt"); foreach($sourceFile as $row) { $rowArray=explode("\t",$row); //this will make the file name uploadable $nameNoEndSpace = preg_replace('/ $/',"","$rowArray[0]"); $ridArray=array(" ","'","/",",","#"); $replaceArray=array("-","-","-","",""); $imageName= str_replace($ridArray,$replaceArray,$nameNoEndSpace); $imageLocation="C:/Documents and Settings/Jared/My Documents/amazoninventory/images/"; //debugging lines echo"$rowArray[1]\n<br>"; echo"$imageLocation"."$imageName".".jpg"; /***************************************************************/ // PROBLEM AREA /***************************************************************/ //I have problems with the $rowArray[1] here. It works fine if I copy the url that gets outputted from the first debug line above, but this right here really screws things up. copy("$rowArray[1]","$imageLocation"."$imageName".".jpg"); } ?> so, I guess the problem here is reading the input file from an array. Does my version of php (4) just not allow it? again, this works fine if I enter a url directly instead of trying to read it from the array (which does provide an accurate url). any help will be greatly appreciated.
  10. Wildbug, the table definitions for all the tables are exactly the same. What I had in mind was to combine the results so that the columns lined up. If this isn't what the join statement does then I'm a little confused. I'm going to go ahead and look into the union keyword.
  11. hello, I am having problems searching across multiple tables. I was told that I could do this by using a JOIN statement, but that doesn't seem to be working. here's an example of one of my queries. It works fine when i test them each individually, but the join statements don't work. : SELECT * FROM pegperego WHERE name regexp 'power' and name regexp 'wheels' and name regexp 'latch' or caption regexp 'power' and caption regexp 'wheels' and caption regexp 'latch' JOIN SELECT * FROM power_wheels WHERE name regexp 'power' and name regexp 'wheels' and name regexp 'latch' or caption regexp 'power' and caption regexp 'wheels' and caption regexp 'latch' JOIN SELECT * FROM power_wheels_wheels WHERE name regexp 'power' and name regexp 'wheels' and name regexp 'latch' or caption regexp 'power' and caption regexp 'wheels' and caption regexp 'latch' JOIN SELECT * FROM presto WHERE name regexp 'power' and name regexp 'wheels' and name regexp 'latch' or caption regexp 'power' and caption regexp 'wheels' and caption regexp 'latch' ; these are all pretty much the same queries, but looking through different tables. My thought right now is that maybe the query is too big or I am using the join statement incorrectly. If anyone can tell me what I'm doing wrong it would be greatly appreciated.
×
×
  • 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.