Jump to content

springo

Members
  • Posts

    31
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

springo's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi, I have made the following .htaccess code to rewrites links from ./whatever to ./index.php?p=whatever RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-f RewriteCond %{SCRIPT_FILENAME} !-d RewriteRule (.*) index.php?p=$1 [QSA,L] (it's all there is in the .htaccess file) It's working on my computer (on XAMPP) but when I upload it to the server it doesn't. Do you know what could be the problem? Thanks.
  2. Hi, I'd like to know if it's possible to cut a text string to a given width in pixels, like 400px or anything, so that I can fit it in a <td> with such width. Thank you very much for your help.
  3. I was rather worried by my (free) shared web hosting, which I'm not sure whether to trust or not
  4. I think I didn't make myself clear enough. I need the server to have that cookie so that a PHP script gets the right file when I use file_get_contents($URL). The other server needs that cookie to provide the file I want. So the server doesn't store a cookie for its script, but rather the one executed on another server when I request the file. If there are no server-side cookies, can I do this somehow? Thanks again.
  5. Hi, I'd like to know if it's possible to do this. I mean set it in the server, not in a visitor's browser. Thank you for your help.
  6. Hi, I'd like to know to encrypt PHP source code. Is any editor capable of doing this, or any other software? Thanks!
  7. OK let me explain it more clearly: 1- Hosting located in Spain runs my script which calls file_get_contents() to parse a website 2- Parsed website finds no cookie specifying a language on my host, so it creates one according to IP (so cookie will say "Spanish") 3- Returned contents are in Spanish so my parsing script won't work So basically what I need is a customized cookie saying "English", so that when I try to file_get_contents(), the parsed website returns contents in English. Thank you and sorry if I don't make myself clear enough.
  8. The actual problem is that the domain creates a cookie that stores a default lenguage based on my (host) IP and I'd like to use another cookie because the one I get is wrong.
  9. But that sets a cookie on the user's PC and file_get_contents() requests a file that needs to read the cookie on the server (yes, it's on another domain).
  10. Hi, I look forward to parsing a dynamic page which requires cookie info to display properly. Is it possible to send cookie info so that file_get_contents() reads the proper page? Thank you for your help.
  11. OK, thanks it works perfect now! Thanks for optimization tips too, I didn't realize loops executed the count() function each iteration
  12. Hi, I was trying to filter the contents in an array, and it seems to work, but I've got an issue with the indexes. When I unset() an element, if I count() the number of elements, I still get the same number that I had before filtering. I'd also like to make my indexes go back to 0,1,2,3... For example, I want to filter the elements containing the string "apple". If I had this array: $fruits [0] = "apple"; $fruits [1] = "lemon"; $fruits [2] = "orange"; $fruits [3] = "lemon"; $fruits [4] = "strawberry"; $fruits [5] = "apple"; $fruits [6] = "lemon"; I'd like to make it: $fruits [0] = "lemon"; $fruits [1] = "orange"; $fruits [2] = "lemon"; $fruits [3] = "strawberry"; $fruits [4] = "lemon"; count($fruits) should return 5. But I'm getting: $fruits [1] = "lemon"; $fruits [2] = "orange"; $fruits [3] = "lemon"; $fruits [4] = "strawberry"; $fruits [6] = "lemon"; count($fruits) returns 7. Here is my current code for filtering: <?php for ($index = 0; $index < count($fruits); $index++) { # sorry, but I hate foreach if ($fruits[$index] == "apple") unset($fruits[$index]); } ?> Thank you very much for your help!
  13. Hopefully I didn't need that at this time, but I'll keep record of that.
×
×
  • 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.