Re: [PHP] framework or not

2013-10-24 Thread Marc Guay
> I'm looking forward to the day that I'll know everything and can stop all 
> this learning nonsense.


Sounds like the attitude most people take when they sit down to a
keyboard.  (Ref: http://xkcd.com/386/)

Off-topic is the new on-topic
Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Algorithm Help

2013-10-02 Thread Marc Guay
If you have the technology handy, it could also just be easier to wipe
the children's memories after each stay.

Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Dependency Injector

2013-09-05 Thread Marc Guay
> Thanks Sorin, I will do that and I will have more care the next time.

You have no reason to apologize.  You shared a project you made by
yourself, way to go.

Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP vs JAVA

2013-08-20 Thread Marc Guay
Here are two references from the Wikipedia article on Java in case you
haven't looked at them already.

http://www.langpop.com/
http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

On 20 August 2013 10:43, Tedd Sperling  wrote:
> On Aug 20, 2013, at 10:36 AM, "Liam"  wrote:
>> You do realise you are on a PHP based user subscription, so the vast
>> majority will go with PHP, so you will get a one sided argument.
>>
>> Regards,
>> Liam
>
>
> I realize that many, maybe the majority, will be bias. HOWEVER -- there are 
> professionals on this list that do know and it is to them I am asking. 
> Remember, I am also asking for supporting documentation of their view. The 
> people who respond with just their opinion are doing just that -- there is no 
> support.
>
> My nature is to seek the truth regardless of my bias.
>
> Cheers,
>
> tedd
>
>
> ___
> tedd sperling
> t...@sperling.com
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Finally....

2013-08-16 Thread Marc Guay
Those Belgacom emails were the only thing keeping me from a crushing
loneliness - undo!


On 16 August 2013 11:51, Matijn Woudt  wrote:
> On Fri, Aug 16, 2013 at 5:23 PM, Daniel Brown  wrote:
>
>> # ezmlm-list ~ezmlm/php-general | grep skynet
>> supp...@skynet.be
>>
>> # ezmlm-unsub ~ezmlm/php-general supp...@skynet.be
>>
>> # ezmlm-list ~ezmlm/php-general | grep skynet
>> #
>>
>> No more of those "Your e-mail concerning our products and
>> services" autoreplies from the Belgacom Webteam.  Sorry it took me
>> this long to realize it and get around to it.
>>
>> Happy Friday.
>>
>> Daniel,
>
> Thank you, thank you, thank you ;)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] A Strange Problem

2013-06-20 Thread Marc Guay
Never used it but searching turned up
http://php.net/manual/en/function.chdir.php
Marc


On 20 June 2013 12:57, Tedd Sperling  wrote:
> On Jun 20, 2013, at 1:44 PM, Bastien  wrote:
>>
>> It sounds like a current working directory issue. Try running a getcwd() in 
>> both places to see how they are set
>>
>> Bastien
>
> I think you have something, here's the reports:
>
> Works:
>
> /home/content/64//html/sdi/tedd/php-mail
>
> Does NOT work:
>
> /home/content/64//html/sdi
>
> The one that does not work should be:
>
>/home/content/64//html/sdi/includes/
>
> How do I fix it?
>
> Cheers,
>
> tedd
>
> PS: All 's were identical.
>
>
> _
> t...@sperling.com
> http://sperling.com
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] LightBox click detection

2013-06-14 Thread Marc Guay
Also, the docs and functionality for that particular plugin seem a bit
weak.  Maybe there's another one that has a "doneLoadingLightbox"
event that you could hook into and call your ajax script inside of...


On 14 June 2013 10:02, Marc Guay  wrote:
> $('.lightbox-image-class').click(function(){
> $.post('ajax.php', {click: true});
> });
>
> and do your DB work in ajax.php
>
> http://api.jquery.com/jQuery.post/
>
> On 14 June 2013 09:52, Tedd Sperling  wrote:
>> Hi gang:
>>
>> It's Friday so I am allowed to ask odd questions.
>>
>> Here's the problem --  I need to count the number of times a user activates 
>> a LightBox -- how do you do that?
>>
>> Here's a LightBox Example:
>>
>>http://www.webbytedd.com/c2/lightbox/
>>
>> All the javascript is there (jQuery et al).
>>
>> Ideally, I would like to have a php/javascript combination that would:
>>
>> 1. Detect when a user clicked the LightBox;
>> 2. Pass that value to PHP so I can keep count.
>>
>> Any ideas?
>>
>> Cheers,
>>
>> tedd
>>
>> _
>> t...@sperling.com
>> http://sperling.com
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] LightBox click detection

