Re: [PHP] File Downloads

2010-05-28 Thread Marc Guay
How can I go about restricting the number of downloads of a file on my server? Something like this could be triggered every time and then you can do whatever you want once it hits 150... maybe have it send you an email notification or something... http://www.stevedawson.com/article0007.php --

Re: [PHP] Creating image on-the-fly

2010-07-07 Thread Marc Guay
I was wondering if there was any way I can create an image from some text with php? Something like this? http://sgss.me/obsolete/experiments/phpfontimagegenerator2/usage.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] State and City Database

2010-07-07 Thread Marc Guay
Does anyone have a source for a US State and City database? This is a monster but seems to contain what you need: http://www.geonames.org/. Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Simple XML - problem with errors

2010-07-08 Thread Marc Guay
libxml_use_internal_errors(true); $this-xml = new SimpleXMLElement($this-htmlString); Hi Gary, I have code that looks like this: libxml_use_internal_errors(true); $xml = simplexml_load_string($val); $errors = libxml_get_errors(); if ($errors) do this else do that which works

Re: [PHP] Simple XML - problem with errors

2010-07-08 Thread Marc Guay
I wonder what the difference is between doing new SimpleXMLElement and calling simplexml_load_string which results in the libxml_use_internal_errors call being ineffective. Odd. The documentation for Dealing with XML errors only mentions simplexml_load_string() and this comment

Re: [PHP] Simple XML - problem with errors

2010-07-08 Thread Marc Guay
And yes, I'd rather use DOM, but I can't. Could you use this: http://simplehtmldom.sourceforge.net/? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Arrays passed to functions lose their indexing - how to maintain?

2010-07-09 Thread Marc Guay
Hi folks, I have an array that looks a little something like this: Array ( [6] = 43.712608, -79.360092 [7] = 43.674088, -79.388557 [8] = 43.674088, -79.388557 [9] = 43.704666, -79.397873 [10] = 43.674393, -79.372147 ) but after I pass it to a function, it loses it's indexing and becomes: Array

Re: [PHP] Arrays passed to functions lose their indexing - how to maintain?

2010-07-09 Thread Marc Guay
My bad, I had some leftover code running array_values() on it before it got passed. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] PHP database interface layer

2010-07-22 Thread Marc Guay
Hi everyone, I've built a fairly large normalized database schema for a project. This is fun for me as I like thinking about how everything is interconnected. Foreign keys are all set up, many-to-many tables are go, etc, and so on. But now it's time to create an interface between that database

Re: [PHP] PHP database interface layer

2010-07-22 Thread Marc Guay
i recommend propel http://www.propelorm.org/ This looks hopeful. I'd checked it out before but for some reason lumped it in with all of the other half-baked tools that didn't do what I wanted, but even that basic example seems to cover most of what I want. Thanks for the suggestions. Marc

Re: [PHP] PHP database interface layer

2010-07-22 Thread Marc Guay
i recommend propel http://www.propelorm.org/ Holy Moses that thing is a monster. It requires installing extra libraries (Phing) in order to create an XML schema reverse-engineered from my existing database. The code looks simple enough but that installation is brutal. Any other suggestions?

Re: [PHP] PHP database interface layer

2010-07-22 Thread Marc Guay
Let me repeat myself: did you have a look at Doctrine2? Hi Peter, I didn't mean to ignore your suggestion, I just got extremely overwealmed by the Doctrine website and didn't even have a response. I get the impression that, like Zend and others, learning how to install and use that would take

[PHP] Protecting PHP scripts called via AJAX from evil

2010-08-06 Thread Marc Guay
Hi folks, I'm looking for a straightforward way to protect PHP files which are called via AJAX from being called from outside my application. Currently, someone could forseeably open the console and watch the javascript post variables to a public file (actions/delete_thing.php) and then use this

Re: [PHP] Protecting PHP scripts called via AJAX from evil

2010-08-06 Thread Marc Guay
Thanks everyone. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Snoopy port using PHP cURL library

2010-08-09 Thread Marc Guay
Does anyone know if the Snoopy class has been ported to use the built-in PHP cURL library and released publicly somewhere? Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Snoopy port using PHP cURL library

2010-08-09 Thread Marc Guay
Does anyone know if the Snoopy class has been ported to use the built-in PHP cURL library and released publicly somewhere? I converted it myself. If anyone's interested the class is attached. Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Can't read $_POST array

