[PHP] GD and Converting a Transparent PNG-8 to a Transparent GIF

2009-01-17 Thread Graham Anderson
Hi I am having problems getting GD to convert a transparent PNG-8 to a transparent GIF The below WILL produce a GIF...but leaves a white background # Convert the PreExisting PNG Image to a GIF $img = imagecreatefrompng($pngPath); # Set the GIF to be transparent: Does not seem to work $trans_

Re: [PHP] GD and Converting a Transparent PNG-8 to a Transparent GIF

2009-01-18 Thread Graham Anderson
the directory $gifDir imagegif($img, $gifAbsolutePath); imagedestroy($img); On Jan 18, 2009, at 4:46 PM, Jochem Maas wrote: Graham Anderson schreef: Hi I am having problems getting GD to convert a transparent PNG-8 to a transparent GIF The below WILL produce a GIF...but leaves a white backgrou

[PHP] ob_start("ob_gzhandler") producing garbage before document header

2009-01-18 Thread Graham Anderson
Hi, using ob_gzhandler produces a 5-8 characters, �“×2���, before the document header. Using ob_start() does not produce the text garbage. Is there a way to get ob_start("ob_gzhandler") to behave? Many thanks in advance Abridged Code: ob_start("ob_gzhandler"); //produces initial text ga

Re: [PHP] GD and Converting a Transparent PNG-8 to a Transparent GIF

2009-01-18 Thread Graham Anderson
I got it to work :) Like you had recommended, I found a script in http://php.net/imagecolortransparent from: fmkaiba at optonline dot net 07-Feb-2008 08:05. The function is called, createthumb Cheers Graham On Jan 18, 2009, at 4:46 PM, Jochem Maas wrote: Graham Anderson schreef: Hi I am

[PHP] Shiny Floor (web 2.0) effect with GD Library

2007-04-16 Thread Graham Anderson
Has anyone created that web 2.0 "shiny floor" effect with the GD Library? I have seen it dynamically created by passing variables into a Flash movie. Has this been done with GD? many thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.ph

Re: [PHP] Shiny Floor (web 2.0) effect with GD Library

2007-04-16 Thread Graham Anderson
Here is an example of a 'Shiny Floor' effect (dynamically generated with flash). http://alistapart.com/d/semanticflash/shiny/ look like the one in my kitchen or one of those old Java water effects? Personally, I prefer the Quicktime 'Fire' effect. As to the effect itself, I wanted to see i

Re: [PHP] Shiny Floor (web 2.0) effect with GD Library

2007-04-16 Thread Graham Anderson
Many Thanks :) That would be it. On Apr 16, 2007, at 10:25 AM, Richard Davey wrote: Graham Anderson wrote: Has anyone created that web 2.0 "shiny floor" effect with the GD Library? I have seen it dynamically created by passing variables into a Flash movie. Has this been do

[PHP] NetFlix Drag and Drop Row Ordering

2005-03-23 Thread Graham Anderson
For those who have netflix, does anyone know how you would recreate their 'drag and drop' queue widget? basically, you can drag and drop movies in the order you choose is this a combination of javascript and php ? how would you go about creating something like this to order rows in your own CMS

Re: [PHP] NetFlix Drag and Drop Row Ordering

2005-03-24 Thread Graham Anderson
JavaScript, if not search the internet for a while you'll find some examples. Best of luck. Nate Tobik (412)661-5700 x206 VigilantMinds -----Original Message- From: Graham Anderson [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 23, 2005 10:45 PM To: php-general@lists.php.net Subject: [

[PHP] Jpgraph and drop down menus examples

2005-03-31 Thread Graham Anderson
does anyone have or know of an example where: user chooses values from a couple of drop down boxes dateabase is queries and gives the values to jpgraph jpgraph draws the image on the same html page all the examples I have seen reload the whole page or go to a new page when jpgraph does its thing..

[PHP] php class that allow quick row ordering

2005-04-26 Thread Graham Anderson
hi lately, I'm finding myself reordering large amounts of rows populated from a database query ...with an order_id field this is a bit tedious re-entering every order_id for a found set :( Is there a php class out there that allows you to arbitrarily order rows in a found setgraphically ?

Re: [PHP] php class that allow quick row ordering

2005-04-26 Thread Graham Anderson
h these up/down buttons in each row start ordering away with wild abandon does this allready exist somewhere ? g On Apr 26, 2005, at 9:59 PM, Richard Lynch wrote: On Tue, April 26, 2005 7:05 pm, Graham Anderson said: lately, I'm finding myself reordering large amounts of rows populated