2013-06-14 Thread Marc Guay
$('.lightbox-image-class').click(function(){
$.post('ajax.php', {click: true});
});

and do your DB work in ajax.php

http://api.jquery.com/jQuery.post/

On 14 June 2013 09:52, Tedd Sperling  wrote:
> Hi gang:
>
> It's Friday so I am allowed to ask odd questions.
>
> Here's the problem --  I need to count the number of times a user activates a 
> LightBox -- how do you do that?
>
> Here's a LightBox Example:
>
>http://www.webbytedd.com/c2/lightbox/
>
> All the javascript is there (jQuery et al).
>
> Ideally, I would like to have a php/javascript combination that would:
>
> 1. Detect when a user clicked the LightBox;
> 2. Pass that value to PHP so I can keep count.
>
> Any ideas?
>
> Cheers,
>
> tedd
>
> _
> t...@sperling.com
> http://sperling.com
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Detect and Redirect Mobile Users

2013-06-14 Thread Marc Guay
http://www.answershat.com/questions/352/How-to-get-rid-of-spam-mail-in-my-mailbox

On 14 June 2013 09:28, Chirag Vekariya  wrote:
> Hi,
> Post your question to http://answershat.com
>
> On Thu, Jun 13, 2013 at 4:49 AM, dealTek  wrote:
>
>> Hi all,
>>
>> I'm curious of a simple, common, universal way to detect a mobile user so
>> I can redirect them to a mobile directory...
>>
>> What is best for this: Javascript - CSS - PHP?
>>
>> I think for my purposes if I can detect screen size or mobile browser
>> agent - that would be good enough for what I need right now.
>>
>> Thanks in advance - Dave
>>
>>
>> --
>> Thanks,
>> Dave - DealTek
>> deal...@gmail.com
>> [db-3]
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>
> --
> *Thanks & Regards,
> Chirag Vekariya.
> +91-87582 45922*

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] include() Error

2013-05-29 Thread Marc Guay
Is the "echo $mySQL_user;" inside of a function?  I believe you'll
need to say "global $mySQL_user;" to gain access to it if so.


On 29 May 2013 12:39, Ron Piggott  wrote:
>
> Good morning all:
>
> I have recently purchased a computer and am using it as a dedicated server.  
> A friend helped me install PHP and configure.  I am saying this because I 
> wonder if using a newer version of PHP (compared to my commercial web host) 
> may be the reasoning behind the error I am receiving.
>
> I created a function to generate a form submission key.
> - This created hidden variable for forms
> - This is also session variable
>
> With this function I have an ‘ include ‘ for the file containing the mySQL 
> database, username and password.  I know this file is being accessed because 
> I added:
>
> ===
> echo $mySQL_user;
> ===
>
> following the login credentials.
>
> But when I remove this line from mySQL_user_login.inc.php and place within 
> the function on the line following the include the "echo” returns nothing.
>
> ===
> include("mySQL_user_login.inc.php");
>
> echo $mySQL_user;
> ===
>
> Can any of you tell me why this is happening?
>
> Ron Piggott
>
>
>
> www.TheVerseOfTheDay.info

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] REQUEST

2013-05-29 Thread Marc Guay
Does anyone else find it strange that the movie Troll only has 2 stars
on IMDB?  I think it's worth at least CAPSLOCK.


On 29 May 2013 11:45, Tommy Pham  wrote:
> On Wed, May 29, 2013 at 9:30 AM, Stuart Dallas  wrote:
>
>> On 29 May 2013, at 17:26, Last Hacker Always onpoint <
>> lasthack...@gmail.com> wrote:
>>
>> > HEY GUYZ I KNOW, I KNOW THIS IS NOT A PLACE FOR SOMETHING LIKE THIS SO
>> BUT
>> > HEY I HAVE A LITTLE TINY QUESTION FOR MY COOL GUYZ.
>> >
>> > DOES ANYONE HERE USE A SIMPLY MACHINE FUNCTION SCRIPT? BECAUSE THE
>> > SCRIPTINGS ARE A LITTLE HARD FOR ME TO UNDERSTAND PLEASE LET ME KNOW
>> GUYS I
>> > WANT SOMEONE TO TEACH ME.
>>
>> 1) Shouting at us will not encourage a helpful attitude.
>>
>> 2) Neither will calling us your "cool guyz."
>>
>> 3) What is "a simply machine function script?"
>>
>
> 4) http://www.catb.org/esr/faqs/smart-questions.html
>
>
>>
>> If you want someone to teach you PHP you'll probably need to pony up some
>> cash. If you want someone to help you while you're learning, show us that
>> you're working on it and we'll be happy to help.
>>
>> -Stuart
>>
>> --
>> Stuart Dallas
>> 3ft9 Ltd
>> http://3ft9.com/
>> --
>>
>>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Accessing Files Outside the Web Root

