Jump to content

thedust2010

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

thedust2010's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have a problem that is driving me crazy. We have an RSS feed that gets sent to a couple of different sites via Feedburner. Most of these sites are run on the CodeIgniter framework and when we utilize the framework's built-in RSS/XML parsing library everything works just fine. However we have one site that is older and isn't on any type of framework so we're using SimpleXML instead. The problem is that the first story is missing. It seems to have cached the RSS feed at some point and now will never update with any new stories I post today. This is not a problem with our other sites running CodeIgniter. Anyone have experience with this issue? Any advice would be a great help.
  2. Never mind, I got it to work... just needed to change permissions on the folder!  Oops!
  3. I am trying to execute FFMPEG via PHP's exec() command with the following code: [code] $output = array(); $cmd = exec("ffmpeg -i /path/to/website/test_media/tortoise.avi -ab 56 -ar 22050 -b 500 -r 15 -s 320x240 /path/to/website/test_media/tortoise_success.flv", $output); echo "--<br>"; echo nl2br($cmd) . "<br>"; print_r($output); echo "<br>--"; [/code] When I enter in this command logged into the shell it works, but when I try this out in PHP, I get no output from the code above.  Instead it just yields: [code] -- Array ( ) -- [/code] I have tried an absolute path to ffmpeg but that hasn't made a difference.  Any ideas what might be wrong here?  Why am I not getting any kind of output (success/failure) from this?
  4. When logged in as root, "php -v" renders: [code] PHP 4.3.9 (cgi) (built: Nov 7 2006 05:00:50) Copyright (c) 1997-2004 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with the ionCube PHP Loader v3.1.16, Copyright (c) 2002-2006, by ionCube Ltd., and with Zend Extension Manager v1.0.11, Copyright (c) 2003-2006, by Zend Technologies with Zend Optimizer v3.2.0, Copyright (c) 1998-2006, by Zend Technologies [/code] However, these modules don't load when viewing phpinfo(): [code] This program makes use of the Zend Scripting Language Engine: Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with the ionCube PHP Loader v3.1.16, Copyright (c) 2002-2006, by ionCube Ltd.[/code] Thoughts?
  5. I finally got this figured out.  I was having problems because I didn't realize when you make a request with fopen() or get_file_contents() it makes that request as an entirely new user with no saved session data.  Since that user is not logged in, it was refusing to serve up the file.  The way around this was to generate a random key, associate it with the file in the DB and then submit that key for validation at /file.php.  The temporary key is then deleted and everyone is happy.  Thanks for your help!!
  6. file_get_contents() does not work either... same result.  The image is a 4 KB empty image file.  :(  Any other ideas?
  7. I have a PHP script that accepts various paramters and outputs an image.  It works fine inside of an image tag but I can't use it with fopen() to attach to an email.  For example this HTML will display the custom image just fine: [code] <img src="http://www.mydomain.com/file.php?fileID=45598&constrain=550" /> [/code] BUT using fopen() to attain the image as a blob is just not working: [code] $fileBlob = fread(fopen("http://www.mydomain.com/file.php?fileID=45598&constrain=550", "r"), $Row_File["fileSize"]); [/code] Any ideas on how this can be handled?  I do have allow_url_fopen set to true, so I'm not sure what the problem is...
  8. Arrrgh... OK I got it.  I am cycling through an array and was checking the value instead of the key.  I am very sorry.  Thanks for all the quick responses but I just totally missed this.  I think I will try to get more sleep tonight.  :)
  9. Can anyone explain the following output to me? [code] if ($value1 == "0") {     echo "AAA<br>"; } if (is_numeric("0")) {     echo "BBB<br>"; } if (is_numeric(0)) {     echo "CCC<br>"; } if (is_numeric(trim($value1))) {     echo "DDD<br>"; } [/code] Output is: [code] AAA BBB CCC [/code] Why on earth do I not see "DDD"?  I've tried with and without trim().  Doesn't make a difference.  This has got to be a bug of some sort.
  10. I have a URL that when entered returns a file.  It's something like http://yourdomain.com/file.php?fileID=43433.  If I enter that URL I will get the image or document that I'm looking for.  No HTML at all.  Just the file. Now, I'm trying to use the following line to capture that file in order to include it in a zip file using the following line: [code]$fileContents = file_get_contents("http://yourdomain.com/file.php?fileID=43433")[/code] It is returning true, but the file is always less than 4K.  It's not grabbing the contents of the file, even though it is returning true.  The thing is I HAD this working at one point, but now I don't know what is wrong... does anyone have any ideas on why this might be happening to me?  Or examples of how others have done this?
  11. I have an upload script inside of a Java applet that is occasionally displaying all the header information, like so: HTTP/1.1 302 FoundDate: Fri, 30 Jun 2006 20:21:20 GMTServer: Apache/2.0.52 (CentOS)X-Powered-By: PHP/4.3.9Set-Cookie: PHPSESSID=b23f5ebd692096738ebc60600a3b26b6; path=/Expires: Thu, 19 Nov 1981 08:52:00 GMTCache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0Pragma: no-cacheLocation: /login.phpContent-Length: 797Connection: closeContent-Type: text/html This is obviously a big security risk.  Does anyone know what might be causing this or how to replicate this behavior?
  12. In my 3 years of PHP application development I don't think I've ever been this perplexed. It is rather difficult to explain, but hopefully it makes sense. For brevity I'm not giving details about the database table structures. Really it is irrelevant for what my problem is, which appears to be some sort of variable scope issue. The problem appears to be something really elementary... I have a database-driven system of files and folders with permission to view these contents specified on a per-user basis. Occasionally this means assigning a folder a new parent folder if the user is blocked from seeing it. I've provided a visual aid that makes this much easier to comprehend: [img src=\"http://dustwurks.com/nested_folders.gif\" border=\"0\" alt=\"IPB Image\" /] So here in this example we would be looking to assign "TEST2" as the parent of "INSIDE 4". To do this, I have a recursive function that finds the new parent ID that should be assigned. It looks like this: [code] function findParentID($userID, $folderID) {     global $DB;          $SQL = "SELECT folderID FROM navAccessFolders WHERE folderID=".$folderID." AND userID=".$userID;     $Row = $DB->GetRow($SQL);     if ($Row) {         echo "value to return: ".$folderID."<br>"; // for troubleshooting         return $folderID;     } else {         $SQL = "SELECT parentID FROM folders WHERE folderID=".$folderID;         $Row = $DB->GetRow($SQL);         findParentID($userID, $Row["parentID"]);     } } [/code] Now let's say the folder ID for "INSIDE 4" is 138. To get the parentID I would use: [code] $parentID = findParentID(1, 138); // using "1" as a sample user ID echo "value returned: ".$parentID."<br>"; // for troubleshooting [/code] This functionality WORKS if the findParentID function never calls upon itself again. Then the value returns null. But here is the part I don't think anyone can explain to me. The actual output from the code used above is: [code] value to return: 135 value returned: [/code] I am echoing the value just before the function returns it and it IS in fact the correct value. However, it is not returning the value that I am seeing in the output. It returns null. How can this be? There is not one line of code between the echo and the return. And again, this ONLY is happening when the function calls upon itself again. The function works but the value returns null anyways. If someone can figure this one out, you will have made my list of all-time top coders (and maybe we can hire you for some work sometime??). Any advice or help is much appreciated. I'm so close...
×
×
  • 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.