[PHP] Can I prevent Server variables from being spoofed ?

2005-05-20 Thread Graham Anderson
Can the server variable 'user agent' be modified/spoofed by the user? I have a bunch movies that I want to only open if the user agent contains Quicktime Player... In my case, if the user agent string contains Quicktime Player, a movie url is written for Quicktime to open If the user agent

Re: [PHP] Can I prevent Server variables from being spoofed ?

2005-05-20 Thread Graham Anderson
are there any php methods that can accurately determine who the client is ? mine is pretty basic...if I am a browser, then deny access g On May 20, 2005, at 1:15 PM, Chris Shiflett wrote: Graham Anderson wrote: Can the server variable 'user agent' be modified/spoofed by the user?

Re: [PHP] Can I prevent Server variables from being spoofed ?

2005-05-20 Thread Graham Anderson
is there another way to get reasonably accurate environment variables ? In my case,if movies are being opened in a browser...deny access g On May 20, 2005, at 12:35 PM, James E Hicks III wrote: Graham Anderson wrote: Can the server variable 'user agent' be modified/spoofed by

[PHP] Best Practices for calling 'setup' classes that extend 'parent' classes?

2007-08-20 Thread Graham Anderson
What is the best practice for correctly targeting 'include' paths when using Initialization/Setup classes that extend Parent classes? In my extend_parent_class.php file, I have to provide an incorrect relative path. Apparently, the path (that does work) is relative to php file that calls t

Re: [PHP] Best Practices for calling 'setup' classes that extend 'parent' classes?

2007-09-01 Thread Graham Anderson
ude statements. You will only make yourself miserable in the long run. On Mon, August 20, 2007 1:52 pm, Graham Anderson wrote: What is the best practice for correctly targeting 'include' paths when using Initialization/Setup classes that extend Parent classes? In my extend_parent_class.

[PHP] Preg_Replace $pattern syntax error

2008-06-09 Thread Graham Anderson
Hi How can I convert the regular expression:\s+(\d+)px;">(.*?) into a pattern that PHP will accept? I am getting the error: Warning: preg_replace() [function.preg-replace]: Unknown modifier '(' in /Library/WebServer/Documents/tamagotchi/runtime/content/js/tiny_mce/ examples/tinymce_regex

[PHP] Preg_Replace $pattern syntax error [solved]

2008-06-09 Thread Graham Anderson
I needed to add the ~ character as a delimiter. So, the below now works $pattern='~(.*?)~'; G Hi How can I convert the regular expression:left:\s+(\d+)px;">(.*?) into a pattern that PHP will accept? I am getting the error: Warning: preg_replace() [function.preg-replace]: Unknown modifier

[PHP] Anyone recommend a great phpmysql knowledge base?

2007-07-08 Thread Graham Anderson
Does anyone have a positive experience with an 'out of the box' Knowledge Base system (hopefully open-source) that easily allows developers to easily share/post/publish/document their code? I know this question is a a bit general, but I figure a lot of you guys are on such a system at work

[PHP] ADODB Insert Question (Syntax)

2007-08-07 Thread Graham Anderson
Hi What is the proper way to get the ADODB class to automatically add quotes to the below sql ? I'm guessing that the below fails because none of the variables get quoted with the method, qstr. $sql = "insert into email (to_name, to_email, from_name, from_email, subject, message, timestam

Re: [PHP] ADODB Insert Question (Syntax)

2007-08-09 Thread Graham Anderson
Wow. I feel really dumb. I thought (incorrectly) that the surrounding quotes would screw with the variables in the ADODB's INSERT statement. many thanks G On Aug 7, 2007, at 2:06 PM, Uber Wannabe wrote: -Original Message- From: Graham Anderson [mailto:[EMAIL PROTECTED]

[PHP] Is anyone using DBG Debugger on OS X ?

2006-07-10 Thread Graham Anderson
Has anyone successfully compiled/used DBG debugger with OS X and PHPEclipse ? I am getting pretty cryptic compile errors as I am not a unix guru. many thanks to the brighter folks who have been down this road. I have: OS X 10.4.7 PHP 5.1.4 www.entropy.ch Release 5 (Universal Binary) Ec

[PHP] Automagically using Pecl Filter for user input

2006-09-29 Thread Graham Anderson
How can I use PECL Filter to 'automagically' filter user input ? I DO understand calling the PECL filter directly in a PHP script like so: $clean['name'] = input_get(INPUT_POST, 'name', FL_REGEXP, array ('regexp' => '^[\w ]+$')); $clean['age'] = input_get(INPUT_POST, 'age', FL_INT); $c