2013-03-14 Thread Marc Guay
> correlate various types of information, which is very hard. For a human,
> this is very simple. It's simple, and very friendly to your guests.

Assuming humans will continue to behave as I've seen them behave so
far, even this "simple" system will guarantee you angry emails from
people who'll want to argue that "five" is a colour in some
circumstances.  Please see discussions on this list about top-posting
as a reference.

TGIAF
Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: FW: [PHP] Accessing Files Outside the Web Root

2013-03-13 Thread Marc Guay
> Have you tried keeping all of your documents in one directory and blocking
> that directory via a robots.txt file?

These don't sound like robots that would respect a txt file to me.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Testing

2013-03-08 Thread Marc Guay
> This is my first time using a list. Can anyone confirm I'm doing this 
> correctly?

N!  You broke it!

Happy Friday,
Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Stripping accents from characters as they pass through a stream and then written to file

2013-01-14 Thread Marc Guay
And the answer is that it's a locale issue...

http://stackoverflow.com/questions/7931853/why-does-phps-iconv-need-setlocale

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Fwd: [PHP] Boolean type forced on string assignment inside if statement

2013-01-03 Thread Marc Guay
I received the message below addressed only to me, but I believe the
group could benefit.  It looks like the single pipe is a bitwise
operator so you will get an integer as a result (and probably other
weird things to discover when using it on non-numbers).

http://php.net/manual/en/language.operators.bitwise.php


-- Forwarded message --
From: Volmar Machado 
Date: 3 January 2013 12:42
Subject: Re: [PHP] Boolean type forced on string assignment inside if statement
To: Marc Guay 


My results in a simple test:

'); //1
 echo ('($a || $b))' . ($a || $b) . ''); //1
 echo ('($b | $a)' . ($b | $a) . ''); //1
 echo ('($b || $a)' . ($b || $a) . ''); //1
 echo ('($a | $a)'. ($a | $a) . ''); //1
 echo ('($a || $a)' . ($a || $a) . ''); //1
 echo ('($b | $b)' . ($b | $b) . ''); //0
 echo ('($b || $b)' . ($b || $b) . ''); //false(outputs nothing)
?>

2013/1/3 Marc Guay :
>> Now, I am not sure as to where that would mean anything. Can anyone provide 
>> an example where using a single pipe would produce different results than 
>> using a double pipe?
>
> If PHP had "Eager operators" (thanks Wikipedia), then your first
> example would have different output
>
> if (($a = 'foo') | ($b = 'bar'))
> {
> echo "$a  $b";
> }
> else
> {
> echo 'Neither are populated';
> }
>
> Would spit out:
> foo
> bar
>
> rather than just
> foo
>
> No?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Boolean type forced on string assignment inside if statement

2013-01-03 Thread Marc Guay
Hi Tedd,

A little searching enlightened me to the fact that in other languages,
a single | or & operator will cancel the short-circuiting so all of
the evaluations are done before proceeding.  However, they don't seem
to exist in PHP so in your example it behaves the same as ||...?

http://php.net/manual/en/language.operators.logical.php

Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Boolean type forced on string assignment inside if statement

2013-01-03 Thread Marc Guay
> First, did the original poster realize that he was assigning a value to the
> variable $a in the 'if' statement?

Hello,

Yes, I did, and if you read my responses you can see that I came to
the realisations you describe.  I don't think that anyone suggested
there was a bug.


> $a is true (ie it is not set to a 'false' value,
> whatever PHP uses for false) and $b is "bar" because that is what it is set
> to.  Since the evaluation is within a bracket, the interior values ($a, $b)
> are set BEFORE the if condition is evaluated.

Regarding this I'm a bit confused.  In the case of an OR operator, $b
is not "bar" because it follows the "true" path as you said earlier.
Probably just a glitch in the English language.  I'll file a bug for
that.

Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Recommendation request: Use Magento or build my own eCommerce?