2010-08-18 Thread Marc Guay
$response = print_r($_REQUEST, true); echo $response; I'm sorry I don't have any input on your actual question but tohuhgt I'd mention that this can be shortened to: print_r($_REQUEST); ... if I'm not mistaken. Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] possible issue with quotes (Magicquotes feature)?

2010-08-19 Thread Marc Guay
I would chalk this up to that fancy, extra-curly, apostrophe that you get when copying and pasting text from Microsoft Word or similar. Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] two questions on serverside validation

2010-08-25 Thread Marc Guay
function html($text) {        return htmlentities($text, ENT_QUOTES, 'UTF-8'); } function htmlout($text) {        return html($text); } Possibly irrelevant, and definitely not related to your questions, but is it just me or is htmlout() a useless function? Why not just call html()

Re: [PHP] a test (list is too quite)

2010-09-04 Thread Marc Guay
Can I make a facebook site using PHP? If yes, how? Please send me the infos privately. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Show text without converting to html

2010-09-09 Thread Marc Guay
Which was created by the code, but I apparently can't seem to echo it and get it to display like above.. It converts it to html no matter what I do. Have you tried the pre HTML tag? (http://www.w3schools.com/TAGS/tag_pre.asp) Putting inside a textarea might also work for you... -- Marc Guay

Re: [PHP] 1984 (Big Brother)

2010-09-13 Thread Marc Guay
if steve's idea is something doable.. why don't you consider setting up the mysql data dir on some removable media (thumb/flash drive)? It seems to me that almost no matter what method you choose, you're going to have to ask the client to do something manually - whether that's logging out of

Re: [PHP] 1984 (Big Brother)