[PHP] Compressing both php and linked css files with ob_gzhandler and htaccess

2006-11-13 Thread Graham Anderson
Can I compress a php file AND its referenced css files at the same time ? Currently, I am using ob_gzhandler to compress my php files only . Works great:) As I have found that you CAN NOT use ob_gz and zlib at the same time, how do I amend the htaccess file to use ob_gz, These files

Re: [PHP] Compressing both php and linked css files with ob_gzhandler and htaccess

2006-11-13 Thread Graham Anderson
yes :) I DID try that strangely, turning it off disables/kills the css file g On Nov 13, 2006, at 2:08 PM, Jochem Maas wrote: Graham Anderson wrote: Can I compress a php file AND its referenced css files at the same time ? Currently, I am using ob_gzhandler to compress my php files

Re: [PHP] Compressing both php and linked css files with ob_gzhandler and htaccess

2006-11-13 Thread Graham Anderson
Unfortunately, I am on a shared server for this project :( Is there some way to enable mod_deflate without admin server privs? many thanks On Nov 13, 2006, at 1:59 PM, steve wrote: Why use php to compress at all? Use mod_deflate. On 11/13/06, Graham Anderson <[EMAIL PROTECTED]> wrote

[PHP] Inserting header() info into ob_start

2006-11-14 Thread Graham Anderson
How can I insert header() info directly into the ob_start stream? I am compressing a css file with php before it is outputted to the browser, The below DOES work, but I have to insert the php header() info DIRECTLY into the css file. Otherwise, mystyle.css is interpreted as text/html inste

[PHP] Acceptably Converting a 24bit PNG to a JPEG?

2006-12-01 Thread Graham Anderson
Is there some trick to getting PHP GD to properly convert a 24bit PNG [with alpha] into a JPEG without garbling the image output? The below will output the jpg image, but it appears that the alpha channel from the original png is garbling the jpeg a bit To no avail, I tried setting imageAlph

Re: [PHP] Acceptably Converting a 24bit PNG to a JPEG?

2006-12-02 Thread Graham Anderson
_array[2] * 16) + $color_array[3]); $B = (($color_array[4] * 16) + $color_array[5]); return array($R,$G,$B); unset($color_array,$hex,$R,$G,$B); } ?> On Dec 2, 2006, at 1:33 PM, Richard Lynch wrote: I suspect that if you do an "imagecopyresampled" or somesuch into a fresh NEW image, you'd g

[PHP] Pass a relative path [with slashes] into a 'clean' url

2006-12-04 Thread Graham Anderson
What is a good/accepted way to pass a relative or absolute path into a clean url ? I could replace the relative url's slashes with another character, but would love to know a cleaner less confusing way...if it exists example url: http://localhost/testscript/../image.png/jpeg/42/0/ e

Re: [PHP] Pass a relative path [with slashes] into a 'clean' url

2006-12-05 Thread Graham Anderson
ike: $url = preg_replace("|/[^/]/\\.\\./|", "/", $url); On Mon, December 4, 2006 9:11 pm, Graham Anderson wrote: What is a good/accepted way to pass a relative or absolute path into a clean url ? I could replace the relative url's slashes with another character, but would love t

[PHP] Can PHP route Sendmail to a MYSQL DB ?

2006-05-08 Thread Graham Anderson
I need to specific emails to insert directly into a mysql database The server uses sendmail/php/mysql Essentially, all emails sent TO and FROM '[EMAIL PROTECTED]' are emailed normally and, then, inserted into the company_email database. Is there something out there that already does this...lik

Re: [PHP] Can PHP route Sendmail to a MYSQL DB ?

2006-05-08 Thread Graham Anderson
thanks :) I'll check it out g On May 8, 2006, at 11:02 AM, Richard Lynch wrote: On Mon, May 8, 2006 12:45 pm, Graham Anderson wrote: I need to specific emails to insert directly into a mysql database The server uses sendmail/php/mysql Essentially, all emails sent TO and FROM &#

[PHP] Parsing a stdClass Object created with mimeDecode

2006-05-11 Thread Graham Anderson
Hi I am trying to get the body text from a number of different emails using mimeDecode [Pear] Unfortunately, it appears that the body text could be in any number of locations in the stdClass Object depending on which email is processed. At this point, I can only access the node by looking a

[PHP] Debug/Learn Recursion of an Object

2006-05-18 Thread Graham Anderson
I am a bit new to Objects and Recursion Any push in the right direction is appreciated Generated from Pear's mimedecode, I have an object whose print_r is: http://www.siren.cc/dev/object.txt The function below will correctly traverse the object and find the 'correct' node. Unfortunately, it