2012-10-22 Thread Marc Guay
Use Magento.  It will take you more than 6 months to build what you're
talking about all by yourself.  Magento is a pain to learn at first
but once you get into it things start to make sense and development
speeds up.

Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Programmers and developers needed

2012-09-13 Thread Marc Guay
I'll do it, but only if it's on "paid on delivery" and/or subsidized
by African royalty.

Are our comments still welcome?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Find match of string if only at end of string

2012-07-11 Thread Marc Guay
Answered it myself (funny how writing out a problem as descriptively
as possible makes the brain work better).

$end_of_url = substr("http://domain.com/about/page/subpage/";,
strlen("/about/page/") * -1);
$same_post = ($end_of_url == "/about/page/");

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Find match of string if only at end of string

2012-07-11 Thread Marc Guay
Hi folks,

I'm trying to compare two strings in order to determine whether or not
the site is just switching languages on the same page or whether the
link is pointing to an entirely different page.  Things were fine
until I realized I was getting false positives for subpages, where the
URLs matched.

Previous code example:

if (strpos('http://domain.com/fr/about/page/', '/about/page/') > -1){
$same_page = true;
}

As you can see this logic is not strong enough to deal with:

if (strpos(http://domain.com/about/page/subpage/', '/about/page/') > -1){
$same_page = true;
}

As it is not the same page.  I've looked into strrpos() and tried to
use the negative offset as the length of the needle, but unfortunately
it searches backwards from the offset and not forwards.  Any ideas?

Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Unexpected Notice message

2012-07-04 Thread Marc Guay
> Notice: Use of undefined constant QUERY_STRING - assumed 'QUERY_STRING' in

I would guess that it's asking you to add quotes around QUERY_STRING...?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] What's happened to our newsgroup?

2012-06-29 Thread Marc Guay
> You mean everyone finally RTFM?

There's a manual?  GoDaddy told me to just ask all of my questions here!


(No insult meant, in case it's not obvious.)

Happy Fridays
Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] What's happened to our newsgroup?

2012-06-26 Thread Marc Guay
Everyone switched to PCP?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Searching IDE.

2012-06-13 Thread Marc Guay
I've used both Netbeans and Aptana w/ WinXP over the past few years
and of the two I would recommend Aptana.  Netbeans was crippling slow
and Aptana often gets it's workspace corrupted, which makes both of
them crappy (yet free!), but for day to day use when they're not
failing entirely, Aptana is a more efficient tool.

Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Email Antispam

2012-04-17 Thread Marc Guay
Is there a reason for you not to build a contact form?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] sms class

2012-04-17 Thread Marc Guay
Suspicion is my religion.  Let no thread end without a war.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] sms class

2012-04-17 Thread Marc Guay
Woah.  Is that good luck or bad luck?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Got HTML5 History API + caching LICKED, I think,

2012-03-23 Thread Marc Guay
Did I accidentally subscribe to the mediabeez website development
mailing list?  Hello?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Got HTML5 History API + caching LICKED, I think,

2012-03-16 Thread Marc Guay
Is this a "Fun Friday" trolling?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] iphone & php

2012-03-05 Thread Marc Guay
And if you change your input type to "date", because it's a date, does
that bring up the numeric keys as well?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Test

2012-02-20 Thread Marc Guay
> Does this work?

No?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] html_entity_decode is trying to kill me

2012-02-17 Thread Marc Guay
Ugh.  The problem is that the EvalMath class doesn't death with
comparisons between numbers, it only performs calculations.  Barking
up the wrong tree for 2 hours is fun on a Friday!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] html_entity_decode is trying to kill me

2012-02-17 Thread Marc Guay
It actually works for me as well if I run it in the browser.  The
structure of the app is a bit strange, though, so debugging character
encoding issues is quite difficult.  The code is being run by Code
Igniter in the backend and the response passed via JSON to a ExtJS 4
frontend, so what I'm looking at to debug is the server's response in
the browser console.  What I can say is that I decode the string and
pass it immediately afterwards to the EvalMath class that was
suggested earlier, it complains that there's illegal characters
"<", so obviously it's the server that isn't operating as
expected... but why?

PHP/5.3.2-1ubuntu4.14
Apache/2.2.14

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: html_entity_decode is trying to kill me

2012-02-17 Thread Marc Guay
This info might be helpful.  If I copy and paste the example from the
manual directly, it works as described:

$orig = "I'll \"walk\" the dog now";
$a = htmlentities($orig);
$b = html_entity_decode($a);
echo $a; // I'll "walk" the dog now
echo $b; // I'll "walk" the dog now