2010-09-15 Thread Marc Guay
if(file_exists('boss_man_say_okay') ){ // let monkeys work } Is there an acronym for the sound of sad, knowing laughter? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] if/elseif being treated as if/if

2010-09-24 Thread Marc Guay
if(1 == 1){ echo 'here'; } elseif(1 == 1){ echo 'here'; } Will only echo here once. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHPExcel with large files (27,000+ rows)

2010-10-04 Thread Marc Guay
I use this: http://code.google.com/p/php-csv-parser/ No idea if it's any better than your current solution. I presume you've tried extending PHP's memory limit? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Execute a php page and don't wait for it to finish

2010-10-19 Thread Marc Guay
A simple AJAX script would do the trick, no? Or does the script which was triggered by JS get aborted if that page is unloaded? If javascript is unavailable you could trigger it through the img tag like so: img width='0' height='0' src=updater.php alt= / Again, not sure if it will keep running

Re: [PHP] Reminder On Mailing List Rules

2010-10-21 Thread Marc Guay
Toilet seat. Up or down. Same thing? Sort of. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Character encoding hell

2010-10-26 Thread Marc Guay
Hi folks, I've got a problem with character encoding that's threatening to kill my little brain. Here we go: I have a directory with a bunch of PDFs in it that my webpage displays links to. All of the files have the french character  in them. The operating system is Linux (I did not

Re: [PHP] Character encoding hell

2010-10-26 Thread Marc Guay
Are you using UTF-8? Could you be more specific? Do you mean in the browser/php header or in the filesystem? I created the file on a Windows machine, transferred them to a Linux machine, and the encoding of the page is UTF-8. I just noticed a strange thing which might shed some light. If I

Re: [PHP] Character encoding hell

2010-10-26 Thread Marc Guay
 If I am understanding correctly, you are referring to a HTML specific issue where the HTML and browser configuration is displaying your characters improperly? No, the browser is displaying the characters of the filename fine (using htmlentities converts the ? unknown character into an Â.

Re: [PHP] Character encoding hell

2010-10-26 Thread Marc Guay
Again, if it helps, a link formatted in the same way to the same file links correctly on a windows machine. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Character encoding hell

2010-10-26 Thread Marc Guay
A windows server, or windows client to the same Linux server? I believe that this issue is starting to get a bit over my head, with the different operating systems involved and such. Windows server. This is over my head, too. I'm guessing that Windows and Linux encode filenames differently

Re: [PHP] Character encoding hell

2010-10-26 Thread Marc Guay
Have you tried using the utf8 meta tag rather than using the htmlentities() function? That should solve the first issue, as I reckon the problem lies with the way your encoding the filename. The page is being encoded in UTF-8. Without htmlentities() the special character is displayed as a

Re: [PHP] Character encoding hell

2010-10-26 Thread Marc Guay
I think one way to do this is something like this (untested): This is a good idea, but I'm stubborn and believe it can be solved without adding more code. Thanks, though, I'll probably end up using it once I've ruined every other possibility. Marc -- PHP General Mailing List

Re: [PHP] Character encoding hell

2010-10-26 Thread Marc Guay
Where is the filename coming from? Is it hard-coded in the script or is your script reading it from a directory listing? The filename is being read from the file via scandir(). File created on Windows, transferred to *nix. Have you checked to see if that filename is what you think it is on

Re: [PHP] Character encoding hell

2010-10-26 Thread Marc Guay
You say that in putty it is converted to a '?'?  so, on linux, the file name is no longer what you intended it to be, so wouldn't you then need to call the file EXACTLY as it is on the linux server? I thought this too at first, but if I run htmlentites() on the filename it displays the Â

Re: [PHP] Character encoding hell

2010-10-27 Thread Marc Guay
Have you tried using the utf8 meta tag rather than using the htmlentities() function? That should solve the first issue, as I reckon the problem lies with the way your encoding the filename. It seems that the filenames are ISO encoded as if I set the meta tag to ISO and remove the

Re: [PHP] Updating a GET variable

2010-11-11 Thread Marc Guay
So all you need to do, is take a look at $_SERVER['HTTP_ACCEPT_LANGUAGE'] to get a users language preferences. Hi Nathan, Yep, I'm using this var to set the default but I think it's nice to allow the user to override it. Maybe someone using their computer is more comfortable in a different

Re: [PHP] Updating a GET variable

2010-11-17 Thread Marc Guay
A bit late in the thread.  However, IMO, I don't think session is necessary, unless you intend to save it for later use, during that same visit from the user.  If it's just a 1 time request, you can just use (example) $_GET['lang']=en,de,fr,... Then just split up individual languages, process

Re: [PHP] Updating a GET variable

2010-11-17 Thread Marc Guay
Nathan previously mention what if instead of a language specific request, you have request for multiple languages. I get it now, multiple _simultaneous_ languages. Cheers, Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP shows nothing

2010-11-30 Thread Marc Guay
       if(!$db = @pg_connect($connection_string)) {                return FALSE;        }        return $db; how can I find the problem and fix it? The @ symbol is telling it to ignore errors. Remove it and you'll see them if that's where the problem is.

Re: [PHP] $_POST issues

2010-12-01 Thread Marc Guay
?php    var_dump($_POST); ? Where exactly are you putting this line? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] $_POST issues

2010-12-01 Thread Marc Guay
The function http_build_query() is turning your $_POST array into a query string ($_GET), so the answer to this really depends where you're trying to dump the array. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] $_POST issues

2010-12-01 Thread Marc Guay
This thread is a really good example of how difficult it can be to both explain and understand a problem. The original poster might want to restate the question from scratch with a more explicit and complete example. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] query strings and other delights

2011-01-13 Thread Marc Guay
Give parse_str() a go. http://ca.php.net/manual/en/function.parse-str.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] which php file is sending emails?

2011-01-16 Thread Marc Guay
There can be nothing more simpler than this!!! I thought that this quote needed some revisiting. Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] switch case madness

2011-01-19 Thread Marc Guay
Imagine when there'll be the day when you do not have to code at all...just copy 'n paste snippets together in the order that you wish them to work in and Voila'! - instant web app. I have a Wordpress plugin that will do all of that for you. -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] Re: email address syntax checker

2011-01-21 Thread Marc Guay
In fact I'm wondering why the OP doesn't just do what every other site seems to do - accept the registering user's input as valid, and ask them to validate it by sending them an email address to that address. It still makes sense to validate the format of the address as soon as possible. The

Re: [PHP] String Encodings - loose guidelines

2011-01-25 Thread Marc Guay
1.) Saving strings to a database One thing I always forget to remember is to send tge SET NAMES utf8 command to MySQL after making a connection. This will save you 1000 headaches if you're working with non-latin characters. I can't count the number of times I've thrown htmlentities,

Re: [PHP] Counting Online users, but not using a Session Table in MySQL

2011-01-28 Thread Marc Guay
I'm looking for a faster way to count online users. COUNT(*) is time consuming under MySQL. If COUNTing is the heavy part, why not create a 'users_logged_in' field somewhere and increment it when someone logs in and decrement it when someone logs out? Then your query is just a straight