Re: [PHP] Debug/Learn Recursion of an Object

2006-05-18 Thread Graham Anderson
I got it :) just put a print_r at each step of the function like: print_r($part->$parts); thanks g On May 18, 2006, at 11:59 AM, Robert Cummings wrote: On Thu, 2006-05-18 at 14:11, Graham Anderson wrote: I am a bit new to Objects and Recursion Any push in the right direction

[PHP] Syntax to call a class' methods in your own class

2006-05-24 Thread Graham Anderson
What is the correct syntax for calling methods from other classes into your own class ? Example: Calling the ADODB class with: $this->conn=&ADONewConnection('mysql'); This works: $rs= $this->conn->GetAll("SELECT title FROM content WHERE page_id= ?", $id); This fails: while (!$rs->$this->

Re: [PHP] Syntax to call a class' methods in your own class

2006-05-24 Thread Graham Anderson
thanks :) that helps g On May 24, 2006, at 3:19 PM, Brady Mitchell wrote: This works: $rs= $this->conn->GetAll("SELECT title FROM content WHERE page_id= ?", $id); You can't iterate through an array like you are trying to do. Using the GetAll() function returns an array, you have to use

[PHP] XML_Serializer and creating multi-level XML

2006-06-21 Thread Graham Anderson
How can you use XML_Serializer to generate XML with multiple levels ? XML_Serializer seems really useful for single level XML docs like:

[PHP] Pasting text from MS Word into PHPmyAdmin

2004-11-29 Thread Graham Anderson
I am copy/pasting text from a microsoft word doc into phpmyadmin are there any special tricks to avoid strange characters...most of my text is in Spanish The only thing that seems to work is converting the text to ASCII which ditches all the Spanish formatting :( is there some process to make thi

[PHP] Google like search engine with php

2004-12-05 Thread Graham Anderson
What is the proper way to build a dynamic subquery ? I want to allow the user to use AND, OR, and NOT in his/her query like $query = "Hola AND Adios, OR Goodbye, NOT hello" or.. WHERE (greeting LIKE %Hola% AND greeting LIKE %Adios%) OR (greeting LIKE %Goodbye%) AND (greeting NOT LIKE %hello%) I am

[PHP] drag and drop CMS made with php

2005-01-11 Thread Graham Anderson
is there a php based CMS that exists that allows you to drag/drop and reorder tracks ? something akin to itunes or winamp playlist... I want users to be able to the change 'order_id' field in the 'PlaylistItems' table...basically a bunch of UPDATE statements to a found set. Basically, the u

[PHP] use php to determine user OS

2005-01-15 Thread Graham Anderson
is there a php function out there that can get the operating system of the user...Mac/PC/Linux suppose I could do it with java, but wanted to see if I could do it all in php :) g -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] use php to determine user OS

2005-01-17 Thread Graham Anderson
thanks :) On Jan 16, 2005, at 6:05 PM, Greg Donald wrote: $_SERVER[ 'HTTP_USER_AGENT' ] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] $_SERVER['HTTP_USER_AGENT'] in html email

2005-01-18 Thread Graham Anderson
is it possible to use $_SERVER['HTTP_USER_AGENT'] in an html email ? something like: //What should we download based on user's platform ? if (strpos($_SERVER['HTTP_USER_AGENT'], 'Macintosh') !== FALSE) { $download = 'Fonovisa.dmg'; echo 'Mac'; } else { echo 'PC'; $download = '!Fonovisa.exe'; } --

Re: [PHP] $_SERVER['HTTP_USER_AGENT'] in html email

2005-01-18 Thread Graham Anderson
the download should be on the positive match, not the fall-through.] -- Original Message ------ From: Graham Anderson <[EMAIL PROTECTED]> To: " " Date: Tuesday, January 18, 2005 03:08:16 PM -0800 Subject: [PHP] $_SERVER['HTTP_USER_AGENT'] in html email is it

[PHP] handling spanish accents

