Jump to content

TecBrat

Members
  • Posts

    39
  • Joined

  • Last visited

Contact Methods

  • Website URL
    http://www.tecbrat.com

Profile Information

  • Gender
    Not Telling

TecBrat's Achievements

Member

Member (2/5)

0

Reputation

  1. This link: http://httpd.apache.org/docs/2.0/mod/core.html#include shows that apache allows files to be included in it's configure files, but it did not work when I tried it in .htaccess. Does anyone know if it's supposed to? In one site I put this in .htaccess: Include /home/test/public_html/dynamic/dyn_htaccess.inc in the test account's public_html/dynamic directory, I put a dyn_htaccess.inc file with this content: ErrorDocument 404 /home/test/public_html/404_error.php I verified that 404_error.php exists in the specified path but when I accessed the account where I put the include directive in .htaccess, I got a 500 server error.
  2. You echo it like window.onload = function() {setTimeout(showIt, <?php echo($ama[Terms]); ?>);}; The server will parse it so that it is presented to the browser as window.onload = function() {setTimeout(showIt, whatever terms is);};
  3. I have written a function, is_cmyk(); that can test jpeg and psd images, but I would like to add the ability to check for images contained in a pdf document. Does anyone know how to read this data using php? I'll paste my existing code so you'll know the direction I am headed. function is_cmyk($filename) // currently ony works for jpg and psd. psd requires classPhpPsdReader.php by Tim de Koning { $matches=split('\.',$filename); foreach ($matches as $key=>$value) { $extension=$value; //if there is more than one period, this will find the actual extension. } switch ($extension) { case 'psd': include('classPhpPsdReader.php'); $psd = new PhpPsdReader($filename); if($psd->infoArray['colorMode']==4) { return TRUE; } break; case 'jpg': $size = getimagesize($filename); //echo ("get image size found $size[channels] channels"); if($size[channels]==4) { return TRUE; } default: return FALSE; break; } return FALSE; }
  4. according to http://staff.washington.edu/dgrimmer/walkthrough.htm, my experience and SB's post above, "To open a directory, you need to set the execute bit (an open is to execute the directory). $ chmod 755 <directory> results in 'drwxrxrx' when listed with ls -l ."
  5. Execute permission on a directory just means the ability to open that directory.
  6. Does anyone have a bit of code to send the same file attachment to everyone who fills out a certain form? I tried some code from sitepoint http://www.sitepoint.com/print/advanced-email-php but it was for a POST input file. I edited it, but apparently didn't get it right. I have written other mail forms, but this one is giving me a little trouble.
  7. Thanks. That is a more elegant way of doing basically what I was trying to avoid, because my way was not elegant. I will consider using it that way. Edit: $$key = strlen($key) > 1 ? trim($value) : null; I am not accustom to the shorthand if-then. Can you help me out with this a bit? If I am reading it correctly I wonder: Why are you checking the length of $key?
  8. can you not just point the form's action to the offsite page? (unless you need to do something with the values first.)
  9. My normal method of form handling is a file like contact.php with a handler like contacthandler.php. In contacthandler.php there would be a validation routine. If the form does not validate, I offer a javascript go-1 and the user can make corrections. My problem is with a script written by someone else. (I think it's related to the fact that it uses sessions.) I have added my form and everything works except that when you return to the previous page the form is blank. Quite frustrating for a long form. I know I can re-call the page with a submit button and hidden fields then fill in all the fields with value="<?php echo($whatever);?>" But I'd rather find a way to keep those values in history. Can anyone give me a clue, or if it can't be done explain why? I posted in another forum and did not get an answer. Tec.
  10. I would try testing the data for an instance of "curl curl" and replaceing it with "curlcurl" or "curl_curl" or similar. If that's not an option, I'd suggest digging into the manuals at haxx.
  11. The error was that the semicolon delimited list needs a space after the semicolon. <? //... curl_setopt($ch, CURLOPT_COOKIE,$cookie1.'; '.$cookie2); //... ?>
  12. I posted this on another forum and didn't get a reply after a couple of days. I wonder if anyone here can help. I am accessing an application on another server by cURL. That applications sets cookies by javascipt, so they are going on the end-user's system. I can grab them (using the $_COOKIE superglobal) and put them into the curlopt_cookie, and they work as expected as long as I only put in one cookie at a time. When I try <? //... curl_setopt($ch, CURLOPT_COOKIE,$cookie1.';'$cookie2); //... ?> It doesn't work. My understanding is that the third argument should be a string in the format of "name1=value1;name2=value2" I wrote this to try to be sure I got them all, but it still isn't right: <? foreach($_COOKIE as $key=>$value){ $allcookies.=$key."=".$value.";"; } //... curl_setopt($ch, CURLOPT_COOKIE,$allcookies); ?> Any ideas why this does not work? I have tried everything that has come to mind, and nothing.
  13. I found a Perl Module called XML::Simple that gives me a good start.
  14. I think I need to learn one function, or one complex regular expression and I'd be okay. This is actually to parse xml returned from authorize.net automatic recurring billing. if there are any other soulutions that you know of, I am definatly interested in hearing them. Here's the php code: function parse_return($content) { $refId = substring_between($content,'<refId>','</refId>'); $resultCode = substring_between($content,'<resultCode>','</resultCode>'); $code = substring_between($content,'<code>','</code>'); $text = substring_between($content,'<text>','</text>'); $subscriptionId = substring_between($content,'<subscriptionId>','</subscriptionId>'); return array ($refId, $resultCode, $code, $text, $subscriptionId); }
  15. I openly admit to being rather unskilled. I haven't even attempted to validate my code, or my boss's code. Neither of us has taken an actual course in web development. His gift is as a graphic artist, and mine is in computer science. (Mostly non-web based programming like Pascal, BASIC, QBASIC or even DOS .bat files{I once saw a poker game written in noting but DOS batch commands} ) Our clients love thier sites. The search engines love our sites. No-one leaves our company thinking they got burned by thier developer. Again, I am not saying that validation is evil, but to say that I am somehow stealing from you and ruining your reputation is simply wrong. What I think is worse is some "web developer" charging who knows what to slap some content into a template (see templatemonster.com) and calling it a website. I've even seen a web-design firm put thier own site in a template. This, to me, is far worse than a functioning site that doesn't pass validation. Some poor consumer doesn't even realize that there are umpteen other sites out there that look exactly like his/hers. This devalues the custom designs that web designers offer along with the custom coding that we developers bring. <rant/>
×
×
  • 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.