Re: [PHP] How to write code: how wrong am I?

2011-02-22 Thread Marc Guay
It's an interesting idea (a different take on coding best practices) but I find the PHP example to be laborious and time consuming with little benefit. If I'm typing an IF statement, I hope to god I know what the condition is before I start typing it. Creating the if/else structure first and

[PHP] Does requesting $_SERVER variables need to query the server

2011-02-23 Thread Marc Guay
This question will probably reveal my lacking knowledge of the fundamentals, but I'm a go for it anyway: When you use a $_SERVER variable, is a query made to the server to get the information or is it just sitting in a variable all ready to go? Reworded, is there any efficiency gained by storing

Re: [PHP] Does requesting $_SERVER variables need to query the server

2011-02-23 Thread Marc Guay
   $_SERVER is just a prepopulated superglobal array that is created at runtime. Thanks for the clear answer. Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Does requesting $_SERVER variables need to query the server

2011-02-23 Thread Marc Guay
so when you're using $_SERVER variables there's no call back to the server, as the code is still being run on the server at that point. This is something I actually do understand. I was wondering if the code running on the server had to query the server for the information every time a

Re: [PHP] Overriding session length in existing session?

2011-03-04 Thread Marc Guay
This is called globally in *all* my scripts. In another script I'd really like to set the session to expire after the browser closes if a uses clicks public terminal or something. Howdy. Don't sessions expire when the browser closes as a rule? Do you mean the session cookie? Why not store

Re: [PHP] Overriding session length in existing session?

2011-03-04 Thread Marc Guay
I think that my suggestion is still a valid solution, someone correct me if I'm wrong. Let's say your code went like this: session_start(); // Check to see if the session variable has already been set, if not if (!isset($_SESSION['var'])){ // Check to see if it's been stored in a

Re: [PHP] Overriding session length in existing session?

2011-03-05 Thread Marc Guay
The statement should be at the start of every php file that has php code in it. Hi Tedd, Normally I'd agree with this but having never used the function session_set_cookie_params() before, I looked it up, and the manual says to put it before session_start(). Set cookie parameters defined in

[PHP] Help translating PHP5 code to PHP4.

2011-03-07 Thread Marc Guay
Hi folks, I've stumbled into a project involving a server running PHP4 without cURL. The script fetches data from an XML webservice and deals with it. Is http://ca2.php.net/xml_parser_create the place to start? Any tips (besides updating PHP)? Here's an example of the PHP5 code: $url =

Re: [PHP] Help translating PHP5 code to PHP4.

2011-03-07 Thread Marc Guay
Hi Richard, It's not a SOAP service, and I've actually decided to have ask the client to upgrade their server software before continuing. But for the sake of study: Depending upon your requirement, you could use simplexml_load_string() to convert an XML string into a native PHP object

Re: [PHP] Overriding session length in existing session?

2011-03-08 Thread Marc Guay
Hi Scott, I'm glad you resolved your problem. I'm curious about your method though, as it seems to be an entirely different approach to my own. How do you refer to your session data throughout the rest of the site? Do you always reference the $_COOKIE variables or do you utilise $_SESSION's at

Re: [PHP] Help translating PHP5 code to PHP4.

2011-03-09 Thread Marc Guay
The ease I had in running multiple versions of PHP on Windows would suggest it should be pretty easy to do for non-windows. Funny and true. Thanks for the tips Richard, I've suggested that they upgrade their hosting package. Marc -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Deleting elements from the middle of an array

2011-03-14 Thread Marc Guay
I've given a simplified example. The actual target array is multi-dimensional. Your questioni sn't entirely clear but there's lot of chatter about multidimensional arrays on the array_values() page that might provide a solution. -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Closing tab in Firefox

2011-03-15 Thread Marc Guay
Quick googling came up with this: http://www.yournewdesigner.com/css-experiments/javascript-window-close-firefox.html Maybe try the JS mailing list if that doesn't take you down the right road. PHP can't manipulate the browser. Marc -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Deleting elements from the middle of an array

2011-03-16 Thread Marc Guay
I copied this thread to some co-workers with the subject line Be glad that you're not programmers. Is it Friday yet? Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] the best 1 book for php

2011-04-07 Thread Marc Guay
session_start(); // genesis // do stuff session_destroy(); // revelation -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Flattery will get you nowhere