2005-06-07 Thread Graham Anderson
is there some kind of accepted way to get Microsoft word text [in Spanish] into a mysql db is there some kind of standard str_replace function that works ? of late I have been hacking one together but did not want to reinvent the wheel many thanks g -- PHP General Mailing List (http://www.ph

[PHP] getting a filename [with no extension] out of a url

2005-06-30 Thread Graham Anderson
if $_SERVER['SCRIPT_NAME'] give this /folder/folder/Library/php/filename.php what would be the proper way to strip the string until only 'filename' is left I'm a bit new at eregi stuff any help would be appreciated many thanks g -- PHP General Mailing List (http://www.php.net/) To unsub

[PHP] Screen Scraping with php

2005-07-07 Thread Graham Anderson
I am trying to use php to pull an url out of an html page If I have an html page that is being 'fread' and the html source contains the below and, I want to get the image: http://image.com.com/gamespot/images/2005/132/ 914653_20050513_screen006.jpg class="spacer6"> src="http://image

Re: [PHP] Screen Scraping with php

2005-07-07 Thread Graham Anderson
thank Robert :) I ran the script and got: Warning: ereg(): REG_BADRPT on line 6 which is in the ereg function do you know what it could be ? will woodshed a bit on ereg g On Jul 7, 2005, at 6:51 PM, Robert Cummings wrote: $html = file( 'http://www.gamespot.com/pc/rpg/guildwars/screens.html?p

Re: [PHP] AJAX & PHP

2005-08-02 Thread Graham Anderson
Has anyone integrated JPGraph [or another php graph class] into a PHP/AJAX setup ? I would really like to integrate interactive graphs based upon user variables. Would be fantastic. Are there any examples out there ? g -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] AJAX & PHP