But if I modify $orig to include spaces like so

$orig = "I'll \"walk\" the < b >dog now";

the output is
I'll "walk" the < b >dog now
I'll "walk" the < b >dog now

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: html_entity_decode is trying to kill me

2012-02-17 Thread Marc Guay
Answering myself sort-of, I think I'm on the wrong track with
html_entity_decode().  Does an HTML "entity" refer to an HTML code
like  rather than the encoded format of characters?  It seems
like htmlspecialchars_decode() is actually what I'm looking for, but
I'm getting the same results with that.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] html_entity_decode is trying to kill me

2012-02-17 Thread Marc Guay
Hi,

So I decided to give one of those PHP math classes a go and have come
across a joyful character encoding problem.  He's the deal:

$rule = "1 < 2";
$rule = html_entity_decode($rule, ENT_QUOTES, 'UTF-8');
echo $rule;

And the result is still "1 < 2".  I've tried different combinations
of character encodings and quotings, to no avail.  Any ideas of where
I should look for the culprit?

Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] ASP to PHP

2012-02-17 Thread Marc Guay
> But has anybody had any experience of translating the asp code over?

I've gone the other way and translated some PHP to ASP, which felt
pretty dirty.  Are you dealing with simple includes and small bits of
logic?  That's all that I had (also fairly static sites) and I found
the process quite simple.

Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Turning a string into a condition

2012-02-17 Thread Marc Guay
Hi everyone,

Thanks for all the great ideas and links.

Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Turning a string into a condition

2012-02-16 Thread Marc Guay
> It shouldn't be that hard to parse this type of expressions.

I appreciate your concern, and will do my best to validate the input,
but there are two things:

1)  The application will only be used by selected users.
and
2)  The range of possibilities are broader than I indicated.  They
would like to be able to enter conditions of all sorts.  i.e.

($x / $y) > 0.5
(($a+$b+$c) / $d) < .75

etc.

If you have any suggestions on how to increase the security while
maintaning the flexibility, I'd be happy to hear it.

Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Turning a string into a condition

2012-02-16 Thread Marc Guay
> I just added the return statement and the semicolon, because the error was 
> complaining about it not being a proper PHP statement basically.

That's beautiful, thanks.  I just stumbled across a forum post that
said it wasn't possible and was about to give up for the day.

Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Turning a string into a condition

2012-02-16 Thread Marc Guay
> It sounds like you have a string "$x < $y" in the database that you then
> replace into a string "4 < 5" which you want to test a conditional on. If
> this is the case, why are you storing conditionals in the database?

The user will be able to construct their own query strings, it's
complicated but necessary.  The issue I'm dealing with, though, is
this:

$condition = "4 < 5";
if ($condition){
//do stuff
}

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Turning a string into a condition

2012-02-16 Thread Marc Guay
Hi folks,

I've constructed simple conditions based on DB data and would like to
actually evaluate them with PHP.  For example, the coded string "$x <
$y" has been str_replaced into "4 < 5", but now I would actually like
to use that string in an if() statement.  I tried eval() but got an
unhelpful error, any thoughts would be welcome.

Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Connect to Google

2012-02-16 Thread Marc Guay
Sort of off topic but here's a list of existing services (some of
which are free) in case you don't want to reinvent the wheel.

http://www.justfitstudio.com/articles/plagiarism-detection.html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Connect to Google

2012-02-16 Thread Marc Guay
This is the first time I've been surprised that a Drupal module
existed for something...

http://drupal.org/project/authenticate

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Connect to Google

2012-02-16 Thread Marc Guay
> If you use the advanced search
> tools you can choose "verbatim" and see if the exact phrase matches.

Just correcting myself here, the way to do this is by simply wrapping
the words in quotes "like this, hey now".  The verbatim tool is
something else.

Marc

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Connect to Google

2012-02-16 Thread Marc Guay
> I'm a teacher. I want to use PHP to interface with Google and see if a
> student has plagiarized.

Hi.  Why not just enter the suspected text into a search engine and
see if any close matches come up?  If you use the advanced search
tools you can choose "verbatim" and see if the exact phrase matches.
If that's not good enough, can you explain how you would like it to
function?  Would the whole paper be scanned phrase-by-phrase for
matches and then spit out a report?

Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] What is the mnemonic for date()'s Day format?

2012-02-13 Thread Marc Guay
How about "long" dayname?