2011-04-27 Thread Marc Guay
I just googled up php tedd form validation and can't find a single reference. What does this mean, that I respect tedd's skills or that he needs better SEO? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Flattery will get you nowhere

2011-04-28 Thread Marc Guay
What are you are looking for? I'm working on a new form and after reading a few threads on this list since I've subscribed I realized that validating input is a weakness of mine. I figured you would have an example online somewhere covered some of the main security concerns. Marc -- PHP

Re: [PHP] Re: Flattery will get you nowhere

2011-04-30 Thread Marc Guay
 Dinna know bats even _had_ eyelids They increase the effectiveness of evil spells by 50%, especially when coupled with Frogs Tears (tm). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] mysql problems

2011-05-11 Thread Marc Guay
Does anyone have any ideas? Sounds like it's getting caught in a loop. Post the whole script for best results. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Explode Question

2011-05-17 Thread Marc Guay
$one = array(0 ='golf', 1 = 'field'); $two = array(0 = On the golf course or in the field of clover); $array_exp = explode($one, $two); What's the desired result? array('golf' = On the golf course or in the field of clover, 'field' = On the golf course or in the field of clover)); ? Marc

[PHP] Warning: Cannot modify header information - headers already sent by - classic

2011-05-19 Thread Marc Guay
Hi folks, I'm running some code locally which should produce this fun error we all know and love: Warning: Cannot modify header information - headers already sent by... but does not. Switching from 5.3 to 5.2 reveals the error and running it on another server with 5.2 also shows the error. I

Re: [PHP] Warning: Cannot modify header information - headers already sent by - classic

2011-05-19 Thread Marc Guay
Thank you Balint but if you read my message I have a good understanding of what causes this error. My confusion is why it is not being thrown in this partciular instance. Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Warning: Cannot modify header information - headers already sent by - classic

2011-05-19 Thread Marc Guay
   See if output_buffering and output_handler are set the same in your php.ini and/or phpinfo() output between working and non-working versions. Thanks Daniel. With output_buffering On the error was not displayed and the re-location fired, while Off caused it to display the error and continue

Re: [PHP] Warning: Cannot modify header information - headers alreadysent by - classic

2011-05-20 Thread Marc Guay
To everyone who did not read my original message but responded to it, Thank you. Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] PHP Brainteasers 2011

2011-05-20 Thread Marc Guay
I imagine this one's been done before, but maybe not in the same way ?php $result = succeed(); while (!$result){ try{ $result = succeed(); } catch (Exception $e){

Re: [PHP] phpsadness

2011-06-03 Thread Marc Guay
Unsubscribe! Unsubscribe! Unsubscribe! Can I detonate() the future of this thread before it goes where it's about to go? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] phpsadness

2011-06-03 Thread Marc Guay
What's PHP? I thought this was the top-posting-etiquette-discussion-and-simmering-race-war group. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Ftp upload

2011-06-14 Thread Marc Guay
I bought a 1GB external hard drive for $1000. Did I just choke on my lunch? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Ftp upload

2011-06-15 Thread Marc Guay
If that was about 20 years ago, then it would be fine! Would have been around 1992, good guesswork! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Serveside Printing w/ PHP

2011-07-12 Thread Marc Guay
Hi folks, I'm working on a project that will only be run locally on a WAMP server. A mobile browser/app will call a certain page which should silently trigger a print job to a printer connected to the printer. Does anyone have advice on how to accomplish this? I've seen implementations

[PHP] Re: Serveside Printing w/ PHP

2011-07-12 Thread Marc Guay
Bonus feature: The server is running Windows 7. I suspect the crickets are going to win this one. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Serveside Printing w/ PHP

2011-07-12 Thread Marc Guay
Take a look at http://www.php.net/printer -- this might be what you're looking for. Hi Ken, Thanks for trying but I've been down that road and from my understanding that PECL extension is really out of date and unsupported (the page that hosts it doesn't even have a downloadable DLL). Also

Re: [PHP] Re: Serveside Printing w/ PHP

2011-07-13 Thread Marc Guay
What type of file are you trying to print? HTML. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Serveside Printing w/ PHP

2011-07-13 Thread Marc Guay
What type of file are you trying to print?  I'm not very familiar with Microsoft Windows but I know a little about it.  Have you considered Windows Powershell?  Unfortunately you would essentially have to write a powershell script and use the PHP exec functions.  Windows 7 shipped with