2005-08-03 Thread Graham Anderson
deep in the subject, so far I have not found resources. Thanks in advance!! -Original Message- From: Graham Anderson [mailto:[EMAIL PROTECTED] Sent: Martes, 02 de Agosto de 2005 01:46 p.m. To: php Subject: Re: [PHP] AJAX & PHP Has anyone integrated JPGraph [or another php graph c

Re: [PHP] AJAX & PHP

2005-08-03 Thread Graham Anderson
generated without a full page reload on the same page... kind of an interactive graphing web tool. any examples of this sort are appreciated :) g On Aug 3, 2005, at 9:36 AM, Mikey wrote: Graham Anderson wrote: not a whole lot of info on the subject for working with graph classes :( at

[PHP] Newbie: How to universalize a mysql=>xml script

2005-08-24 Thread Graham Anderson
Hi I am try to create a generic function that takes any mysql found set and creates and custom tiered xml list The below works but seems a bit kludgy :( Code synopsis: If we are are on a new row and the first value in that row , , is different...then do something Is there a cleaner and more

[PHP] Easier way to clean GET Variables ?

2005-08-24 Thread Graham Anderson
Is there a way to loop thru all of these GET requests by: putting the GET variables into an array processing the variable strings with trim/striptags/etc in a loop exploding the variables back out into separate variables otherwise this gets a bit tedious :( many thanks in advance g $userID =

Re: [PHP] Easier way to clean GET Variables ?

2005-08-25 Thread Graham Anderson
thanks guys :) that was exactly what I needed good karma to you g On Aug 25, 2005, at 6:19 AM, Robert Cummings wrote: On Thu, 2005-08-25 at 03:14, Richard Lynch wrote: On Wed, August 24, 2005 10:06 pm, Graham Anderson wrote: Is there a way to loop thru all of these GET requests by: putting

[PHP] Newbie: Safe function call to a .inc file outside the web folder

2005-08-25 Thread Graham Anderson
I am relatively new to security Is the below reasonable safe ? I have all of my main functions outside the web folder I am including this function with every php script that accesses fonovisa.inc function getBrain() { $temp = explode('.', $_SERVER['SERVER_NAME']); // returns 'www.myse

Re: [PHP] Newbie: Safe function call to a .inc file outside the web folder

2005-08-25 Thread Graham Anderson
27;) in /home/www/siren/siren/fonovisa/Library/php/genericTestv4.php on line 6 many thanks, Chris :) g On Aug 25, 2005, at 6:44 PM, Chris Shiflett wrote: Graham Anderson wrote: Is the below reasonable safe ? I have all of my main functions outside the web folder I am including this funct

[PHP] Making Text [not the background] transparent

2005-08-31 Thread Graham Anderson
How do I make the text transparent over the background ? In my web app, I want to to put a layer BEHIND the image to control the color of the php-created text So, the layer color in the web app shows thru the text php creates Would like to use alpha transparency so the color looks clean :)

[PHP] How to get GD to handle different image formats?

2005-09-03 Thread Graham Anderson
I would like the gd library to handle the vector image format, PCT. GD is installed on my shared server and, unfortunately, ImageMagick is not :( ImageMagick CAN export PCT files. Can I get GD to do this too ? g -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http:/

[PHP] Compositing 3 images at once with GD

2005-09-03 Thread Graham Anderson
is there a way to take 3 objects: button graphic picture thumbnail text from a POST and composit them together at the same time ? I guess I could take the first 2 elements: button graphic and the picture thumbnail...and then imagecopy it... and then take that composited image and overlay text

[PHP] Sending different languages to GD

2005-09-06 Thread Graham Anderson
How can I get Polish , iso-8859-2, text, to output properly ? PHP is reading the accent characters as blocks I tried this, but it did not work... // Set up text for a 'Polish' button $text = "rozwiązania"; $text = mb_convert_encoding($text, "iso-8859-2","Auto"); // Composit the text over a bu

[PHP] Sending different languages to GD

2005-09-06 Thread Graham Anderson
How can I get Polish , iso-8859-2, text, to output properly ? PHP is reading the accent characters as blocks I tried this, but it did not work... // Set up text for a 'Polish' button $text = "rozwiązania"; $text = mb_convert_encoding($text, "iso-8859-2","Auto"); // Composit the text over a bu

Re: [PHP] Sending different languages to GD [apologize for resend]

2005-09-06 Thread Graham Anderson
sorry about that -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Sending different languages to GD

2005-09-06 Thread Graham Anderson
o try would be to convert to UTF-8l mb_convert_encoding($text, 'UTF-8','iso-8859-2'); And, if that doesn't work. Ensure the font you're specifying can handle the characters you're giving it. (Arial Unicode would probably be a safe test font) hope this help

[PHP] How to output a PNG with GD with same headers as pre-existing PNG file

2005-09-15 Thread Graham Anderson
I am trying to get a PNG created with GD to output exactly as a pre-existing PNG file on the server I have an app that is being very finicky about how it is loading images :( Within Quicktime, If I point to the PNG file directly on the server, it works. this works: $image = isset($_GET['ima

[PHP] Problems with headers

2005-09-21 Thread Graham Anderson
I am trying to get headers to output properly Even though I am defining Content-type as 'video/quicktime' , the output is still text/html Also, Content-Length is not outputting properly either :( On the positive side, It appears to be outputting the $xml string correctly, but screws up o

Re: [PHP] Problems with headers

2005-09-21 Thread Graham Anderson
#x27;."\n"; $xml .= ''."\n"; $xml .= ''."\n"; $xml .= ''; header('Content-Type: video/quicktime'); //took out a space header ("Content-Length: ".strlen($xml)); // added a space echo $xml; ?> On Sep 21, 2005, at 7:25

Re: [PHP] Problems with headers

2005-09-21 Thread Graham Anderson
ormation - headers already sent by (output started at /home/www/siren/siren/fonovisa/skintest/Library/php/ fonovisa_simple.php:1) in /home/www/siren/siren/fonovisa/skintest/Library/php/ fonovisa_simple.php on line 12 On Sep 21, 2005, at 7:46 PM, Stephen Leaf wrote: On Wednesday 21 September 2005 09

Re: [PHP] Problems with headers

2005-09-22 Thread Graham Anderson
#0 know what it could be ? g On Sep 22, 2005, at 5:18 AM, Rasmus Lerdorf wrote: Graham Anderson wrote: '."\n"; $xml .= ''."\n"; $xml .= ''."\n"; $xml .= ''."\n"; $xml .= ''."\n"; $xml .=

Re: [PHP] Problems with headers

2005-09-22 Thread Graham Anderson
b y t e s " ) ; \n h e a d 400 e r ( " C o n t e n t - L e n 420 g t h : " . s t r l e n ( $ x 440 m l ) ) ; \n h e a d e r ( ' C o 460 n t

Re: [PHP] Problems with headers

2005-09-22 Thread Graham Anderson
thanks guys :) encoding in utf-8 NO BOM seems to do the trick g On Sep 22, 2005, at 11:05 AM, Jim Jagielski wrote: Set BBEdit to use Mac OS Roman. From the main window, choose the file icon (5th from left). Graham Anderson wrote: --Apple-Mail-15-928383921 Content-Transfer-Encoding

[PHP] Re: elegant way to convert relative to absolute urls

2005-09-22 Thread Graham Anderson
need to clarify :) I found the 'realpath' function I need to convert: ../../myfile.php to http://www.myserver.com/dir/myfile.php many thanks g On Sep 22, 2005, at 2:08 PM, Graham Anderson wrote: is there a simple function out there that converts relative urls like ../../

[PHP] elegant way to convert relative to absolute urls

2005-09-22 Thread Graham Anderson
is there a simple function out there that converts relative urls like ../../myfile.php to an absolute url ? g -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Posting variables from one php script to another

2005-09-22 Thread Graham Anderson
I am using GET to send variables from one php script to another php script How would I POST the same variables ? This is the php script I am sending GET variables to... $movieBuilder = "./movieBuilder.php?mask=mask.gif&drag=drag.gif&movie=fonovisa.mov"; I am placing $movieBuilder in the "src

Re: [PHP] Posting variables from one php script to another

2005-09-22 Thread Graham Anderson
ibute in the embed tag: //Generate the Quicktime movie $xml = << EOB; many thanks :) g On Sep 22, 2005, at 5:31 PM, Jasper Bryant-Greene wrote: Graham Anderson wrote: I am using GET to send variables from one php script to another php script How would I POST the same variables ?

Re: [PHP] Posting variables from one php script to another

2005-09-22 Thread Graham Anderson
5, at 6:52 PM, Jasper Bryant-Greene wrote: Graham Anderson wrote: In a POST request: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "./movieBuilder.php"); I think you may need to put the full URL here. I don't do a lot with CURL, though, so someone else may be able to he

Re: [PHP] Re: Posting variables from one php script to another

2005-09-23 Thread Graham Anderson
The below method is the way I send variables to the movieBuilder.php file [located in the 'src' attribute] with GET Variables It does work :) How would I use CURL to POST the same variables to the movieBuilder.php file WITHIN the 'src' attribute ? FYI, I am able to POST to the movieBuilder.

[PHP] how to encrypt a readfile($file) on the fly ?

2005-09-23 Thread Graham Anderson
is it possible to encypt a file dynamically as it is being readfile'd ? I want to create a key stored in a db that decrypts the file once it reaches the user's computer. This file is being progressively loaded...loads and plays at the same time something like: header("ETag: ".md5(time())); he

Re: [PHP] Re: Posting variables from one php script to another

2005-09-23 Thread Graham Anderson
; Would the movieBuilder.php file retain the POST'ed variables ? Or, would they be lost in the void. maybe this approach is silly? g On Sep 23, 2005, at 1:25 PM, Jasper Bryant-Greene wrote: Graham Anderson wrote: The below method is the way I send variables to the movieBuilder.php f

[PHP] how to stream a movie file with fread

2005-09-23 Thread Graham Anderson
I am trying to stream a movie file with 'fread' this my first step in trying to dynamically encrypt the file as it is being streamed from the server do I need to fread the data in chunks? If so, how? $filename ="$path2file"; $file = fopen($filename,'r'); $fileSize = filesize($filename); $Conte

Re: [PHP] how to stream a movie file with fread [success] Now, how to do a fast encrypt ?

2005-09-23 Thread Graham Anderson
what I want :) I want to write a data handler on the user side that connects to a db and gets the $find and $replace keys to unlock the movie many thanks in advance...and yes, I am experimenting On Sep 23, 2005, at 4:07 PM, Graham Anderson wrote: I am trying to stream a movie file with '

[PHP] How to Looking at Raw Binary Data with PHP and curl

2005-09-24 Thread Graham Anderson
How do you display raw binary data of a file sent from a server with curl ? When I curl a movie file with curl -l -i "path2file/file.php",I get the below output in my Terminal. file.php: $find = array($find1,$find2,$find3,$find4); $replace = array($replace1,$replace2,$replace3,$replace4)

Re: [PHP] How to Looking at Raw Binary Data with PHP and curl

2005-09-24 Thread Graham Anderson
ecoded, MCRYPT_MODE_ECB, $iv); return $decrypted; many thanks g On Sep 24, 2005, at 2:25 PM, Jasper Bryant-Greene wrote: Graham Anderson wrote: How do you display raw binary data of a file sent from a server with curl ? You can probably just use file_get_contents() if allow_url_fopen