I find it interesting that the character for "Day of the month without
leading zeros" is j, which makes sense to me as a half-Francophone who
sometimes calls days "jours".  Not that it helps me remember it, I
have to refer to that page pretty much every time I use date().

Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] is it possible to change the html title from the WYSIWYG editor?

2012-02-13 Thread Marc Guay
Based on the terms you're using it sounds like this is a Wordpress
question.  You'd have a lot better chances of getting an answer if you
query a group of WP gurus/geeks.

Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] sticky checkbox - strpos

2012-02-08 Thread Marc Guay
>> if (!strpos($t_product,$t_p)) {print "checked";}

It could have something to do with the function returning 0 because
it's finding the comma in the 0 index, but it's not really false, it's
still finding the string.  I've run into a similar problem before...

Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Headers on smart phone browsers

2012-02-07 Thread Marc Guay
> There is only one drawback to using CSS media queries to alter the way a
> page is displayed on different resolutions, and that is that any media
> (i.e. background images, etc) referenced in a stylesheet is downloaded,
> regardless of if it is ever used.

Another one worth mentionning is that a lot of mobile devices still in
use do not support media queries - their being a relatively recent
development.  Same goes for javascript, even if it claims to support
it.  Older Blackberrys claim JS support but fail miserably in real
life.

Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Headers on smart phone browsers

2012-02-06 Thread Marc Guay
> the way your site renders should be purely based upon the size of the display.

Although I mostly agree with this statement, it ignores the most
interesting aspects of mobile technology, such as being able to ask
the user for their GPS location and deliver content accordingly.  I
worked on some real estate websites that would show the user the
houses for sale within a certai distance from where they were
standing, and then leverage Google Maps for a "get directions from
where you are" feature.

The Mobile Web list has had some interesting discussions regarding this stuff...

http://groups.yahoo.com/group/mobile-web/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Headers on smart phone browsers

2012-02-06 Thread Marc Guay
> 1) Do smart phones use the same browsers as the desktop, or do they have
> their own stripped down versions of browsers?

Different browsers, some of which are worse than IE (see Blackberry).


> 2) When a browser broadcasts its header telling the server what kind of
> browser is involved, do they broadcast anything in the header to
> indicate that they're being run on a smart phone?

Nothing so specific or easy to identify as "i am a smartphone".
Depending on your target audience, simple regex checks for the strings
"iphone", "android", etc. can do the trick, but if you want specific
details about the device...


> 3) Bonus question: Is there a preferred method amongst coders to
> determine what type of environment is being browsed from, so as to serve
> up the proper type of page (desktop or smart phone version of a
> webpage)?

... the WURFL database and things akin to it or based on / stolen from
it can help parse the header string and return a plethora of
information about it (screen size, AJAX ability, markup capacity,
etc).

Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Variable Troubleshooting Code

2012-01-09 Thread Marc Guay
> some pretty natives php functions exists to do the job :

But how many times in my life will I have write echo ""; ???
Does anyone have a handy solution? (Make this the default behavior?
Add a "even more human-readable" flag to the function?  Create a
simple macro in Aptana 3?)

Argz,
Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PDF Printing instead?

2012-01-05 Thread Marc Guay
> Also try dompdf from digitaljunkies.ca. It allows you to pass an HTML doc to 
> the code to provide a PDF

I think in this case it should say "It doesn't work!".  :)

Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Unique items in an array

2011-12-21 Thread Marc Guay
Hi folks,

I just wanted to add a little something to this thread as I reworked
some of the code and came across an interesting tidbit.  I was trying
to merge many result sets which now had the table's primary key as the
array key, but found that when array_merge() was done, all of the
array's keys were lost, like so:

array(2) {
  [704]=>
  array(36) {
["contact_id"]=>
string(3) "704"
["contact_first_name"]=>
string(4) "Marc"
["contact_last_name"]=>
string(4) "Guay"
  }
  [705]=>
  array(36) {
["contact_id"]=>
string(3) "705"
["contact_first_name"]=>
string(4) "Marc"
["contact_last_name"]=>
string(5) "Guay2"
  }
}

array_merge with:

array(0) {
}

left me with:

array(2) {
  [0]=>
  array(36) {
["contact_id"]=>
string(3) "704"
["contact_first_name"]=>
string(4) "Marc"
["contact_last_name"]=>
string(4) "Guay"
  }
  [1]=>
  array(36) {
["contact_id"]=>
string(3) "705"
["contact_first_name"]=>
string(4) "Marc"
["contact_last_name"]=>
string(5) "Guay2"

  }
}