Re: [PHP] Re: Serveside Printing w/ PHP

2011-07-13 Thread Marc Guay
What type of file are you trying to print?  I'm not very familiar with Microsoft Windows but I know a little about it.  Have you considered Windows Powershell?  Unfortunately you would essentially have to write a powershell script and use the PHP exec functions.  Windows 7 shipped with

Re: [PHP] Serveside Printing w/ PHP

2011-07-14 Thread Marc Guay
4 - And just found it. WordPad comes with Windows, so, maybe PHP+COM+WordPad (http://msdn.microsoft.com/en-us/library/51y8h3tk(v=vs.80).aspx) could be another option here. I think WordPad is just a visual wrapper for the RichEdit20 ActiveX component which is controllable via COM. By using

Re: [PHP] Re: Repetitive answers . . .

2011-09-09 Thread Marc Guay
That low-hanging fruit is too hard for some to resist... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Querying a database for 50 users' information: 50 queries or a WHERE array?

2011-09-13 Thread Marc Guay
Another theoretical approach, given the grey areas, would be to add a field to your table to indicate these special users. I would call the field is_awesome and have it default to zero, because that's just the way it is. Then you can make your query SELECT * FROM users WHERE is_awesome=1. This

Re: [PHP] htmlentities

2011-09-13 Thread Marc Guay
You could store the accented characters in your DB if you set everything to UTF-8, including calling the SET NAMES utf8 MySQL command after connecting. I find this much easier than encoding/decoding. Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Sort problem

2011-09-14 Thread Marc Guay
Anyone know a smart way to order file names? Nope, but I know a natural way: http://ca.php.net/manual/en/function.natsort.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Sort problem

2011-09-15 Thread Marc Guay
use natsort. For the repetitive answers specialists: Is it possible that 15 hours later someone is still only seeing the original question? Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Generate CMS based on database schema

2011-09-30 Thread Marc Guay
Howdy, I'm looking for a FOSS equivalent to PHPMaker, or at least something which comes close to it. For those who don't know the program, it syncs with your database and allows you to generate an entire CMS system based on it. To be clear, I am not looking for a CRUD code generator, I'm

Re: [PHP] Generate CMS based on database schema

2011-09-30 Thread Marc Guay
Hi Ashley, That's an interesting looking project, but wouldn't it require me to switch to CodeIgniter? I'm not interested in changing my entire working method for this. Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Generate CMS based on database schema

2011-09-30 Thread Marc Guay
I assumed that as you'd mentioned trying Drupal that you would be OK with trying out various PHP-based solutions? True enough. Maybe I'll sharpen the focus then and ask if anyone knows of a solution that does not require a reworking of method; a stand-alone CMS generator similar to PHPMaker

[PHP] Variable variable using constant

2011-10-12 Thread Marc Guay
Hi folks, Let's say that I have 2 constants DEFINE('DESKTOP_URL_en', http://www.website.com/index.php?page=home;); DEFINE('DESKTOP_URL_fr', http://www.website.com/index.php?page=accueil;); and I would like to populate the value of an href with them depending on the

Re: [PHP] Variable variable using constant

2011-10-12 Thread Marc Guay
  $var = constant('DESKTOP_URL_' . $_SESSION['lang']); Very nice, thank you. Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Friday Distraction

2011-10-21 Thread Marc Guay
Is it just me or does it not work unless you agree to the extra information sharing stuff? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Novice question

2011-10-30 Thread Marc Guay
I want to write a script that requests a URL and then reads that website .. I'm interested to map web structures. My web host is saying I'll need URL file access enabled but that it's a) a security risk and b) deprecated. simplehtmldom is pretty great for this, if I understand your needs

[PHP] Passing arguments to an internal function via array_map

2011-11-10 Thread Marc Guay
Hi folks, I'm trying to convert the contents of an array from utf8 to utf16 (thanks for the headache MS Excel!). I originally created a user function that just ran the text through mb_convert_encoding($text,'utf-16','utf-8') but now I'm wondering if I can't just use the internal function

Re: [PHP] Passing arguments to an internal function via array_map

2011-11-10 Thread Marc Guay
You need to pass a second and third array to array_map() with the same number of elements as the first array. The arguments to the callback function are the elements from each array at the same offset. Wow, thanks for the clarification. I've decided to create my own function and use that

  1   2   >