[PHP] decrypting query string back into $_GET['var']

2005-09-29 Thread Graham Anderson
What is the best way to decrypt a query string back into variables ? $root = "http://www.myserver.com/script.php";; $queryString = "?test=mytest&color=red"; myEncrypt($queryString); //add mCrypt encryption $finalURL = $root.$encryptedQueryString; what is the proper what to decrypt the GET v

Re: [PHP] decrypting query string back into $_GET['var']

2005-09-29 Thread Graham Anderson
thanks :) that was exactly what I needed g On Sep 29, 2005, at 9:33 AM, Jochem Maas wrote: Graham Anderson wrote: What is the best way to decrypt a query string back into variables ? $root = "http://www.myserver.com/script.php";; $queryString = "?test=mytest&co

Re: [PHP] decrypting query string back into $_GET['var']

2005-09-30 Thread Graham Anderson
rypt function decrypt($decrypt) { global $key; $key = "6r9qEJg6"; $decoded = base64_decode($decrypt); $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND); $decrypted = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $decoded, MCRYPT_MODE_ECB, $iv); r

Re: [PHP] decrypting query string back into $_GET['var'] [resend]

2005-10-03 Thread Graham Anderson
rypt); return $encode; } // Decrypt function decrypt($decrypt) { global $key; $key = "6r9qEJg6"; $decoded = base64_decode($decrypt); $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND); $decrypted = mcrypt_decrypt(MCRYPT_RIJNDA