Pretty crummy.  Apparently what I wanted was as simple as:  $new_array
= $array1 + $array2, which I didn't even know was an option.  Thank
you php.net/manual.

Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Fwd: [PHP] dealing with this code $_POST['custom´]

2011-12-17 Thread Marc Guay
Just forwarding Carlos' response to the list...


-- Forwarded message --
From: Carlos Sura 
Date: 17 December 2011 01:15
Subject: Re: [PHP] dealing with this code $_POST['custom´]
To: Marc Guay 




On 16 December 2011 15:57, Marc Guay  wrote:
>
> > $saving_list = $_POST['custom'] == 'FR' ? 148 : 147;
>
> Hi there, here's a quick translatation of this code that might help
> you understand it better:
>
> if ($_POST['custom'] == 'FR'){
>  $saving_list = 148;
> }
> else{
>  $saving_list = 147;
> }



Hello,

Thank you both for answer me.

Also I would like to thank you Marc Guay, because with your answer I
figured out how to do it.

My code is like this:

//$saving_list = $_POST['custom'] == 'FR' ? 148 : 147;
  if ($_POST['custom'] == 'FR'){
                $saving_list = 148;
               }
  if ($_POST['custom'] == 'EN'){
                $saving_list = 147;
               }
 else{
 $saving_list = 152;
 }

I'm not sure if that's the best way, but it is working for me as I
expected, althought any other recommendation would be great.

Regards
--
Carlos Sura.-
www.carlossura.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] dealing with this code $_POST['custom´]

2011-12-16 Thread Marc Guay
> $saving_list = $_POST['custom'] == 'FR' ? 148 : 147;

Hi there, here's a quick translatation of this code that might help
you understand it better:

if ($_POST['custom'] == 'FR'){
  $saving_list = 148;
}
else{
  $saving_list = 147;
}

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Unique items in an array

2011-12-15 Thread Marc Guay
> Give it a try, should do what you are wanting.

Hi Jim,

I appreciate your dedication to this problem but it was solved 2 days ago!  :)

Thanks
Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Unique items in an array

2011-12-15 Thread Marc Guay
> Assuming you want to make things unique based on the "contact_first_name" 
> field,
> how would you decide which record to keep?  The first one you run in to, the
> last one you come across, or some other criteria?

The unique field is actually the contact_id.

Marc

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Preferred Syntax

2011-12-14 Thread Marc Guay
> BBEdit.  Is this just a preference choice or is one method better than the 
> other?

As far as I know it's just preference.  Your choice of editor could
influence your decision; one form might be given nicer highlighting.

Marc

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Unique items in an array

2011-12-13 Thread Marc Guay
> If the contact_id is the primary key, you could also use that as array
> index, which would automatically filter duplicates.

Thanks for this, it's so obvious I didn't see it.  I was adding items
to the array with $array[] = $contact when I could have just as easily
used $array[$contact['id']] = $contact;

Cheerios,
Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Unique items in an array

2011-12-13 Thread Marc Guay
Holy mother of multidimentionality there are a ton of suggested
solutions to this scenerio on the array_unique manual page..

http://php.net/manual/en/function.array-unique.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Unique items in an array

2011-12-13 Thread Marc Guay
Hi folks,

Let's say that I have the following array:

  [0]=>
  array(35) {
["contact_id"]=>
string(3) "356"
["contact_first_name"]=>
string(4) "Marc"
 }
  [1]=>
  array(35) {
["contact_id"]=>
string(3) "247"
["contact_first_name"]=>
string(4) "Marc"
  }
  [2]=>
  array(35) {
["contact_id"]=>
string(3) "356"
["contact_first_name"]=>
string(4) "Marc"
 }

And I would like to filter out exact duplicates, such as key 0 and key
2 in this example, leaving me with an array containing only unique
entries.  How would you go about it?

Thanks for any help,
Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] no regrets after doing this venture...

2011-11-17 Thread Marc Guay
> Hi Friend!I knew things couldnt get any worse I consider myself lucky 
> to have found this now im in this for the long run you should consider trying 
> it href="http://lacadenasport.es/profile/31AlanWalsh/";>http://lacadenasport.es/profile/31AlanWalsh/see
>  you.
>

This list is for PHP discussion, not HTML.

Snipe!

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Frivolous Friday Fun!

2011-11-11 Thread Marc Guay
>    "Our" does not automatically become all-inclusive, but rather
> suggests that the individual is part of a larger group.  Please watch
> your presumptions of being force-included into said group, as the
> statement is valid regardless of anyone's personal opinion.  ;-P

Crap, you're right.

My apologies to myself for including myself in a group I didn't want
to be a part of.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Frivolous Friday Fun!

2011-11-11 Thread Marc Guay
>     if(!myself->IsTrue())
>     {
>          delete myself;
>          _exit(-1);
>     }

I like this part...


> And on a serious note... To any Past, Present, Or Future service man (Or 
> woman) Thank you for your sacrifice in defending our ability to send out 
> these Frivolous Friday emails! :)

... but not so much this part.  *I* can send Frivolous Friday emails
in spite of war, not because of it; please watch your "our"s.

Marc

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Headers already sent

2011-11-11 Thread Marc Guay
> Thanks. That was the problem. I spent a day trying to debug this.

Smash head against wall first, ask questions later.  That's my
methodology as well.  :)

Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 instead both because I found that there is some
other cleaning to do to the string and that code you posted is way too
convoluted to read!  :)

Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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 directly.  Apparently it's more
complicated when the function requires arguments; I see example using
mysql_real_escape_string() on php.net.

My current attempt looks like this:

$clean = array_map('mb_convert_encoding', $dirty_arr, array('utf-16','utf-8'));

but I believe this is actually passing an array to
mb_convert_encoding() as the second argument rather than the 2nd and
3rd... Any ideas or am I chasing something that can't be done?

Marc

-- 
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
correctly... also not sure about it's server setting requirements, but
worth a look..


http://simplehtmldom.sourceforge.net/

-- 
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] 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



[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 user's language.  $_SESSION['lang'] is either 'en' or 'fr'.
How would I go about referring to this variable?

I have tried:

${'DESKTOP_URL_'.$_SESSION['lang']};
${DESKTOP_URL'.'_'.$_SESSION['lang']};
{DESKTOP_URL'.'_'.$_SESSION['lang']};
etc, to no avail.

If it is a regular variable I'm fine, it's the CONSTANT_FORMAT that
seems to be causing my brain some issues.

Thanks,
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 but FOSS...?

-- 
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
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



[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 looking for something that can generate the whole
shabang so I can get on with it.

Perhaps someone could sassily tell me why I don't need this tool or
propose another method, that would be good too.  I really enjoy
building sites up from the DB schema but hate creating web interfaces
for editing them.  I've also taken a stab at Drupal, which is like
doing it the other way around, using the CMS to create the schema, but
a lot of the time it seems ass backwards and I'm not in the mood to
get another hand cramp from clicking through the interface for 6 hours
setting everything up.

Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] [Friday] Tokyo / Kyoto.

2011-09-30 Thread Marc Guay
http://translate.google.com/#auto|ja|%20vanilla%20hotdogs

-- 
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



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] 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: 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 method might make the code a bit more
manageable as you could modify the users through a CMS rather than
updating a hardcoded array.

Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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] 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 templates, you could create appropriate files manually in
> WordPad and then just do a search/replace in PHP, load into RichEdit
> and print. Theoretically, a simple process.

This is the solution I'm working with except instead of WordPad I'm
using Internet Explorer and letting it parse the HTML and print.
Required a bit of fudging around with Apache permissions on the
server, probably giving it more power than it should, but for this
project it's a one-off local-only website so it shouldn't be a
problem.

I followed the first example in this article:
http://thefrozenfire.com/2011/02/using-the-windows-com-in-php/

Marc

-- 
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 PowerShell
>> 2.0.

It actually is starting to look like in order to print HTML using this
method I'd have to instantiate a COM object in the shell, which I
could just do directly with PHP's built-in COM stuff.

--
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 PowerShell
> 2.0.

Hi Wayne,

Thanks for this tip, I just printed a document from the PowerShell 2.0
command line; I think this might be the path to take.

Marc

--
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?

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-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 the PHP pages say "These functions are only available
under Windows 9.x, ME, NT4 and 2000." so I highly doubt I'll have any
luck with Windows 7, but you never know, maybe I should try...

Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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



[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 involving Crystal Reports which will be available on
the server, but perhaps someone has a solutions that won't involve 3rd
party software.

Marc

-- 
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



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] 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] 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



[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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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



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 loading the page.

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
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



[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 don't believe the version has anything to do with it,
but who knows.  I set error_reporting = E_ALL | E_STRICT and verified
that display_errors = On, still nothing.  Any ideas what could be
allowing a header('Location:'); call to redirect without throwing an
error after output has been sent to the browser?

Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



  1   2   >