[PHP] Making MYSQL's RAND() more random

2005-10-03 Thread Graham Anderson
what would be the best way to make MYSQL's RAND() more random ? my random result set always seems pretty predictable. The first record in the result set always seems to be the same 4 tracks :( Would adding some kind of random seed like RAND($randomNumberGenerator) work ? If so, how do you imp

[PHP] Can't compare a decrypted variable to a string ?

2005-10-13 Thread Graham Anderson
For some reason, I have to store a decrypted string as a variable before I can compare it to another string. The decrypt function is located in another php script //Get variable $cmd = $_REQUEST['cmd']; echo $cmd; // uJy4p09z6bSR80eLNFnBWBj/EsRCfIz2C/WrcFNcZE8= echo decrypt($cmd);// mak

Re: [PHP] Can't compare a decrypted variable to a string ?

2005-10-13 Thread Graham Anderson
many thanks :) I'll try this g On Oct 13, 2005, at 10:27 AM, Jochem Maas wrote: Graham Anderson wrote: For some reason, I have to store a decrypted string as a variable before I can compare it to another string. The decrypt function is located in another php script //Get variable

[PHP] prevent user from getting scripts outside the web folder

2005-10-13 Thread Graham Anderson
How does a hacker get access to your scripts located outside the web folder? I asked a friend to hack my php script within the web folder... all of my crucial function were called by: require_once("/home/siren/includes/fonovisa.inc"); the 'encrypt' functions are MCRYPT_RIJNDAEL_256 He was abl

Re: [PHP] prevent user from getting scripts outside the web folder

2005-10-13 Thread Graham Anderson
2005-10-13 at 17:05, Graham Anderson wrote: How does a hacker get access to your scripts located outside the web folder? I asked a friend to hack my php script within the web folder... Ummm, the obvious thing to do is ask your friend how he did it, then we'll tell you how to prevent it in

Re: [PHP] prevent user from getting scripts outside the web folder [this better?]

2005-10-13 Thread Graham Anderson
leanser script: function cleanser( $value ) { return mysql_real_escape_string( trim( $value ) ) ; } the 'decrypt' function uses MCRYPT_RIJNDAEL_256 with a $key stored outside the web folder. many thanks :) g On Oct 13, 2005, at 2:36 PM, Graham Anderson wrote: Ok, I just he

Re: [PHP] prevent user from getting scripts outside the web folder

2005-10-14 Thread Graham Anderson
the array of movies*/$movieArray); break; case 'getmovie': // if the 'REQUEST variable, 'path' , exists: $path = isset($_REQUEST['path']) ? cleanser($_REQUEST ['path']): $path="null&q

[PHP] Offseting Binary File Data with php

2005-10-14 Thread Graham Anderson
I need to figure out a way to iterate through a binary file and offset values between two address by a fixed number //--- Why ? I am attempting to add file data to a pre-existing Quicktime file In the Quicktime file format, the 'stco' atom stores the location of all the track dat

Re: [PHP] prevent user from getting scripts outside the web folder

2005-10-15 Thread Graham Anderson
rgetting to lock the front door g On Oct 15, 2005, at 3:04 AM, Chris Shiflett wrote: Graham Anderson wrote: my htaccess file for the folder containing the php script was not set properly What does that mean? Are you telling us that /home/siren/includes/ is within document root? If it'

[PHP] How to protect a php script that sends variables to itself

2005-10-24 Thread Graham Anderson
the below is the curl'd output of the php script: curl -l -i "http://www.myserver/scripts/makeMoviePlaylist.php"; Content-Length: 263 Content-Type: video/quicktime /* } Problem: if the users does this: curl -l -i "http://www.myserver/scripts/makeMoviePlaylist.php? cmd=makesmil" From

Re: [PHP] How to protect a php script that sends variables to itself

2005-10-24 Thread Graham Anderson
actually all sarcasm is appreciated ;) at least, I got a laugh. I am learning/experimenting with ways to add DRM to movies. Why: My script, makeMoviePlaylist.php, is calling the script, brain.php, to build the movies to send to QuickTime I wanted to prevent the user from directly accessing this

  1   2   >