Re: [PHP] want to learn about zend

2007-09-27 Thread Tijnema
On 9/27/07, Gonzalo PHPFan <[EMAIL PROTECTED]> wrote:
> hello people anyone know a good tutorial to learn the basics of zend, how it
> works and how to use?
>
> Regards,
> Gonzalo
>

Google: "Zend Basics"
First result: Understanding the Zend Framework, Part 1: The basics
www.ibm.com/developerworks/opensource/library/os-php-zend1

Tijnema


-- 
If this is a mailing list: DO NOT TOP POST! why?:
http://www.caliburn.nl/topposting.html

Vote for PHP Color Coding (aka Syntax Highlighting) in Gmail! ->
http://gpcc.tijnema.info

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



Re: [PHP] imagecreatefromgif fails for a valid image

2007-09-24 Thread Tijnema
On 9/24/07, thushw <[EMAIL PROTECTED]> wrote:
>
> I get a failure in creating a gif. php error log shows this:
>
> Sep 24 00:25:47 thushw-laptop apache2: PHP Warning:  imagecreatefromgif() [
> function.imagecreatefromgif function.imagecreatefromgif ]:
> '/home/thushw/mocha_src/LiveMocha/trunk/src/wwwroot/app/webroot/img/new/button-middle.gif'
> is not a valid GIF file in
> /home/thushw/mocha_src/LiveMocha/trunk/src/wwwroot/app/webroot/button.php on
> line 30
>
> the gif can be viewed by gthumb. it seems ok.
>
> the problem is only for some gifs. Most gifs, all pngs, jpegs that i've
> tested so far work.
>
> i'm running php5 on ubuntu (uname -a : Linux thushw-laptop 2.6.20.3-ubuntu1
> #2 SMP Sun Apr 15 11:26:58 PDT 2007 i686 GNU/Linux)
>
> phpinfo shows:
>
> gd
> GD Support  enabled
> GD Version  2.0 or higher
> FreeType Supportenabled
> FreeType Linkagewith freetype
> FreeType Version2.2.1
> T1Lib Support   enabled
> GIF Read Supportenabled
> GIF Create Support  enabled
> JPG Support enabled
> PNG Support enabled
> WBMP Supportenabled
>
> from what i've read so far, seems like i need gd lib >=2.0.28. from phpinfo
> output it is not clear if i have the right version. i use: apt-get install
> php5-gd to install gd
>
> these are the files i think are of importance:
>
> /usr/lib/libgd.so.2.0.34
> /usr/lib/libgd.so.2
>
> [the second is a symlink to the first]
>
> >> ls -l /usr/lib/libgd.so.2
> lrwxrwxrwx 1 root root 15 2007-09-24 00:25 /usr/lib/libgd.so.2 ->
> libgd.so.2.0.34
>
> how do i debug this further?  any help greatly appreciated. this problem
> doesn't appear with the gd we have installed on our centos servers. seems to
> happen only on my ubuntu install.
>
> thushara
>

Hello Thushara:

My guess is that your .gif file isn't actually a GIF image (but jpeg, bmp,...).

If you have access to SSH/command line try running
file 
/home/thushw/mocha_src/LiveMocha/trunk/src/wwwroot/app/webroot/img/new/button-middle.gif
and see if it's really a gif, if you don't have access to above, open
the image with any text editor, and see what the first 3 letters say..
If it's an GIF image, it says GIF (GIF89 probably)
if it's an JPEG image, it says something like ÿØÿà
if it's an BMP image, it says BM (BM6)
and if it's an PNG image, it says ‰PNG

I hope this helps you..

Tijnema

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



Re: [PHP] php Login script issue

2007-09-16 Thread Tijnema
On 9/16/07, Chris Carter <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> Its just a login and password validation that I am trying to achieve. If the
> username is correct then the person is able to view certain page, if
> incorrect then he is directed elsewhere.
>
>  $userid=mysql_real_escape_string($userid);

Here you call it $userid

> $password=mysql_real_escape_string($password);
>
> if($rec=mysql_fetch_array(mysql_query("SELECT * FROM tablename WHERE
> userName='$userName' AND password = '$password'"))){

and here you call it $userName. If this is the full code, $userName is
not set here, and it would result in query userName='' and mysql_query
will return FALSE, which isn't a valid mysql resource for
mysql_fetch_array.

>if(($rec['userName']==$userName)&&($rec['password']==$password)){
> include "../include/newsession.php";
>echo " Successfully,Logged in
> logout.php  Log OUT   welcome.php Click here if your browser is not
> redirecting automatically or you don't want to wait. ";
> print "";
>   print " self.location='submit-store-details.php';"; // Comment this
> line if you don't want to redirect
>  print "";
>
>}
>}
>else {
>
>session_unset();
> echo "Wrong Login. Use your correct  Userid and Password and Try
>  onClick='history.go(-1)'>";
>
>}
> ?>
>
> I am getting this error when I am using this code:
>
> Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
> resource in thispage.php on line 37
> Wrong Login. Use your correct Userid and Password and Try
>
> Why does it show up everytime and whats wrong with mysql_fetch_array().
>
> Please advice also if there is some other way available please help me try
> that.
>
> Thanks,
>
> Chris


I advice you to split the code up in 2 seperate actions, and check for errors.

> if($rec=mysql_fetch_array(mysql_query("SELECT * FROM tablename WHERE 
> userName='$userName' AND password = '$password'"))){

would become:
$result = mysql_query("SELECT * FROM tablename WHERE
userName='$userName' AND password = '$password'") or die
(mysql_error());
// You could also add some checks here with mysql_num_rows for example...
if($rec=mysql_fetch_array($result)){

Tijnema


-- 
If this is a mailing list: DO NOT TOP POST! why?:
http://www.caliburn.nl/topposting.html

Vote for PHP Color Coding (aka Syntax Highlighting) in Gmail! ->
http://gpcc.tijnema.info

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



Re: [PHP] php5: capital "I" letters in func/class method names do not work with turkish locale in php5

2007-09-06 Thread Tijnema
On 9/6/07, Roman Neumüller <[EMAIL PROTECTED]> wrote:
> I'm a german web-designer living in Turkey.
> Sometimes I use opensource software like gallery2 or WP to have customers
> have some
> nice web albums or blog. The turkish translation files of such opensource
> software
> usually use gettext and .po files for i18n and are always a bit behind the
> translation
> status of other european languages.
>
> I decided to work a bit on some of those tr.po files on my local linux box
> (opensuse 10.2 with apache 2.x mysql 5.x and php 5.2.0). But when I
> started the
> test phase in turkish I couldn't test because of strange errors.
> I contacted the forum of gallery2 and after investigating the problem I
> stumbled over an answer of bug #35050 at bugs.php.net:
>
>   http://bugs.php.net/bug.php?id=35050
>
> and its status: WONT FIX
>
> Now that's really great. It means that turkish hosting providers cannot
> use php5 at all!
> And as of the news on php.net php4 will not be supported or developed any
> further
> after the end of 2007! Will Turks really have now to wait for a php6?
> When will that come out?
> That's seems to me to be a sort of discrimination of turkish language in
> php5.
> Is it technical so difficult to develop a patch for this bug?
>
> Sincerely
>

Well, only 1 hour later than your email, there has been posted a patch
on the bug page that fixes it.

Tijnema


-- 
If this is a mailing list: DO NOT TOP POST! why?:
http://www.caliburn.nl/topposting.html

Vote for PHP Color Coding (aka Syntax Highlighting) in Gmail! ->
http://gpcc.tijnema.info

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



Re: [PHP] is this a bug?

2007-08-20 Thread Tijnema
On 8/20/07, aflavio <[EMAIL PROTECTED]> wrote:
>
> Strange..
>
> I'm return a include..

Not exactly... you're returning the return value of an include.

Take this:
var.php:

foo.php

> the file will be included in the scope of the class? Because this i cant use 
> the variables declared in the file ? all declared in the file only can be 
> access from the method that i use to include the class file.
>
> example:
>

>
>
> Am i right?
>
> thanks
>
> ps.: Sorry by the english.
>
> Augusto Morais
>
Well, you're quite close, but you expect something different from the
return... Like I said above.

Tijnema

ps. I don't really care about your english, but top posting is
annoying. Read the site in my signature to know why. Also snipping
irrelevant parts of the original message is important.

pps. Make sure you use the "Reply to all" button when making a reply
to the list, as for now, I was the only one who got your message. If
you don't have a "Reply to all" button, make sure you put the php list
in the to or cc address.

-- 
If this is a mailing list: DO NOT TOP POST! why?:
http://www.caliburn.nl/topposting.html

Vote for PHP Color Coding (aka Syntax Highlighting) in Gmail! ->
http://gpcc.tijnema.info

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



Re: [PHP] is this a bug?

2007-08-20 Thread Tijnema
On 8/20/07, Augusto Morais <[EMAIL PROTECTED]> wrote:
> I dont know what is happening...
>
>
> Can somebody clarify the situation for me?
>
>
> here is the situation:
>
>   i have 3 files:
>
> class.php
> foo.php
> bar.php
>
> // - class.php
> class globalactions {
>
>  function include_file($module) {
>if ($module) {
>return 
> ("modules/".$module."/templates/".$module.".php");
>} else { return include("modules/main/templates/index.php"); }
>  }
> }
>
>
> // - foo.php
> include "lib/clients.class.php";
> $clients = new clients(); //instatiating the clients class
>
>
> // - bar.php
> include 'class.php';
> $globalactions = new globalactions ();
> include $globalactions->include_file("foo");  //return ->
> "modules/foo/templates/foo.php"
>
> var_dump($clients); //will return the object
>
>
>
> OK. All this works. but i want make some changes.
>
> Well.. What i want to do is this:
>
> class.php:
>
> change the line:
> return ("modules/".$module."/templates/".$module.".php");
>
> to:
> return include ("modules/".$module."/templates/".$module.".php");
>
> and in the bar.php:
>
>
> // - bar.php
> include 'class.php';
> $globalactions = new globalactions ();
> $globalactions->include_file("foo");  //return -> "include
> modules/foo/templates/foo.php"  // OK. This works.
>
> var_dump($clients); //i dont get the object here. I got NULL!!! why?!?!!?
>
>
>
> What is happening?
>

This is because in the second example, you're including the file in a
different scope than the first example. The file included (and so all
variables etc. declared in it) will be added to the scope where the
include is.

This manual page should help you:
http://www.php.net/manual/en/language.variables.scope.php

Tijnema
-- 
If this is a mailing list: DO NOT TOP POST! why?:
http://www.caliburn.nl/topposting.html

Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] php 5 and ms sql server express won't play nice !

2007-08-17 Thread Tijnema
On 8/16/07, Gregory Machin <[EMAIL PROTECTED]> wrote:
> Hi
> I have tried most of the configuration options in the php manual /
> examples http://www.php.net/function.mssql-connect  and I just can't
> get it to connect
> I'm running WAMP5 and have enables php_mssql.dll extentions etc ..
> sql server 2005 express has both named pipes and tcp/ip conections enabled,
> both are installed on the same machine (xp pro)...
>
> this it the error I keep getting
> Warning: mssql_connect() [function.mssql-connect]: Unable to connect
> to server: SQLEXPRESS in C:\wamp\www\test\test.php on line 8
> Couldn't connect to SQL Server on SQLEXPRESS
>
> Many Thanks in advance
> --
> Gregory Machin
> [EMAIL PROTECTED]
> www.linuxpro.co.za
>

If you take a look at the comments at the manual page for
mssql_connect [1], you see that a lot of people have reported problems
with, but there are also some solutions. I don't know if they work,
because I never had any MS SQL server (MySQL rocks ;-)), but the
second comment seems helpful.

Tijnema

[1] http://www.php.net/manual/en/function.mssql-connect.php
-- 
If this is a mailing list: DO NOT TOP POST! why?:
http://www.caliburn.nl/topposting.html

Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] problem with require_once

2007-08-14 Thread Tijnema
On 8/15/07, Vanessa Vega <[EMAIL PROTECTED]> wrote:
> Good day to all...
>
> I would like to ask for some help..
> I have a form created in javascript codes. The page is a pop up window.
> I am passing the values of the form using the method "post". The PHP file
> that handles the form displays the values from that and  had the following
> code in the beginning:
>
> 
>require_once('myclass.php');
>
>//this class contains all functions for me to connect on the database
>
> rest of the code for displaying and saving  values to an
> existing databse--
>
> ?>
>
> when i clicked the submit button, nothing happens and the page wouldl just
> refresh...
> but when i removed the require_once code of my PHP, the values from the form
> is displayed but of course, will not be saved since the class isnt
> there.
>
> can anyone help me
>

Well, then you're problem is probably in your myclass.php file...
Please show some relevant code so that we can help.

Tijnema

-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Generating executable code

2007-08-13 Thread Tijnema
On 8/13/07, Chris Boget <[EMAIL PROTECTED]> wrote:
> Currently, I have an XML file that I load in, parse manually and iterate
> through the nodes to create objects, etc, using the node values as
> parameters.  This works all well and fine but is a little resource
> intensive.
>
> Now, I can create a XSL template to transform the XML file and output
> all the PHP code that we are doing manually.  However, when the
> transformation occurs, the result is pretty much just a string as far as
> PHP is concerned; it isn't executable PHP code.
>
> I know I can output the result to a temporary file then include it or I
> can pass the result to eval() to execute the code, but neither is ideal.
> Is there another way I can do what I need?  Is there a way to 'include'
> (for the lack of a better term) the result of the XSL transformation
> such that PHP processes it as it would any other source code?
>
> thnx,
> Chris
>


Well, that's exactly what eval does, why isn't it ideal for you?

Tijnema
-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] apache content negotiation and $_GET

2007-08-13 Thread Tijnema
On 8/13/07, Per Jessen <[EMAIL PROTECTED]> wrote:
> All,
>
> I've got a weird issue concerning $_GET and apaches content negotiation.
>
> situation one:
>
> files in htdocs/:
>
> phpinfo.phtml.en  (all it does is call phpinfo()).
> phpinfo.html - apache type-map
>
> if I load URL = https://server/phpinfo?klop=99, I see no _GET variables
> listed.  (with the URL, apache will pick the phpinfo.html file, treat
> it as a type-map and load phpinfo.phtml.en)
>
> if instead I skip the content negotation, and use URL =
> https://server/phpinfo.phtml.en?klop=99, the $_GET variable is
> available.
>
> Any suggestions?
>
>
> thanks,
> Per Jessen, Zurich

This has nothing to do with PHP, and there's only a very little chance
you get a successfull result here.
Your Apache type-map probably just doesn't take the $_GET variables
with it, but don't ask me how to fix ;) I can provide a PHP solution
for it ;)


Tijnema
-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Server Process

2007-08-13 Thread Tijnema
On 8/13/07, Nathan Wallis <[EMAIL PROTECTED]> wrote:
> Just a follow up to my post about running an application server side and the
> introduction of sockets.
>
>
> My application is really just to modify a series of images on the server and
> combine them into a collage of images as a single file name.  So I just say
> go and wait for it to build the final file, then it is done.
>
>
> So in this case are sockets an advantage?  I really just want to start the
> application and let it go, without transferring data back and forth between
> PHP and the app.
>
>
> Any more help would be great.
>
> Cheers,
>
> Nathan
>

Yes, Sockets are still an advantage, IF you use them correctly, and
use the script behind it correctly. Each program does some things at
startup, like loading DLLs if they weren't loaded already, copying
program into memory etc. which all take resources, and when you run
the program as a service with access through sockets, the program
would run forever, but doesn't need to startup each time.

Tijnema


-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Friday morning brain farts....

2007-08-13 Thread Tijnema
On 8/13/07, tedd <[EMAIL PROTECTED]> wrote:
> At 4:54 PM +0200 8/11/07, Tijnema wrote:
> >On 8/11/07, tedd <[EMAIL PROTECTED]> wrote:
> >>  At 7:21 PM +0200 8/10/07, Tijnema wrote:
> >>  >On 8/10/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> >>  >
> >  > >  > if( !isset( $argv[1] ) || !isset( $argv[2] ) || !isset( $argv[3] ) )
> >>  >
> >  > >if(!isset($argv[1],$argv[2],$argv[3])) // Bit shorter ;)
> >>
> >>  But a bit harder to recognize IMO. :-)
> >>
> >>  Cheers,
> >>
> >>  tedd
> >>  --
> >
> >But less confusing :)
>
> Perhaps for you boy wonder, but for us old farts (or at least me)
> it's a bit more confusing.
>
> I'm going to show my ignorance now -- if I see this:
>
> if( !isset( $argv[1] ) || !isset( $argv[2] ) || !isset( $argv[3] ) )
>
> or this
>
> if( !isset( $argv[1] ) && !isset( $argv[2] ) && !isset( $argv[3] ) )
>
> Then I understand what that means.
>
> But, if I see this:
>
> if(!isset($argv[1],$argv[2],$argv[3])))
>
> My first thought is "Is this OR or AND"? And my second thought is "If
> this is OR, then what's AND?"
>
> Being dyslexic I'm easily confused that way (seriously, that's the
> reason I never use an else-if).
>
> Cheers,
>
> tedd

Well, actually,
if(!isset($argv[1],$argv[2],$argv[3])))
is AND.
As it is the same as this:
if( ! ( isset($argv[1]) && isset($argv[2]) && isset($argv[3]) ) )
Which most of us write
if (!isset($argv[1]) || !isset($argv[2]) || !isset($argv[3]))

All three have the same result ;)

Tijnema
-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] What's is the needed configuration to enable SOAP?

2007-08-12 Thread Tijnema
On 8/12/07, Brice <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I have a little problem with Soap. I programmed a script which works
> well on all server except one. I had an 'HTTP Error : Couldn't open
> socket connection to server' Too bad for me it's the main one.
>
> I wonder if  there is a configuration problem? I just saw that socket
> is disabled on the main server. Is soap extension needs to enable
> socket? Google and php documentation said nothing about that.
>
> Thanks in advance for your help.
>
> Brice Favre
>

Is it the same server you are trying to do a SOAP request to? if so,
you should use 127.0.0.1/localhost to connect to, instead of the
server name/ip

Also keep in mind that you can not always connect through the external
IP of a server, but that you need to use internal IP sometimes when
they are in LAN or such..

Tijnema
-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] very strange behavior.... incomplete query performed

2007-08-12 Thread Tijnema
On 8/12/07, Alain Roger <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm still working on importing CSV file content (20.000 records) to database
> PostgreSQL.
>
> when i run the query, once i stored into my table  5218 records, another
> time 5231 another time 4713 and so on
> every time the amount of records imported to DB is different.
>
> Do you have any idea from where it could come ?
>
> Here is my PHP code :
>

>
> thanks a lot for any help.
>
>
> --
> Alain

Might it be that your script times out?
try setting the time limit to unlimited:
set_time_limit(0);

Apache (or w/e your server is) might still timeout, but these values
are a lot higher.. :)

Tijnema

-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] convert (windows-1250) to (utf-8)

2007-08-12 Thread Tijnema
On 8/12/07, Alain Roger <[EMAIL PROTECTED]> wrote:
> and why not :
> $out = iconv('windows-1250','UTF-8', $in); ???
>
> Alain

Did you test if that works? I doubt it, as windows-1250 isn't listed
on the homepage of libiconv:
http://www.gnu.org/software/libiconv/

Tijnema
>
> On 8/12/07, brian <[EMAIL PROTECTED]> wrote:
> >
> > Alain Roger wrote:
> > > Hi,
> > >
> > > I import a csv file (which includes characters from "windows-1250"
> > charset)
> > > to postgreSQL database which is in UTF-8.
> > > How can i convert windows-1250 to utf-8 charset ?
> > >
> >
> > Try the iconv functions:
> >
> > http://www.php.net/manual/en/function.iconv.php
> >
> > $out = iconv('ISO-8859-2', 'UTF-8', $in);
> >
> > This page may be of use, as well:
> > http://en.wikipedia.org/wiki/Windows-1250
> >
> > "Windows-1250 is *similar* to ISO-8859-2 ..."
> >
> > brian
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> --
> Alain
> 
> Windows XP SP2
> PostgreSQL 8.2.3
> Apache 2.2.4
> PHP 5.2.3
>


-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] manual vs. meta refresh

2007-08-12 Thread Tijnema
On 8/12/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> On Sat, 2007-08-11 at 22:11 -0500, Richard Lynch wrote:
> > You don't do it there.
> >
> > You do whatever it is you have to do in the URL before you re-direct.
> >
> > Though I guess if you want different output on that page, you would
> > need to set something somewhere, be it session, database, or a cookie.
>
> I think you're missing the point Richard. Yes you can detect the meta
> redirect or manual refresh using your method. But only the first can be
> detected because when the page is served up to the browser again either
> the special meta redirect URL is active, non special normal URL is
> active, or a super special I'm redirecting but don't count me URL is
> active. Now what happens when the user does a manual refresh again? It's
> not about output, it's about detecting subsequent refreshes and
> determining again the source of the refresh. You must have some kind of
> session tracking system in place, be it a regular session or a database
> query that can check if an ID was already detected that indicates to
> discount the page load from any statistics.
>
> Cheers,
> Rob.

I think you Rob missed a part of Richard's first reply:
"You would then need to re-direct back to the URL *without* the GET
parameter from_meta_tag=1 so that their refresh button would not be
going to that URL with from_meta_tag in it."

Tijnema
-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] convert (windows-1250) to (utf-8)

2007-08-11 Thread Tijnema
On 8/11/07, Alain Roger <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I import a csv file (which includes characters from "windows-1250" charset)
> to postgreSQL database which is in UTF-8.
> How can i convert windows-1250 to utf-8 charset ?
>
> thanks a lot,
>
> --

I personally never worked with different charsets, but this might help you:
http://www.php.net/manual/en/function.mb-convert-encoding.php

Tijnema

-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] preg_match_all to match tags

2007-08-11 Thread Tijnema
On 8/11/07, Stut <[EMAIL PROTECTED]> wrote:
> Tijnema wrote:
> > On 8/11/07, Richard Heyes <[EMAIL PROTECTED]> wrote:
> >> Richard Heyes wrote:
> >>>> How can i match an image tag correctly so it does not cause any issues
> >>>> with how the user adds the image.
> >>> preg_match_all('/]*>/Ui');
> >>>
> >>> Off the top of my head. This wouldn't allow for using the right angle
> >>> bracket in the img tag, but that's almost never going to happen in 
> >>> reailty.
> >> Oops that should be:
> >>
> >> preg_match_all('/]*>/Ui', $input, $matches);
> >>
> >> --
> >> Richard Heyes
> >
> > < img src="image.jpg">
> >
> > Your script doesn't catch above ;)
>
> That's not valid HTML and won't get displayed correctly in most browsers.
>
> -Stut

hmm.. damn.. you're right :P I always assumed it was just correct...

Tijnema
-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] preg_match_all to match tags

2007-08-11 Thread Tijnema
On 8/11/07, Richard Heyes <[EMAIL PROTECTED]> wrote:
>  > < img src="image.jpg">
> >
> > Your script doesn't catch above ;)
>
> So don't write HTML like that.
>
 Depends where the HTML is coming from, it might be user input

Tijnema
-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] preg_match_all to match tags

2007-08-11 Thread Tijnema
On 8/11/07, Richard Heyes <[EMAIL PROTECTED]> wrote:
> Richard Heyes wrote:
> >> How can i match an image tag correctly so it does not cause any issues
> >> with how the user adds the image.
> >
> > preg_match_all('/]*>/Ui');
> >
> > Off the top of my head. This wouldn't allow for using the right angle
> > bracket in the img tag, but that's almost never going to happen in reailty.
>
> Oops that should be:
>
> preg_match_all('/]*>/Ui', $input, $matches);
>
> --
> Richard Heyes

< img src="image.jpg">

Your script doesn't catch above ;)

Tijnema
-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Friday morning brain farts....

2007-08-11 Thread Tijnema
On 8/11/07, tedd <[EMAIL PROTECTED]> wrote:
> At 7:21 PM +0200 8/10/07, Tijnema wrote:
> >On 8/10/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> >
> >  > if( !isset( $argv[1] ) || !isset( $argv[2] ) || !isset( $argv[3] ) )
> >
> >if(!isset($argv[1],$argv[2],$argv[3])) // Bit shorter ;)
>
> But a bit harder to recognize IMO. :-)
>
> Cheers,
>
> tedd
> --

But less confusing :)

When I started PHP, I stumbled over this pice of code:
if(!isset($get['a']) && !isset($get['b']) && !isset($get['c']))

if I had used this:
if(!isset($get['a'],$get['b'],$get['c']))
it would have been correct :)

After looking at it for about an hour (LOL), I figured out I needed to
change it to:
if(!isset($get['a']) || !isset($get['b']) || !isset($get['c']))

Tijnema

-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] I know this is not easy and I'm not stupid but...

2007-08-11 Thread Tijnema
On 8/10/07, Zoltán Németh <[EMAIL PROTECTED]> wrote:
> 2007. 08. 10, péntek keltezéssel 02.31-kor Jan Reiter ezt írta:
> > Hi!
> > Thank you for your response!
> >
> > The only intention of my code was to investigate the (back then) unexpected
> > behavior of the if statement.
> >
> >
> > With $var['test'] set to "blah" this expression should be false
> > ($var['test'] == 0) for what I know ...
> >
> > $var['test'] = "blah";
> > var_dump($var['test'] == 0);
> >
> > //returns bool(true)
> >
> > Now I know why this happens! According to Table 6.5 of the Operators page in
> > the PHP Manual in this comparison all of the values are converted to
> > integer. And  atoi("blah") for sure will fail!;-) So you have to use === to
> > keep the types of the values!
>
> I found something interesting:
>
> [EMAIL PROTECTED]:~ php -r '$var = 'bla'; var_dump('0' == $var);'
> bool(true)
> [EMAIL PROTECTED]:~ php -r '$var = 'bla'; var_dump("0" == $var);'
> bool(false)
>
> version is 5.2.1
>
> is this expected behaviour to be a difference between the two types of
> quotes in this case?
>
> greets
> Zoltán Németh

I think you're little bit confused by the quotes :P
and since you don't have error reporting including E_NOTICE, you don't
see that there's some problem with your code :P
If I execute your code with the -n option, I get same results.
When I put them in a PHP file like this:


I get :
bool(false)
bool(false)

and you probably also ;)


Tijnema
>
> >
> > Jan
> >
> >
> >
> > -Original Message-
> > From: Jim Lucas [mailto:[EMAIL PROTECTED]
> > Sent: Friday, August 10, 2007 1:47 AM
> > To: Jan Reiter
> > Cc: [EMAIL PROTECTED]; php-general@lists.php.net
> > Subject: Re: [PHP] I know this is not easy and I'm not stupid but...
> >
> > Jan Reiter wrote:
> > > Hi!
> > >
> > > Phil:
> > > Still I am curious what var_dump($userValues['afterDark']); at line 102.5
> > > would return.
> > > I managed to recreate that fault with
> > >
> > > $var['test'] = "blah";
> > >
> > > echo ($var['test']);
> > >
> > > if( $var['test'] == 0)
> > > {
> > > echo "ok";
> > > }
> > >
> > > //this returns blahok -- not expected.
> > >
> > > In my case Var_dump() returns string(4) "blah" as expected.
> > >
> > > Using
> > >
> > > if( $var['test'] === 0)
> > >
> > > behaves as expected!!
> >
> > Are you wanting to only test for a empty/non-empty string?
> >
> > if so, use this.
> >
> > if ( empty($var['test']) ) {
> >   echo "var['test'] is empty";
> > }
> >
> > >
> > >
> > > Jim:
> > > TypeCasting would only be effective if you used the type sensitive
> > > comparison operator === , because with "==" 0 equals NULL equals false
> > > equals "" and so on ... or do I miss something here??
> > >
> > >
> > > Hope that solves it for you! I'm still investigating why my first examples
> > > fails. I've got the strong feeling that I'm missing something there. I
> > don't
> > > believe in a php bug or a memory leak in this case! Must be something
> > pretty
> > > obvious! Anyone a clue??
> > >
> > > Thanks,
> > > Jan
> > >
> > >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Concatenation vs. Interpolation

2007-08-11 Thread Tijnema
On 8/11/07, AmirBehzad Eslami <[EMAIL PROTECTED]> wrote:
> Hi,
>
> FASTER CODE!
>
> This question involves Coding Style, Readability, Write-ability and
> Performance.
> Some people use the . operator to concat an string to a variable, some
> people use interpolation (embeding variable into string).
>
> =
> 1st Method (Concatenation)
> $str = 'My name is ' . $name;
>
> 2nd Method (Interpolation)
> $str = "My name is $name";
> =
>
> I know that the 1st Method is much faster, according to
> some benchmarks, which one of them is available
> in the book "Advanced PHP Programming, page 470".
>
> Could we consider the 1st Method as a "Best Practice", which offers
> better Performance?
>
> I know that the performance here is not very much, but is it
> considerable in a high-traffic website?
>
> Thank you in advanced for sharing your opinions,
> Behzad
>

Code readability is quite important when working with a team on a
project, and if you got for method 1 on things like this:
$str = '';
It gets quite inreadable, having a double qoute next to a single quote.
while this looks much better:
$str = "";

I just did some benchmarks myself, and you can see that concatenation
is definitly a little bit fast, but it's only 2 seconds on 10 million
loops:
For 10,000,000 loops:
Concatenation single quote:5.62786102295
Concatenation double quote:5.6335657
Interpolation:7.32201290131

Test code used:
';
}
$time[2] = microtime(TRUE);

$x = 0;
$str = '';
$add = '?';

$time[3] = microtime(TRUE);
for($x = 0; $x < 1000; $x++) {
$str = "";
}
$time[4] = microtime(TRUE);

$x = 0;
$str = '';
$add = 'def';

$time[5] = microtime(TRUE);
for($x = 0; $x < 1000; $x++) {
$str = "";
}
$time[6] = microtime(TRUE);

echo 'For 10,000,000 loops:';
echo 'Concatenation single quote:'.($time[2]-$time[1]);
echo 'Concatenation double quote:'.($time[4]-$time[3]);
echo 'Interpolation:'.($time[6]-$time[5]);

?>

Tijnema

-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] manual vs. meta refresh

2007-08-10 Thread Tijnema
On 8/11/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
> On Fri, August 10, 2007 1:26 pm, Kevin Murphy wrote:
> > I doubt this, but is there any way to determine via PHP if a browser
> > was refreshed automatically via a META tag vs the person clicking the
> > refresh button?
>
> You could embed something in the META tag's URL such as:
>
>  content="5;http://example.com?from_meta_tag=1"; >
>
> You would then need to re-direct back to the URL *without* the GET
> parameter from_meta_tag=1 so that their refresh button would not be
> going to that URL with from_meta_tag in it.
>
> Kind of kludgy, but should work
>


Do you guys read other replies first before making a reply yourself?
You're the third one making the same reply...

Tijnema

-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] manual vs. meta refresh

2007-08-10 Thread Tijnema
On 8/10/07, Stut <[EMAIL PROTECTED]> wrote:
> Kevin Murphy wrote:
> > I doubt this, but is there any way to determine via PHP if a browser was
> > refreshed automatically via a META tag vs the person clicking the
> > refresh button?
>
> Add a GET variable to the URL you put in the meta tag to tell you it
> came from the meta tag.
>
>
> -Stut
>
> You could dynamically generate the meta tag, so it refreshes to your
> page with some extra parameter that wouldn't exist if someone just hit
> F5. It's not foolproof (as the meta tag can of course be seen in plain
> text), but it should give you a high success rate.
>
> Cheers,
>
> Rich

Hello stut and rich again,

I see you provided both the same solution as me, but did you guys
think of the fact that it only works once?

One they guy is redirected once through the meta tag, it is on the page with url
?from_meta=yes, or something smiliar, now when the user presses F5, it
will stil think the user is redirected through the META tag...

Tijnema


-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] php 4.4.7 make install with pear causes zend freeing errors

2007-08-10 Thread Tijnema
On 8/10/07, John Mendenhall <[EMAIL PROTECTED]> wrote:
> I sent this to the php-install list.  However, with
> no response, I knew there would be more eyes looking
> at it here.  Hopefully, someone can send me a pointer
> on how to resolve this issue.  It might be the root of
> other problems I am having.
>
> Per my previous message, I have recently upgraded from
> php 4.4.0, to php 4.4.7.  My configure options are as
> follows:
>

>
> I would like to know what I am doing wrong here.
> When I turn off pear, this does not happen.
> When I try to upgrade or install pear packages,
> I get the same types of errors.
>
> Thanks in advance for any pointers you can
> provide.
>
> Thanks!
>
> JohnM
>
> --

What are you doing with PHP4???

Go PHP5!!

http://www.gophp5.org

Tijnema


-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] manual vs. meta refresh

2007-08-10 Thread Tijnema
On 8/10/07, Kevin Murphy <[EMAIL PROTECTED]> wrote:
> I doubt this, but is there any way to determine via PHP if a browser
> was refreshed automatically via a META tag vs the person clicking the
> refresh button?
>
> --
> Kevin Murphy

Normally not, unless you add an extra GET item to the META tag, for example:
http://www.domain.com/dir/site.php?foo=bar&meta_refresh=yes";>

But this would only work once, as you get redirected to there.
You can add a counter if you want, and keep track of the number of
times it has been redirected to META, in comparison to the one before.

http://www.domain.com/dir/site.php?foo=bar&meta_refresh=1";>
and when the new page load, check whether the value is the same as the
previous page load (user has uses refresh), or it is +1 (redirected
through META)

Tijnema

-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Running a server process

2007-08-10 Thread Tijnema
On 8/10/07, Stut <[EMAIL PROTECTED]> wrote:
> Tijnema wrote:
> > On 8/10/07, Stut <[EMAIL PROTECTED]> wrote:
> >> Tijnema wrote:
> >>> On 8/10/07, Stut <[EMAIL PROTECTED]> wrote:
> >>>> Tijnema wrote:
> >>>>> On 8/10/07, Richard Heyes <[EMAIL PROTECTED]> wrote:
> >>>>>>> That is it works with just me using the site.  I am wondering how 
> >>>>>>> this would
> >>>>>>> effect performance if say 500 people were executing this php function 
> >>>>>>> around
> >>>>>>> the same time and the processing overlapped.  Is there anyway to make 
> >>>>>>> an
> >>>>>>> executable run as a service, I am guessing at the terminology that I 
> >>>>>>> should
> >>>>>>> use here, but I feel there would be a much more efficient way of 
> >>>>>>> performing
> >>>>>>> this task.
> >>>>>> Well, ideally you don't run an executable. But if you must, there's 
> >>>>>> some
> >>>>>> Windows program that turns an executable into a service. But then
> >>>>>> there's the consideration of communicating with it, which you could do
> >>>>>> with sockets. Or you could use a file.
> >>>>>>
> >>>>>> --
> >>>>>> Richard Heyes
> >>>>>> +44 (0)844 801 1072
> >>>>>> http://www.websupportsolutions.co.uk
> >>>>> I don't know if there a program exists that can "convert" the program
> >>>>> to a service, I think you need to compile it as a service from source
> >>>>> code, but as I mentioned in my first post, and you mentioned here too,
> >>>>> you also need to add support for a socket server in your program.
> >>>>> Sockets in PHP are easy ;)
> >>>> http://www.firedaemon.com/
> >>>>
> >>>> But you're right, you'd need a way to communicate with the service.
> >>>>
> >>>> -Stut
> >>> Well stut, this doesn't really run your program as a service.
> >>> The program itself is a server, and simply starts every program when
> >>> that service starts. That's not the same as running the program as a
> >>> service.
> >> That's extremely pedantic. "As a service" simply means it responds to
> >> messages from the OS such as start, pause and stop. Firedaemon wraps
> >> your executable in a process that does just that. So technically you're
> >> correct, it doesn't turn your executable into a service, it wraps it in
> >> one, but the effect is essentially the same.
> >>
> >> If you need the extra control you'll get over it by rewriting your
> >> executable to actually be a service then you should do that. But if
> >> you're working with something you don't have the source for, or don't
> >> have the time to implement such a modification then Firedaemon is the
> >> best option I've come across.
> >>
> >> -Stut
> >
> > Yes, but if you don't have the source, you can't add socket support,
> > and then you can do quite less with a program... Unless you already
> > have socket support in the program, but that seems quite odd to me ;)
>
>  Sockets aren't the only IPC mechanism available. And besides, I was
> countering your general statement regarding Firedaemon, not the
> applicability of Firedaemon to the OP's problem, which we can't comment
> on without knowing a lot more information about it.
>
> -Stut

Sockets is the best IPC available for all platforms, Pipes etc. only
work on POSIX systems, not on default windows installation, as you
would need the Microsoft Windows Services For Unix package installed.

You could use things like files or databases too, but sockets would
mostly be easier as you can simple send a START command to emulate the
start of a program, and have a stream open for returning data.

I see I misreaded a little bit of your reply.

Tijnema

-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Running a server process

2007-08-10 Thread Tijnema
On 8/10/07, Stut <[EMAIL PROTECTED]> wrote:
> Tijnema wrote:
> > On 8/10/07, Stut <[EMAIL PROTECTED]> wrote:
> >> Tijnema wrote:
> >>> On 8/10/07, Richard Heyes <[EMAIL PROTECTED]> wrote:
> >>>>> That is it works with just me using the site.  I am wondering how this 
> >>>>> would
> >>>>> effect performance if say 500 people were executing this php function 
> >>>>> around
> >>>>> the same time and the processing overlapped.  Is there anyway to make an
> >>>>> executable run as a service, I am guessing at the terminology that I 
> >>>>> should
> >>>>> use here, but I feel there would be a much more efficient way of 
> >>>>> performing
> >>>>> this task.
> >>>> Well, ideally you don't run an executable. But if you must, there's some
> >>>> Windows program that turns an executable into a service. But then
> >>>> there's the consideration of communicating with it, which you could do
> >>>> with sockets. Or you could use a file.
> >>>>
> >>>> --
> >>>> Richard Heyes
> >>>> +44 (0)844 801 1072
> >>>> http://www.websupportsolutions.co.uk
> >>> I don't know if there a program exists that can "convert" the program
> >>> to a service, I think you need to compile it as a service from source
> >>> code, but as I mentioned in my first post, and you mentioned here too,
> >>> you also need to add support for a socket server in your program.
> >>> Sockets in PHP are easy ;)
> >> http://www.firedaemon.com/
> >>
> >> But you're right, you'd need a way to communicate with the service.
> >>
> >> -Stut
> >
> > Well stut, this doesn't really run your program as a service.
> > The program itself is a server, and simply starts every program when
> > that service starts. That's not the same as running the program as a
> > service.
>
> That's extremely pedantic. "As a service" simply means it responds to
> messages from the OS such as start, pause and stop. Firedaemon wraps
> your executable in a process that does just that. So technically you're
> correct, it doesn't turn your executable into a service, it wraps it in
> one, but the effect is essentially the same.
>
> If you need the extra control you'll get over it by rewriting your
> executable to actually be a service then you should do that. But if
> you're working with something you don't have the source for, or don't
> have the time to implement such a modification then Firedaemon is the
> best option I've come across.
>
> -Stut

Yes, but if you don't have the source, you can't add socket support,
and then you can do quite less with a program... Unless you already
have socket support in the program, but that seems quite odd to me ;)

Tijnema
-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Tijnema
On 8/10/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> On Fri, 2007-08-10 at 19:21 +0200, Tijnema wrote:
> > On 8/10/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> > > On Fri, 2007-08-10 at 11:48 -0400, Daniel Brown wrote:
> > > > On 8/10/07, Stut <[EMAIL PROTECTED]> wrote:
> > > > >  I get an email from each
> > > > > server containing the contents of the error log from the previous day
> > > > > and my first task each day is to go through that and track down any
> > > > > issues that usage has highlighted.
> > > >
> > > > That's actually a good point there that I can take away from this.
> > > >  I actually don't have anything set to send me a log of code issues,
> > > > only when an error is caused (and, of course, anything server-related,
> > > > but that's a different point entirely).
> > >
> > > Simple enough... put the following in a file, and add a cron job.
> > >
> > > #!/usr/bin/php -qC
> > >  > >
> > > if( !isset( $argv[1] ) || !isset( $argv[2] ) || !isset( $argv[3] ) )
> >
> > if(!isset($argv[1],$argv[2],$argv[3])) // Bit shorter ;)
>
> Quite true.
>
> > > {
> > >echo "Usage: {$argv[0]}   \n";
> > >exit( 1 );
> > > }
> > >
> > > $subject = $argv[1];
> > > $email   = $argv[2];
> > > $path= $argv[3];
> > >
> > > $content = implode( '', file( $path ) );
> >
> > $content = file_get_contents($path); // Safe to require PHP 4 >= 4.3.0 
> > right?
>
> I always forget about file_get_contents() because its counterpart
> file_put_contents() for some ungodly reason didn't appear until PHP 5.

Forget PHP4 and life becomes a lot easier :)

Tijnema
-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Running a server process

2007-08-10 Thread Tijnema
On 8/10/07, Stut <[EMAIL PROTECTED]> wrote:
> Tijnema wrote:
> > On 8/10/07, Richard Heyes <[EMAIL PROTECTED]> wrote:
> >>> That is it works with just me using the site.  I am wondering how this 
> >>> would
> >>> effect performance if say 500 people were executing this php function 
> >>> around
> >>> the same time and the processing overlapped.  Is there anyway to make an
> >>> executable run as a service, I am guessing at the terminology that I 
> >>> should
> >>> use here, but I feel there would be a much more efficient way of 
> >>> performing
> >>> this task.
> >> Well, ideally you don't run an executable. But if you must, there's some
> >> Windows program that turns an executable into a service. But then
> >> there's the consideration of communicating with it, which you could do
> >> with sockets. Or you could use a file.
> >>
> >> --
> >> Richard Heyes
> >> +44 (0)844 801 1072
> >> http://www.websupportsolutions.co.uk
> >
> > I don't know if there a program exists that can "convert" the program
> > to a service, I think you need to compile it as a service from source
> > code, but as I mentioned in my first post, and you mentioned here too,
> > you also need to add support for a socket server in your program.
> > Sockets in PHP are easy ;)
>
> http://www.firedaemon.com/
>
> But you're right, you'd need a way to communicate with the service.
>
> -Stut

Well stut, this doesn't really run your program as a service.
The program itself is a server, and simply starts every program when
that service starts. That's not the same as running the program as a
service.

Tijnema

-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Getting a 'newline' out of a string

2007-08-10 Thread Tijnema
On 8/10/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> On 8/10/07, Faither <[EMAIL PROTECTED]> wrote:
> > Hey there!
> > I'm kind of lost with how str_replace , preg_replace, ereg_replace or
> > even explode are handling a "\n"-ewline.
> >
> > I have a text string from a form and am trying to replace the "\n" or
> > chr(10) or however you might call the newline with a simple html break tag.
> >
> > If I use the replacing functions I get the -tags where there are
> > newlines from the textarea of the form. BUT I still have the newlines
> > remain.
> >
> > So I tried a different approach breaking the text down into an array using:
> >   explode(' ', $string)
> > in conjunction with trim() and again made a string out of the array. -
> > -tags still there, newlines aswell -.-'
> >
> > Next thing I tried was exploding the string using the "\n" and chr(10).
> > This function ignored all newlines and gave me an array with one key and
> > the entire text of the textarea as value Oh... and the newlines of
> > course were there aswell...
> >
> > So... How can I get rid of these?! - I just want them gone!
> >
> > Is it even possible under windows? ^^
> >
> > Thanks a lot in advance
> >
> >
> > Stefan
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>If I'm not mistaken, Windows doesn't strictly use \n, but rather \r\n.
>
> --
> Daniel P. Brown
> [office] (570-) 587-7080 Ext. 272
> [mobile] (570-) 766-8107
>

Just to clarify, the DEFAULT line-endings for OSes:
Windows: \r\n (carriage return followed by a newline)
Unix: \n (newline)
Mac: \r (carriage return)

Of course it is possible to use other line endings on those OSes, but
these are the default.

Tijnema
-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Tijnema
On 8/10/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> On Fri, 2007-08-10 at 11:48 -0400, Daniel Brown wrote:
> > On 8/10/07, Stut <[EMAIL PROTECTED]> wrote:
> > >  I get an email from each
> > > server containing the contents of the error log from the previous day
> > > and my first task each day is to go through that and track down any
> > > issues that usage has highlighted.
> >
> > That's actually a good point there that I can take away from this.
> >  I actually don't have anything set to send me a log of code issues,
> > only when an error is caused (and, of course, anything server-related,
> > but that's a different point entirely).
>
> Simple enough... put the following in a file, and add a cron job.
>
> #!/usr/bin/php -qC
> 
> if( !isset( $argv[1] ) || !isset( $argv[2] ) || !isset( $argv[3] ) )

if(!isset($argv[1],$argv[2],$argv[3])) // Bit shorter ;)

> {
>echo "Usage: {$argv[0]}   \n";
>exit( 1 );
> }
>
> $subject = $argv[1];
> $email   = $argv[2];
> $path= $argv[3];
>
> $content = implode( '', file( $path ) );

$content = file_get_contents($path); // Safe to require PHP 4 >= 4.3.0 right?

>
> if( trim( $content ) === '' )
> {
>$content = 'NO ERRORS TODAY!!!';
> }
>
> mail( $email, $subject, $content );
>
> ?>
>
> Cheers,
> Rob.
> --

And have a nice day!

Tijnema
-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Getting a 'newline' out of a string

2007-08-10 Thread Tijnema
On 8/10/07, Stut <[EMAIL PROTECTED]> wrote:
> Faither wrote:
> > I'm kind of lost with how str_replace , preg_replace, ereg_replace or
> > even explode are handling a "\n"-ewline.
> >
> > I have a text string from a form and am trying to replace the "\n" or
> > chr(10) or however you might call the newline with a simple html break tag.
> >
> > If I use the replacing functions I get the -tags where there are
> > newlines from the textarea of the form. BUT I still have the newlines
> > remain.
> >
> > So I tried a different approach breaking the text down into an array using:
> >  explode(' ', $string)
> > in conjunction with trim() and again made a string out of the array. -
> > -tags still there, newlines aswell -.-'
> >
> > Next thing I tried was exploding the string using the "\n" and chr(10).
> > This function ignored all newlines and gave me an array with one key and
> > the entire text of the textarea as value Oh... and the newlines of
> > course were there aswell...
> >
> > So... How can I get rid of these?! - I just want them gone!
> >
> > Is it even possible under windows? ^^
>
> First of all look at http://php.net/nl2br which does exactly what you're
> trying to do.
>
> Second try this...
>
> $string = str_replace("\r\n", '', $string);
> $string = str_replace("\n", '', $string);
>
> -Stut
>

You forgot the Macintosh newlines, which is a single carriage return.

Try this code instead:
$string = str_replace("\r\n", '', $string);
$string = str_replace("\n", '', $string);
$string = str_replace("\r", '', $string);

Tijnema
-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Running a server process

2007-08-10 Thread Tijnema
On 8/10/07, Richard Heyes <[EMAIL PROTECTED]> wrote:
> > That is it works with just me using the site.  I am wondering how this would
> > effect performance if say 500 people were executing this php function around
> > the same time and the processing overlapped.  Is there anyway to make an
> > executable run as a service, I am guessing at the terminology that I should
> > use here, but I feel there would be a much more efficient way of performing
> > this task.
>
> Well, ideally you don't run an executable. But if you must, there's some
> Windows program that turns an executable into a service. But then
> there's the consideration of communicating with it, which you could do
> with sockets. Or you could use a file.
>
> --
> Richard Heyes
> +44 (0)844 801 1072
> http://www.websupportsolutions.co.uk

I don't know if there a program exists that can "convert" the program
to a service, I think you need to compile it as a service from source
code, but as I mentioned in my first post, and you mentioned here too,
you also need to add support for a socket server in your program.
Sockets in PHP are easy ;)

Tijnema


-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Running a server process

2007-08-10 Thread Tijnema
On 8/10/07, Nathan Wallis <[EMAIL PROTECTED]> wrote:
> Hi there,
>
>
>
> I have a windows application the performs  a certain task that I need it to
> perform.  I am in the process of developing my site and am really interested
> in the functionality of the site at the moment and haven't set about putting
> the details in place, so I am using the php function
>
>
>
> exec ("start ... ");
>
>
>
> To run the process.
>
>
>
> It works.
>
>
>
> That is it works with just me using the site.  I am wondering how this would
> effect performance if say 500 people were executing this php function around
> the same time and the processing overlapped.  Is there anyway to make an
> executable run as a service, I am guessing at the terminology that I should
> use here, but I feel there would be a much more efficient way of performing
> this task.
>
>
>
> Any thoughts would be much appreciated.
>
>
>
> Nathan

500 people at the same time is a big problem, as it will start 500
processes at the same time. I wonder how many Windows servers can
handle that much processes at same time.

If you have written the windows application, you should rewrite some
part of it to let it work with sockets, so that you can simply connect
to the program with a socket.

Tijnema
-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Problems in php

2007-08-07 Thread Tijnema
On 8/7/07, racol <[EMAIL PROTECTED]> wrote:
>
> Dear Sirs,
> I have installed a Sambar 64 server and PHP 4.7 plus MySql. I connect
> through localhost and the PHPINFO.php file works OK on IE and Firefox.
> PHPINFO.php shows that the php.ini file is situated in C:/Windows as advised
> and I have altered the error_log and extensions_dir as advised by Sambar.
> The problem is:
>
> When I try to run a php file, either to connect to MySql OR just a simple
> Create Button file, neither browser will output either file. I get no error
> messages and the error logs show nothing significant. I just get the html
> source code (NONE of the php code) when I interrogate 'view source' in IE
> and just a blank in Firefox.
>
> Can you please advise. I don't know where to look next. I attach the two
> test files for your perusal.
>
> Best regards
>  Roger Collis
> --

Please upload the files somewhere, the list blocks them.

The other files you tried to test, do you run them through localhost too?

Tijnema

-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] javascript in or in ?

2007-08-07 Thread Tijnema
On 8/7/07, Greg Donald <[EMAIL PROTECTED]> wrote:
> On 8/7/07, Tijnema <[EMAIL PROTECTED]> wrote:
> > Uhh, do you know which list this is?
>
> I give up..  Is it the one where I get as many [OT] labeled emails as
> I do on-topic ones?
>
> People have been asking basic html questions here for (over?) a
> decade, and it probably won't stop anytime soon.  Newcomers don't know
> it's wrong because they haven't seen anyone be smacked down for it.
> So until you can smack someone down in advance, it won't stop.

What about a php-html list? or php-js? :P

>
> It's not that big a deal is it?  I mean html discussion isn't nearly
> as important as a heated copyright law debate, but then my delete
> button works great.
>
> I think you just want something to bitch about.
>
> --
> Greg Donald
> http://destiney.com/

Yep, you're right. This list has quite a lot traffic, and if all
"useless" topics could move to another list, the real problems could
be handled here, and we could see the forest through the trees again
;) Or however you want to call it in english ;)

Tijnema
-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] javascript in or in ?

2007-08-07 Thread Tijnema
On 8/7/07, Richard Heyes <[EMAIL PROTECTED]> wrote:
> C.R.Vegelin wrote:
> > Are there any rules when to include javascript in  or in  ?
> > For example,
> > 
> > function reload(form)
> > {  var val=form.Chapter.options[form.Chapter.options.selectedIndex].value;
> >self.location='QueryForm.php?Chapter=' + val ;
> > }
> > 
>
> Either really. Both work.
>
> --
> Richard Heyes

Actually, I didn't want to answer this, but you're talking shit here ;)

Javascript needs to be initialised before it can be used.
So, if you have a function bodyload(), and you call it from , you need to place it inside , as it isn't
loaded if you put it in .
Some browsers will still run the javascript code, however it is not recommended.

Tijnema
-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] javascript in or in ?

2007-08-07 Thread Tijnema
On 8/7/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> On Tue, 2007-08-07 at 21:24 +0200, Tijnema wrote:
> > On 8/7/07, C.R.Vegelin <[EMAIL PROTECTED]> wrote:
> > > Are there any rules when to include javascript in  or in  ?
> > > For example,
> > > 
> > > function reload(form)
> > > {  var val=form.Chapter.options[form.Chapter.options.selectedIndex].value;
> > >   self.location='QueryForm.php?Chapter=' + val ;
> > > }
> > > 
> > >
> > > TIA, Cor
> > >
> >
> > Uhh, do you know which list this is?
>
> Yeah!! This list is for public apologies and Copyright discussion.
>
> Cheers,
> Rob.
> --

Oh yeah, Tedd is only the first of thousands of people that need to
apologize... :P

Tijnema
-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] javascript in or in ?

2007-08-07 Thread Tijnema
On 8/7/07, C.R.Vegelin <[EMAIL PROTECTED]> wrote:
> Are there any rules when to include javascript in  or in  ?
> For example,
> 
> function reload(form)
> {  var val=form.Chapter.options[form.Chapter.options.selectedIndex].value;
>   self.location='QueryForm.php?Chapter=' + val ;
> }
> 
>
> TIA, Cor
>

Uhh, do you know which list this is?

Tijnema
-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] mail problem - deadline!!!!!

2007-08-07 Thread Tijnema
On 8/7/07, Luc <[EMAIL PROTECTED]> wrote:
>  Good evening list,
>
>  i'm having a strange mail problem:
>
>  i have 2 contact-forms on a site, where 1 get's send to the e-mail
>  account and the other doesn't. I've tested them both on my remote
>  server and they work, but when i upload them to the clients' server,
>  1 doesn't arrive in the mailbox and the other one does.
>
>  Code for the troublesome form:
>

> --
> Best regards,
>  Luc

Hello Luc:

Your code is really large, you should try narrow the problem down to a
specific piece of code that doesn't work.
You can start with setting error_reporting to E_ALL and see if it
generates any warnings, fix them if so.
If that didn't help, try to remove piece of code and see when it
works, when it works again, add pieces of code 1 by 1 and see which
one is causing trouble.
Then take a deeper look at that part, and see if you can find the
problem, if not, then you can come back to this list with that small
piece of code.

Tijnema
-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Wierd error with xml_set_element_handler()

2007-08-05 Thread Tijnema
On 8/5/07, Bruce Steinback <[EMAIL PROTECTED]> wrote:
> Okay, I'm probably really stupid, but I can't figure this out.  I'm getting 
> the error:
>
> Fatal error: Function name must be a string in .../pages-stage/loginresp.php 
> on
> line 205
>
> (which is the xml_set_element_handler() call)
>
> with this code:
>
>  function startElement($parser, $name, $attrs) {
>global $value;
>$value = "";
>  }
>
>  function endElement($parser, $name) {
>global $value, $bypass, $status;
>
>  }
>
>  function charData($parser, $data) {
>global $value;
>$value = $data;
>  }
>
>  if (!isset($_GET["consentResp"])) {
>...
>  } else {
>...
>  }
>
>  // Fallthru do getPresence
>  // Okay, user is auth'd, now do getPresence to get members of BL
>  $resp = doGetPresence($devId, $authToken, $baseUrl);
>  // sigh - strip HTTP metadata
>  $resp = strstr($resp, "
>  // Do XML parse - sets status, handles BL data if present
>  $xml_parser = xml_parser_create();
>  $xml_set_element_handler($xml_parser, 'startElement', 'endElement');

Uhm, why do you have a $ before xml_set_element_handler?

>  $xml_set_character_data_handler($xml_parser, 'charData');
>  $xml_parse($xml_parser, $resp, true);
>  $xml_parser_free($xml_parser);

And also before above functions?
>
> Any ideas? I've tried the line with single quotes, double quotes and no 
> quotes, and various other odd attempts to figure it out.  I'm totally baffled.
>
>Many Thanks (in advance),
>Bruce Steinback
>

let me (us) know if you fixed it.

Tijnema


-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Rejecting File Upload

2007-08-05 Thread Tijnema
On 8/5/07, php mail <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> How do I prior check file's size in server side before the upload process
> begin ?
>
> Regards,
>
> Feris
>

You can't do it with PHP, with PHP you can only check it after the
file has uploaded, you can only do it on the client side. This means
you have 3 options:
1) form field MAX_FILE_SIZE, which is the easiest thing to bypass.
Some browsers even ignore this.
2) Javascript check, this can also be bypassed quite easily.
3) Do it through a seperate program, like an JAVA applet, or a stand
alone application. Both can be bypassed too, though you need to have
knowledge of ASM and Reverse Engineering for that, which is not easy,
but once you know it, it can be quite easy to do it too ( I could do
it in less than 5 mins )

Tijnema
-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Problem with php mail

2007-08-05 Thread Tijnema
On 8/5/07, Jason Sia <[EMAIL PROTECTED]> wrote:
> Hi Everyone,
>I'm having problem with php mail.  When I try to create an html message 
> with only mydomain, gmail is registering it as a 
> spam while yahoo is not.  Can you suggest solutions to my problem.
>
> Thanks,
> Jason
>

There are a lot of things that can make emails go to spam, as already
noted the headers and the size of the message, but also a wrong title,
or wrong From: address (domain email != domain mail server) can make
the message go to spam

Tijnema

-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Check for well formed html

2007-08-05 Thread Tijnema
On 8/5/07, tedd <[EMAIL PROTECTED]> wrote:
> Hi gang:
>
> I have a client who wants to include html tags in his CMS.
>
> I know that I can limit what tags he can use, but how can I check if
> the text is well formed with the tags permitted before storing it in
> his CMS?
>
> Cheers,
>
> tedd
>

Have a look at Example 1687 on the manual page for preg_match_all, I
think you can use it with a little modification :)


Tijnema
-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Which PHP-Editor to use?

2007-08-02 Thread Tijnema
On 8/2/07, Merlin <[EMAIL PROTECTED]> wrote:
> Hi there,
>
> I have worked now for several years happily with homesite 4.5, but now
> it looks like I have to switch to another system as homesite will not
> run without admin rights on a XP machine.
>
> What editors do you use? Do you have any recomendations on a special
> one? I have looked into eclipse, but I would hear from your experience
> which one would you recommend me to switch to?
>
> Thank you for any comment.
>
> Best regards,
>
> Merlin
>

All about personal preference, I use Adobe (Macromedia) Dreamweaver
CS3, and I really like the server interface through FTP. It allows me
to easily switch between my different sites around the world :)
Apart from that, color coding is good, and supports auto tabbing :)

Tijnema

-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Numbers, Numbers everywhere! Need some Dollar help.

2007-08-02 Thread Tijnema
On 8/2/07, Brad Bonkoski <[EMAIL PROTECTED]> wrote:
> Dan Shirah wrote:
> > Greetins all,
> >
> > In my form I have an area where the user enters in the payment amount:
> >
> > 
> >
> > This is all fine and dandy and works as generically as it can. BUT, the
> > problem is that I need to make sure the user didn't fat finger any of the
> > numbers.  For instance, in my generic text field the user types 600 in the
> > payment amount and clicks submit.
> >
> > This works and the user is charged $600.  But, come to find out the user
> > meant to enter 6.00 not 600. Can I add a check using PHP to force the user
> > to put in the dollar AND cents? This way if a number such as 600 is entered
> > and the user hits save, the check will notice there isn't a .00 on the end
> > and prompt the user for more information.
> >
> > Could I incorporate something like:
> >
> > if ($payment_amount != number_format($payment_amount, 2)) {
> >   error here
> > }
> >
> > Or, do you think I would be better off using two text areas?  One for the
> > dollar value and one for the cents?
> >
> > Or, do you think I would be better off trying to find some kind of
> > javascript function that would check the value upon submit?
> >
> > Any help is appreciated.
> >
> > Dan
> >
> >
> If you want it squarely on the client side, then use javascript.  There
> are easy functions to split a text string (like php's explode).
> Then you can split on the '.' and then do some logical stuff like the
> cents is between 00 and 99, and anything else you think necessary.
> If there are no cents, then you can issue a confirmation box.  So, my
> vote is to handle it within javascript, as it should not be too difficult.
> -B

What about the european format? Like this:
$1.234.567,89

Tijnema

-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Setting group sticky bit on directory with chmod()

2007-08-02 Thread Tijnema
On 8/2/07, Ben Ramsey <[EMAIL PROTECTED]> wrote:
> On 8/2/07 10:57 AM, Daniel Brown wrote:
> > On 8/2/07, Ben Ramsey <[EMAIL PROTECTED]> wrote:
> >> PHP (doesn't work):
> >> chmod('/path/to/dir', 02775);
> >>
> >> We've tested the PHP code on files, and it works, but it doesn't work on
> >> directories.
> >
> > Drop the preceding 0 from the chmod() function parameters.  The
> > four-digit octal value is preferred, and the 0 is the first bit to
> > show that there's no user- or group-specific execution (su-exec'ing,
> > basically) or "stickiness" to the file/directory.  However,
> > three-digit values will work.  In either case, five digits will not
> > work.
> >
> > Right:
> > chmod 0755 file.php
> > chmod 1777 file.php
> > chmod('file.php',0755);
> > chmod('file.php',1777);
>
> What about on directories? That's our problem.
>
> The following works on files (even though you say it shouldn't). I'll
> clarify: 02775 sets permissions based on how we expect 2775 to work
> using chmod from the command prompt. The problem is that 2775 with PHP's
> chmod() doesn't set the permissions in the same way that it does from
> the command prompt.
>
> This works on files:
> chmod('/path/to/file.php', 02775);
>
> But it doesn't work on directories.
>
> Here's what we're doing:
>
>  chmod('./test1', 2775);
> ?>
>
> Here's what we get:
> $ ls -l
> d-ws-w-rwt   2 user user  4096 Aug  2 15:33 test1
>
> Here's what we expect:
> $ chmod 2775 test1
> drwxrwsr-x   2 user user  4096 Aug  2 15:34 test1
>
> So, what are we doing wrong with chmod() that is causing us to get the
> wrong results? Keep in mind that we are running the PHP script as the
> same user who owns the directory.
>
> --
> Ben Ramsey
> http://benramsey.com/
>

Who is the owner of the directory containing this test1 directory?
That one should also be the same as PHP script is running on AFAIK.

Tijnema

-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Re: Pirate PHP books online?

2007-07-31 Thread Tijnema
On 8/1/07, David Powers <[EMAIL PROTECTED]> wrote:
> Larry Garfield wrote:
> > If a plumber fixes your toilet, he gets paid once.
>
> A plumber came recently to fix our hot water system. It took him less
> than one hour. He got paid about $100.
>
> > If a writer writes a book, he gets paid n times, where n is a (hopefully for
> > him) ever-increasing number.
>
> I write a book (actually, I've written several). It takes me on average
> seven or eight months' full-time work. You buy a copy of my book, I get
> $1.50-$2.25. For me to get the same rate of pay as a plumber, I would
> need to sell 70,000 copies of each book. I should be so lucky.
>
> David Powers

Yes, and the president gets a lot more


Tijnema


-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Re: Pirate PHP books online? - ENOUGH ALREADY

2007-07-30 Thread Tijnema
On 7/31/07, Chris Aitken <[EMAIL PROTECTED]> wrote:
> Come on folks is this a thread that really needs to be duked out here?
>
> It's a bit ridiculous having legal issues regarding copyright (and whatever
> else has been brought up) by a collection of (mostly) legally untrained
> computer nerds (I include myself in the nerd category so get off the flame
> button).
>
> Let it die already. There's more important things to waste bandwidth on...
> like discussing ... I dunno who's hotter... Oprah Winfrey or Roseanne?
>
>
> Regards
>
>
> Chris Aitken
> The Web Hub Designer and Programmer
> Phone : 02 4648 0808
> Mobile : 0411 132 075
>

I agree with 5000% with you, this is a PHP list, and of course threads
get OT sometimes, but this is really too much OT, and there's no
solution for the problem ;)

Tijnema


> -
>
> Making The Web Work The Web Hub
> http://www.thewebhub.com.au/
> [EMAIL PROTECTED]
>
> -
>
> Confidentiality Statement:
> This message is intended only for the use of the Addressee and may contain
> information that is PRIVILEDGED and CONFIDENTIAL.  If you are not the
> intended recipient, dissemination of this communication is prohibited.
> If you have received this communication in error, please erase all
> copies of the message and its attachments and notify us immediately.
> > -Original Message-
> > From: Larry Garfield [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, 31 July 2007 10:28 AM
> > To: php-general@lists.php.net
> > Subject: Re: [PHP] Re: Pirate PHP books online?
> >
> > On Monday 30 July 2007, tedd wrote:
> >
> > > Our entire legal system is built on allowing (granting permission)
> > > certain actions and not allowing (not granting permission) other
> > > actions.
> > >
> > > You do not have permission to steal. And if someone has not granted
> > > you the permission to use their whatever and you do use their
> > > whatever, then that's stealing.
> >
> > So jay-walking (illegal, you do not have permission to do it) is now
> > stealing,
> > because it's something you're not granted permission to do?
> >
> > > >A great many people -- myself included but also the Creative Commons
> > > > folks, the FSF, many open source developers, and many others --
> > believe
> > > > the current system of copyright law to be fundamentally flawed.
> >
> > > And, I doubt that the organizations you site actually agree with you.
> >
> > I have personally spoken to both Larry Lessig (Creative Commons) and
> > Richard
> > Stallman (FSF) on the subject, and feel confident in saying that both
> > agree
> > with the distinction.  Lessig doesn't feel it's an issue worth pursuing
> > when
> > there are bigger fish to fry.  I respectfully disagree.
> >
> > > >Not that we shouldn't have copyright, but that the current form of
> > > > copyright is broken.  A work restricted for an entire generation after
> > > > the
> > > >original author is
> > > >dead?
> > >
> > > What about descendants of the author? When anyone dies, their
> > > descendants have a rightful claim on their parent's assets -- it been
> > > that way since the dawn of mankind. Do you think you know better than
> > > the practice of thousands of generations?
> >
> > Actually no, property law didn't really come in until civilization, some
> > 5000
> > years ago, which is rather small on the scale of "dawn of mankind".  And
> > copyright didn't exist until perhaps 5 centuries ago in England, and
> > covered
> > just publication, and was for less than 20 years.  Copyright being long
> > enough term for inheritance to matter is less than a century.  Over the
> > scale
> > of human history, unrestricted information flow has been the rule, not the
> > exception.
> >
> > But what you're suggesting is that legalized extortion should be
> > inheritable.
> > Copyright is, fundamentally, legalized extortion as a means of "promoting
> > the
> > progress of Science and the Useful Arts".  Do you keep paying the guy who
> > built your TV every time you watch something on it?  Do you keep paying
> > the
> > company that built your house every time you move?  Do you pay your
> > teachers
> > from college every time you use something you learned there?  Do you pay
> > your
&

Re: [PHP] Re: Pirate PHP books online?

2007-07-30 Thread Tijnema
On 7/31/07, Larry Garfield <[EMAIL PROTECTED]> wrote:
> On Monday 30 July 2007, David Powers wrote:
> > Larry Garfield wrote:
> > > copyright infringement is NOT "taking something
> > > without paying for it".  Copyright infringement is duplicating "an
> > > expression of an idea that is fixed in a medium" without the permission
> > > of the copyright holder.  Money doesn't enter into it.
> >
> > If the licence under which the work was released stipulates payment,
> > money does become an integral aspect of any infringement.
> >
> > > If copyright infringement were "taking something without paying for it",
> > > then anyone who's ever installed PHP is guilty of copyright infringement
> > > unless they sent Rasmus a check.  That is, of course, nonsense.
> >
> > This is a nonsensical comparison, because installing PHP is not an
> > infringement of copyright. The PHP licence specifically grants the right
> > to use and distribute PHP, as long as certain conditions are met:
> >
> > http://www.php.net/license/3_01.txt
>
> It's supposed to be a nonsensical comparison. :-)  I was pointing out that
> the "copyright infringement == taking without giving money" statement was
> false because of examples like PHP itself.
>
> > > And the rank-and-file artists and authors of the world do not benefit
> > > from perpetuating that lie.  The current direction the law is moving,
> > > toward more restrictions on the exchange of information, is bad for
> > > anyone who isn't Robert Iger or Britney Spears.  That's why it is
> > > important to confront and correct that lie.  It must be corrected before
> > > copyright can be sanely reformed to benefit the public (its supposed
> > > goal) and original
> > > artists/authors, not a select few mega-corps.
> >
> > Unfortunately, the tactics used by pirates are disproportionately
> > harmful to rank-and-file artists and authors. I don't see the pirates
> > simply going away if and when copyright law is amended.
>
> Nor do I.  Some degree of copyright infringement will always exist, and
> changes in technology increase the ease with which copying (legal or illegal)
> can occur.  The solution, in my opinion, is to revise copyright law such that
> more typical behavior has a better chance of benefiting the original
> author/artist without creating a hostile environment for the the end user.
> That is, make "casual pirates" into customers.
>
> As long as we hold onto the "OMG he copied a CD it's stealing send him to
> prison for a decade!" mentality, though, that cannot happen.  And no, that
> won't do anything about "professional pirates", the groups who duplicate
> illicitly for profit.  I am perfectly happy with them behind bars.

Yeah, put all those "CD Copiers" in jail... LOL, all those "CD
Copiers" would fit in one big jail as big as the whole USA


Tijnema


-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] audio recorder

2007-07-30 Thread Tijnema
On 7/31/07, John Pillion <[EMAIL PROTECTED]> wrote:
> > -Original Message-
> > From: Tijnema [mailto:[EMAIL PROTECTED]
> > Sent: Monday, July 30, 2007 4:25 PM
> > To: John Pillion
> > Cc: php-general@lists.php.net
> > Subject: Re: [PHP] audio recorder
> >
> > On 7/31/07, John Pillion <[EMAIL PROTECTED]> wrote:
> > > Not exactly a php question. but I'm doing the project in php, so does
> > that
> > > count? ;-)
> > >
> > >
> > >
> > > A client of mine wants a simple audio recorder for users to record a
> > short
> > > clip/message for other users. anyone recommend any simple audio recorder
> > > applets or similar that can easily be integrated with php?
> > >
> > >
> > > Thanks!
> > >
> > >
> > > J
> >
> > How do you want to implement it? Where is the microphone connected?
> > Server? Client? or is it a Stand Alone app (CLI)?
>
> [JP>] You guessed right... client side.

:)

>
>
> > If it's connected to the client PC (which I'm guessing), then you
> > can't use PHP for recording it, it needs to be done in a client side
> > language, and if you don't want the client to download an application,
> > you have a few options, but there's only one I can recommend, and that
> > is java. But really, you're not on the right list for that ;)
>
> [JP>] I knew PHP couldn't do it... but I was hoping there was a better
> option than Java.  If not, then so be it I guess. Agreed that this isn't the
> right list for that though ;-)

It might be possible with ASP + ActiveX or something like that, but
then your limiting yourself ;) ASP works only fully on Windows servers
, while the mono project does a good part of implementing it, it's not
perfect yet (neither is the official version from microsoft ;) ).
ActiveX works only with IE browser, and with some kind of hacks it is
possible with FF etc too, but also this is far from perfect (and user
friendly ;) )


>
>
> > If it's connected to the server, or if it's an Stand Alone app, then I
> > would recommend you looking for some software that does record from
> > the microphone, and use it through system, exec, ``, ... functions.
>
> [JP>] Don't want a stand alone app, as I/they want it as simple and user
> friendly as possible.
>
>
> J

Everyone wants that ;)

An example of audio recording in Java:
www.javasonics.com

Or if you're going to write it yourself, you have
a) The Java Sound API (integrated into Java)
b) Java Media FrameWork (http://java.sun.com/products/java-media/jmf)


Tijnema


-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] audio recorder

2007-07-30 Thread Tijnema
On 7/31/07, John Pillion <[EMAIL PROTECTED]> wrote:
> Not exactly a php question. but I'm doing the project in php, so does that
> count? ;-)
>
>
>
> A client of mine wants a simple audio recorder for users to record a short
> clip/message for other users. anyone recommend any simple audio recorder
> applets or similar that can easily be integrated with php?
>
>
> Thanks!
>
>
> J

How do you want to implement it? Where is the microphone connected?
Server? Client? or is it a Stand Alone app (CLI)?

If it's connected to the client PC (which I'm guessing), then you
can't use PHP for recording it, it needs to be done in a client side
language, and if you don't want the client to download an application,
you have a few options, but there's only one I can recommend, and that
is java. But really, you're not on the right list for that ;)

If it's connected to the server, or if it's an Stand Alone app, then I
would recommend you looking for some software that does record from
the microphone, and use it through system, exec, ``, ... functions.


Tijnema

-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Rules of Engagement

2007-07-28 Thread Tijnema
On 7/29/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
>As a relatively-new contributor to this list (read: under 2
> years), I realize that I have no business requesting a change, but
> I'll breech etiquette and hope for the best.
>
>Can we update the filters on the list to have the reply-to address
> header marked to the php-general address?  The reason I ask this is
> because, when people are on vacation (such as Juan is now), we receive
> responses to our personal addresses.  Secondly, we have to continually
> "Reply All" the messages, which - though it's not a problem - can
> cause issues when attempting to respond to those "[URGENT]" replies.
> Third, our addresses are included in gmane, et al, which is an
> inherent risk --- I understand.
>
>Maybe it's just the ramblings of someone attempting to read and
> type on a limited-bandwidth mobile device while bored due to delays in
> mass-transit facilities (here, read: I'm fucking exhausted, and yes, I
> dropped the "F" bomb).  In either case, it's not conducive to a new
> contributor to have to weed through "vacation response" messages each
> time he/she replies to the list.
>
> 


Uhm, about that vacation response, it will only make things worser, as
then email sent to a user with a vacation message, will send a message
back to the list, which will be addressed to everyone on the list :P

Tijnema

-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Re: The Official OT "Name Tedd's Grandson" Thread

2007-07-27 Thread Tijnema
On 7/27/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
> On Fri, July 27, 2007 7:35 am, Tijnema wrote:
> > It's quite logical that it is done this way, if you understand how a
> > mailing lists works ;)
> >
> > When you send a email to the mailing list, you send it without [PHP],
> > and so Gmail thinks that's the message title. Once it arrives at the
> > mailing list server, the server adds [PHP] in front of the title, and
> > sends it to all subscribed members. All members that receive this
> > message, get the message with [PHP] in front. Now when somebody
> > replies to the list, the title will be something like Re: [PHP] Title.
> > Now when gmail detects that this message still belongs to the same
> > thread, it adds the message, and keeps the original title. Which is
> > Title for the OP, and [PHP] Title for all other users.
>
> Then when a gmail user Cc:s me, I get a bunch of stuff in my Inbox
> WITHOUT the [PHP] and WITHOUT the list headers, so it doesn't get
> sorted properly into the PHP-General folder in my client. :-( :-( :-(


That's a problem of the list, this list requires users to press the
"Reply to all" button, or manually add the php list in the To or CC
box. I'm on a few other lists where a simple press on the "Reply"
button sends the message to the list, and not CCing anyone. (Reply-To
header is set to the list address)

Tijnema

-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Re: The Official OT "Name Tedd's Grandson" Thread

2007-07-27 Thread Tijnema
On 7/27/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
> On Thu, July 26, 2007 8:47 am, Daniel Brown wrote:
> > On 7/26/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> >>  or am I going retarded again?
> >
> >
> > This has been confirmed.  For whatever reason, Gmail isn't showing
> > me the [PHP] mark in the subject for this thread.  Perhaps because I'm
> > the OP.
>
> I dunno what they are thinking to rip out the [PHP] whether it's on
> threads you started or not.
>
> Do they expect that you actually remember something you typed
> yesterday as a thread you started?
>
> Sheesh!
>
> Nobody does that.
>
> .
> .
> .
>
> Okay, so maybe that's just me.
> :-)
>

It's quite logical that it is done this way, if you understand how a
mailing lists works ;)

When you send a email to the mailing list, you send it without [PHP],
and so Gmail thinks that's the message title. Once it arrives at the
mailing list server, the server adds [PHP] in front of the title, and
sends it to all subscribed members. All members that receive this
message, get the message with [PHP] in front. Now when somebody
replies to the list, the title will be something like Re: [PHP] Title.
Now when gmail detects that this message still belongs to the same
thread, it adds the message, and keeps the original title. Which is
Title for the OP, and [PHP] Title for all other users.

Tijnema
-- 
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Is it possible to stop an image from being cached?

2007-07-26 Thread Tijnema

On 7/27/07, Dan <[EMAIL PROTECTED]> wrote:

Is this header you're refering to the header of the page which contains the
image, or the image itself?

- Dan


The image itself.

Also note, that if you use my solution 2, you still might get
problems, as the page that is calling might be cached, and in the
cached page, it refers to the image with the same unique code, and it
will use the cached image again.

Also, if you use solution 2, the image will still stay forever in the
temp folder of the browser(unless the user is cleaning it). If you use
solution 1, the browser will keep it only for this page, and will
remove it afterwards.

Tijnema


"Tijnema" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 7/27/07, brian <[EMAIL PROTECTED]> wrote:
>> Tijnema wrote:
>> > On 7/26/07, Dan <[EMAIL PROTECTED]> wrote:
>> >
>> >> I have a situation where there is a single image let's call it
>> >> somebody.jpg.
>> >> I want to be able to dynamicly create this image using php, basicilly
>> >> I have
>> >> PHP set to handle .jpg files also, so I then go through and create an
>> >> image
>> >> based upon some info I get from a database call and then use
>> >> header('Content-Type: image/jpeg');
>> >> passthru($file);
>> >> to send the image to the user.
>> >>
>> >> My problem is once they view the image their browser "helpfully"
>> >> caches it
>> >> so they don't have to download it again.
>> >>
>> >> Is there any tactic short of changing the name constantly of the image
>> >> to
>> >> avoid browser caching of an image?
>> >>
>> >> - Dan
>> >
>> >
>> > Solution 1:
>> > Send a header() that avoids caching (can't remember it exactly)
>>
>> You can try:
>>
>> header('Cache-Control: no-store, no-cache, must-revalidate,
>> Post-Check=0, Pre-Check=0');
>>
>> brian
>
> That's HTTP/1.1 only, but this is what I got from PHP site:
>  header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
> header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
> ?>
>
> Tijnema
>
> --
> Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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





--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Is it possible to stop an image from being cached?

2007-07-26 Thread Tijnema

On 7/27/07, Chris Aitken <[EMAIL PROTECTED]> wrote:

>> header('Cache-Control: no-store, no-cache, must-revalidate,
>> Post-Check=0, Pre-Check=0');
>>
>> brian
>
>That's HTTP/1.1 only, but this is what I got from PHP site:
>header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
>header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
>?>
>

But wouldn't that make every image on the page be uncached and reloaded each
time? Not very efficient if the shell of the site keeps getting loaded if
only 1 or 2 images need to be forced.




Regards


Chris Aitken
The Web Hub Designer and Programmer
Phone : 02 4648 0808
Mobile : 0411 132 075



Yes, that depends on which way it is used, I wouldn't recommend
loading images from the database that don't get changed...
And you can of course also use an
if-statement/switch-statement/in_array function in your image.php
script, like this:

$img = $_GET['img'];
if($img == "test_a.jpg" || $img == "test_b.jpg") {
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
}

OR:

$img = $_GET['img'];
switch($img) {
case "test_a.jpg":
case "test_b.jpg":
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
}

OR:

$img = $_GET['img'];
$noncached_images = array("test_a.jpg","test_b.jpg");
if(in_array($img,$noncached_images)) {
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
}



Tijnema

--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Is it possible to stop an image from being cached?

2007-07-26 Thread Tijnema

On 7/27/07, brian <[EMAIL PROTECTED]> wrote:

Tijnema wrote:
> On 7/26/07, Dan <[EMAIL PROTECTED]> wrote:
>
>> I have a situation where there is a single image let's call it
>> somebody.jpg.
>> I want to be able to dynamicly create this image using php, basicilly
>> I have
>> PHP set to handle .jpg files also, so I then go through and create an
>> image
>> based upon some info I get from a database call and then use
>> header('Content-Type: image/jpeg');
>> passthru($file);
>> to send the image to the user.
>>
>> My problem is once they view the image their browser "helpfully"
>> caches it
>> so they don't have to download it again.
>>
>> Is there any tactic short of changing the name constantly of the image to
>> avoid browser caching of an image?
>>
>> - Dan
>
>
> Solution 1:
> Send a header() that avoids caching (can't remember it exactly)

You can try:

header('Cache-Control: no-store, no-cache, must-revalidate,
Post-Check=0, Pre-Check=0');

brian


That's HTTP/1.1 only, but this is what I got from PHP site:


Tijnema

--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Is it possible to stop an image from being cached?

2007-07-26 Thread Tijnema

On 7/26/07, Dan <[EMAIL PROTECTED]> wrote:

I have a situation where there is a single image let's call it somebody.jpg.
I want to be able to dynamicly create this image using php, basicilly I have
PHP set to handle .jpg files also, so I then go through and create an image
based upon some info I get from a database call and then use
header('Content-Type: image/jpeg');
passthru($file);
to send the image to the user.

My problem is once they view the image their browser "helpfully" caches it
so they don't have to download it again.

Is there any tactic short of changing the name constantly of the image to
avoid browser caching of an image?

- Dan


Solution 1:
Send a header() that avoids caching (can't remember it exactly)
Solution 2:
Call the image like this:

Or if you were creating it with a php script:


Tijnema

--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Re: Pirate PHP books online?

2007-07-26 Thread Tijnema

On 7/26/07, Stut <[EMAIL PROTECTED]> wrote:

Man-wai Chang wrote:
> You could open a sample book in bookstores, scan the chapters to
> decide whether you are gonna buy it.

Not even slightly relevant, but it made me think of this (seemingly
neverending) thread.

http://xkcd.com/294/

-Stut



Haha, good one stut!

Tijnema

--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Re: Pirate PHP books online?

2007-07-26 Thread Tijnema

On 7/26/07, Daniel Brown <[EMAIL PROTECTED]> wrote:

On 7/26/07, Tijnema <[EMAIL PROTECTED]> wrote:
> On 7/26/07, Stut <[EMAIL PROTECTED]> wrote:
> > Man-wai Chang wrote:
> > > You could open a sample book in bookstores, scan the chapters to
> > > decide whether you are gonna buy it.
> >
> > Not even slightly relevant, but it made me think of this (seemingly
> > neverending) thread.
> >
> > http://xkcd.com/294/
> >
> > -Stut
> >
>
> Haha, good one stut!
>
> Tijnema
>
> --
> Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

   Christ, I'm the 100th post in this thread and this is even
after it forked a couple of times.


Hmm, I think you've missed some, mine was #201 according to Gmail :P
This one is #202..

Tijnema

--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Re: The Official OT "Name Tedd's Grandson" Thread

2007-07-26 Thread Tijnema

On 7/26/07, Ford, Mike <[EMAIL PROTECTED]> wrote:

On 26 July 2007 16:10, M. Sokolewicz wrote:

> Daniel Brown wrote:
> > On 7/26/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> > >  or am I going retarded again?
> >
> >
> >This has been confirmed.  For whatever reason, Gmail isn't
> > showing me the [PHP] mark in the subject for this thread.  Perhaps
> > because I'm the OP.
> >
> >/me shrugs.
> >
>
> It's not the only, about 50% of threads have it, and another 50%
> don't. For instance, the DOM thread does not have it, this thread has
> it in between Re:'s, Hide the real URL has it, Pirate PHP books
> doesn't, etc.

What are you talking about??? That has to be an artifice of Gmail (and other 
clients?) -- every single message I've seen in every one of those topics has 
the [PHP] marker, just not always in exactly the same place:

  [PHP] About DOM function in PHP
  Re: [PHP] About DOM function in PHP
  [PHP] Re: About DOM function in PHP
  Re: [PHP] Re: About DOM function in PHP

  [PHP] Pirate PHP books online?
  Re: [PHP] Pirate PHP books online?
  [PHP] Re: Pirate PHP books online?
  Re: [PHP] Re: Pirate PHP books online?
  [PHP] Re: Re: Pirate PHP books online?
  Re: [PHP] Re: Re: Pirate PHP books online?
  Re[2]: [PHP]  Re: Pirate PHP books online?
  Re: Re[2]: [PHP]  Re: Pirate PHP books online?

I think I can kinda see a logic in there to do with a combination of smart and 
dumb email clients, and when the PHP list server adds a [PHP] marker, but I 
leave it as an exercise for the reader to figure out what it is... ;)

Bottom line, the [PHP] marker *is* there on every message, and if you're not 
seeing it it's 'cos your client is (for whatever reason) stripping it.

Cheers!

Mike



The only threads were [PHP] is missing for me are the threads that I started.
All others start with [PHP] or Re: [PHP]

Tijnema

--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Re: header( 'refresh' ), form data, and IE

2007-07-25 Thread Tijnema

On 7/25/07, Daniel Brown <[EMAIL PROTECTED]> wrote:

On 7/25/07, Tijnema <[EMAIL PROTECTED]> wrote:
> You Dans driving me insine with all those dans :P
>
> Tijnema
> --
> Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info
>

   Be jealous and afraid.  It's not just a name it's a race.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107



Oh, Ok, let me change my nick


- Daniel

--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Re: header( 'refresh' ), form data, and IE

2007-07-25 Thread Tijnema

On 7/25/07, Daniel Brown <[EMAIL PROTECTED]> wrote:

On 7/24/07, Daniel Kasak <[EMAIL PROTECTED]> wrote:
> On Tue, 2007-07-24 at 08:13 -0400, Daniel Brown wrote:
>
> > Hello, Dans!
> >
> > Dan K., is there any reason the validation can't reside within the
> > same script as the form, then forward on success?  A very simple
> > example:
> >
> >  > if($_POST) {
> > // Check to ensure that your variables are all correct,
> > // then use header("Location: successful-target.php?var1=a&var2=b");
> > // And then, on forwarding, remember to exit;
> > }
> > ?>
> > 
> > 
> > 
> > 
> > 
> >
> > Since the user will start with a blank form, and the $_POST values
> > won't already be set, the values in the form will be blank on the
> > initial page load, but for unsuccessful attempts, they'll be populated
> > with the correct data.
> >
> > ~ Dan^[3]
> >
>
> I've completely changed the way I was doing this now. Initially I
> implemented lots of checks for NULL values, as Dan[2] recommended, and
> this worked well apart from in the case of text areas. These broke
> things completely. I've now decided to shove all form data into session
> globals, and just refresh with a 'load_previous' flag in the URL. I my
> form constructor sees this flag, it populates things from session
> globals. Otherwise it resets the session globals with defaults.
>
> This seems to be the best solution ( ie the only one that's worked
> completely so far ).
>
> Thank you, both of you. Long live Dans!
>
> --
> Daniel Kasak
> IT Developer
> NUS Consulting Group
> Level 5, 77 Pacific Highway
> North Sydney, NSW, Australia 2060
> T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
> email: [EMAIL PROTECTED]
> website: http://www.nusconsulting.com.au
>
>

   Viva Danielism!

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107


You Dans driving me insine with all those dans :P

Tijnema
--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] How can I install GD support for a php rpm

2007-07-24 Thread Tijnema

On 7/24/07, Davis Chan <[EMAIL PROTECTED]> wrote:

Hi! My php was installed as a module (libphp5.so) when I install Fedora
Core 6. However, when I run phpinfo(), I found that it is -without-gd. I
would like to ask how can add GD support without rebuilding the whole
thing from source? Thanks.


Build only the GD module from the PHP package, and add that to the
modules to load in php.ini

Tijnema


--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Re: header( 'refresh' ), form data, and IE

2007-07-24 Thread Tijnema

On 7/24/07, Daniel Brown <[EMAIL PROTECTED]> wrote:

On 7/23/07, Daniel Kasak <[EMAIL PROTECTED]> wrote:
> Thanks for the response Dan. Us Dans have to stick together :)
>
> On Mon, 2007-07-23 at 17:37 -0700, Dan wrote:
>
> > Then validate the field obviously!
> > $description = "";
> > $categoryid = "";
> >
> > if(isset($_POST['description']))
> > $description = "?description=$_POST['description']";
> >
> > if(isset($_POST['categoryid']))
> > {
> > if($description != "") $categoryid = "&"; else $categoryid = "?";  // if a
> > description has been entered you'll need an & symbol otherwise a ?
> > $category .= "categoryid=$_POST['categoryid']";  // append category to
> > itself with the posted info
> > }
>
> H. Yeah I thought it would come to that. I was hoping for a quick &
> nasty fix.
>
> > I didn't test this it's just off the top of my head, also you should
> > sanitize the input before you do anythign with it really, but that's another
> > issue.  Also this is really something that you should be doing with ajax
> > rather than having the page reloading, and passing variables back, etc.
> > This is the EXACT purpose that Ajax as made for, validation of info.  Check
> > out XAJAX it's very simple to use but powerfull when you need it.
>
> I will try to make some time for investigating ajax. I'm mostly
> developing in Perl, and doing nice GUI stuff ( ie no web stuff - this is
> a once-off maintenance thing ), so I'll a little out of my comfort
> zone ...
>
> Thanks again for your help.
>
> --
> Daniel Kasak
> IT Developer
> NUS Consulting Group
> Level 5, 77 Pacific Highway
> North Sydney, NSW, Australia 2060
> T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
> email: [EMAIL PROTECTED]
> website: http://www.nusconsulting.com.au
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

   Hello, Dans!

   Dan K., is there any reason the validation can't reside within the
same script as the form, then forward on success?  A very simple
example:








   Since the user will start with a blank form, and the $_POST values
won't already be set, the values in the form will be blank on the
initial page load, but for unsuccessful attempts, they'll be populated
with the correct data.

   ~ Dan^[3]

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107




Note that if you have E_NOTICE set in error reporting level, then this
gives some warnings about undefined variables!

Tijnema

--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Re: Pirate PHP books online?

2007-07-24 Thread Tijnema

On 7/24/07, Michelle Konzack <[EMAIL PROTECTED]> wrote:

Am 2007-07-19 19:41:32, schrieb Tijnema:
> One word:
> Useless!
>
> The watermark can be easily removed, and the guy who puts in on the
> net will simply remove it, and can't be traced :)

Not realy except you know the WHOLE original text.

I would put some weird (unknown) phrases into the text..

Greetings
   Michelle Konzack
   Systemadministrator
   Tamay Dogan Network
   Debian GNU/Linux Consultant



See this example:
http://rapidshare.com/files/44831440/watermark_text.pdf

This is a simple watermark inside a PDF, I tried it with my OCR
reader, and it parsed the text about warez (from wikipedia) fine,
without reading the watermark.

Tijnema


--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Re: Re: Pirate PHP books online?

2007-07-22 Thread Tijnema

On 7/22/07, Dotan Cohen <[EMAIL PROTECTED]> wrote:

On 22/07/07, Tijnema <[EMAIL PROTECTED]> wrote:
> Ebooks are free (in the name of warez).
> Now to not start this thread all over again, but, Authors, if you
> think you can't make enough money because of the warez, stop writing
> the books ;)

For you, I hope that they do stop. Then you can go cry that PHP is
dificult to learn because there are no resources. Go pay for ASP or
better yet, pay a real programmer to write php for you.

Dotan Cohen


I would love to see that :)

Tijnema

--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Re: Re: Pirate PHP books online?

2007-07-22 Thread Tijnema

On 7/21/07, Michelle Konzack <[EMAIL PROTECTED]> wrote:

Am 2007-07-17 09:17:27, schrieb tedd:
> That's you -- I need hard copy to look through. I want to feel and
> see the book, put sticky notes on it and use it as reference later.

Me too...


I prefer ebooks, you can search through it in a second, it takes hours
to find something in a hard copy :(



> Last year I spent more money on books than I did on hardware.

Me too...


Hmm, never :P
Ebooks are free (in the name of warez).
Now to not start this thread all over again, but, Authors, if you
think you can't make enough money because of the warez, stop writing
the books ;)

Tijnema


Greetings
   Michelle Konzack
   Systemadministrator
   Tamay Dogan Network
   Debian GNU/Linux Consultant







--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Bundled GD compiling?

2007-07-22 Thread Tijnema

On 7/22/07, Hayden Livingston <[EMAIL PROTECTED]> wrote:

I'm confused as to certain issues regarding the bundled version.

The documentation says::

"To use the recommended bundled version of the GD library (which was
first bundled in PHP 4.3.0), use the configure option --with-gd. GD
library requires libpng and libjpeg to compile."

"Note:  When compiling PHP with libpng, you must use the same version
that was linked with the GD library."

This (to me) seems ambiguous. How am I suppose to know which libpng
the bundled GD library used? So how should I configure?

http://www.libgd.org/FAQ_PHP

"./configure --with-gd -with-png-dir=/usr --with-jpeg-dir=/usr
--with-freetype-dir=/usr'"

The FAQ says this is "all" the features?

Thanks a bunch.


THe bundled version of GD isn't compiled yet, it is the source code
that is bundled, and GD will be compiled when you compile PHP, and so
it will be allways the same libpng for GD and PHP :)

Tijnema

--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] session_decode from session handler

2007-07-22 Thread Tijnema

On 7/22/07, Jeffery Fernandez <[EMAIL PROTECTED]> wrote:

On Sunday 22 July 2007 14:19, Jeffery Fernandez wrote:
> I have a similar problem I am facing with session data stored in the
> database from the set_session_handler.
>
> What I am trying to do is show a list of online users and the page they are
> currenlty viewing. For this purpose I am query the sessions table to get
> the list of session and from that I loop through to get the session data of
> each online user. But for some reason, I cannot decode/un-serialise the
> session data. Any pointers ?

just following up on this problem. I am using PHP 5.2.3. I also do remember
that previously in older versions of PHP, I used to see the session data was
the actual serialised data. But now with my testing it just seems to be one
long string. Which leads me to beleive that there is some kind of encoding
taking place.


Please start a new thread about your problem, it might be related, but
not the same.

Tijnema


>
> cheers,
> Jeffery
>
> On Friday 20 July 2007 08:25, Ryan Graciano wrote:
> > PHP passed $data to my write($id) function, and then I wrote it to the
> > database.  In the code below, I have retrieved it from the database.  I
> > presume that it used encode_session to generate $data.
> >
> > I tried calling unserialize() on it for good measure, but it wasn't able
> > to parse the data.  When I return $data from my method, though, PHP is
> > able to turn it into a $_SESSION.
> >
> > Thanks,
> > - Ryan
> >
> > - Original Message 
> > From: Tijnema <[EMAIL PROTECTED]>
> > To: Ryan Graciano <[EMAIL PROTECTED]>
> > Cc: php-general@lists.php.net
> > Sent: Thursday, July 19, 2007 5:28:32 PM
> > Subject: Re: [PHP] session_decode from session handler
> >
> > On 7/19/07, Ryan Graciano <[EMAIL PROTECTED]> wrote:
> > > I'm having an issue getting session_decode to work from my session
> > > handler in PHP 5.2.3.  Here's a short code snippet that demonstrates
> > > what I'm trying to do (from my read handler) -
> > >
> > > public function read($id) {
> > > 
> > > var_dump($data);  // prints out the serialized session correctly
> > > $retval = session_decode($data);
> > > var_dump($_SESSION);  // prints out "array(0) {}"
> > > echo $retval;  // prints false
> > > return $data;
> > > }
> > >
> > > In my calling function, $_SESSION is updated with everything that was
> > > held in $data, which means that $data was not corrupt - it worked when
> > > I returned it, but it did not work when I used session_decode.  This is
> > > a problem because I want to change my read($id) function so that it
> > > decodes $data, adds something extra to the $_SESSION, then re-encodes
> > > $data and returns it.
> > >
> > > Thanks,
> > > - Ryan
> >
> > How did you get $data?
> >
> > If it's just serialized data, you can simply call unserialize instead
> > of session_decode.
> >
> > Tijnema
>
> --
> Powered by openSUSE 10.2 (i586) Kernel: 2.6.18.8-0.5-default
> KDE: 3.5.5 "release 45.4"
>   2:19pm  up 11 days 18:32,  7 users,  load average: 0.42, 0.58, 0.54

--
Powered by openSUSE 10.2 (i586) Kernel: 2.6.18.8-0.5-default
KDE: 3.5.5 "release 45.4"
 2:24pm  up 11 days 18:38,  7 users,  load average: 0.45, 0.42, 0.47





--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Pirate PHP books online?

2007-07-20 Thread Tijnema

On 7/21/07, Dotan Cohen <[EMAIL PROTECTED]> wrote:

On 20/07/07, Tijnema <[EMAIL PROTECTED]> wrote:
> > An additional benefit is that there are those who _prefer_ the
> > electronic version to the dead trees. At least, I do.
> >
> > Dotan Cohen
>
> Old paper can be recycled, lost energy from computers can't ;)
>
> Tijnema
>

My reference to dead trees was not meant to imply an environmental
reasoning behind my preference. But, if you insist, then the 'lost
energy' is actually heating my workroom in winter. That means that I
don't need to run a heater.

Dotan Cohen


And it runs the airco in the summer ;)

Tijnema

--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Pirate PHP books online?

2007-07-20 Thread Tijnema

On 7/20/07, Dotan Cohen <[EMAIL PROTECTED]> wrote:

On 19/07/07, Zoltán Németh <[EMAIL PROTECTED]> wrote:
>
> I didn't want to get involved in this thread, though it was interesting
> to read...
> However, an idea just came into my mind: what if you, as the author,
> could offer a download for a price which would be the same as what you
> get after a sold paper copy? According to what you just said, it would
> be much cheaper for the download than for a paper copy, which might
> cause more or less of the downloaders of the pirated file to download it
> legally and pay this smaller price to you.
> I admit that it won't stop pirating, but it might be good for those who
> are willing to pay to you, but either can't afford the paper copy or are
> not willing to pay to the publishing company - and it might increase
> your revenues a bit too.
>
> greets
> Zoltán Németh
>

An additional benefit is that there are those who _prefer_ the
electronic version to the dead trees. At least, I do.

Dotan Cohen


Old paper can be recycled, lost energy from computers can't ;)

Tijnema

--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] session_decode from session handler

2007-07-19 Thread Tijnema

On 7/19/07, Ryan Graciano <[EMAIL PROTECTED]> wrote:


I'm having an issue getting session_decode to work from my session handler in 
PHP 5.2.3.  Here's a short code snippet that demonstrates what I'm trying to do 
(from my read handler) -

public function read($id) {

var_dump($data);  // prints out the serialized session correctly
$retval = session_decode($data);
var_dump($_SESSION);  // prints out "array(0) {}"
echo $retval;  // prints false
return $data;
}

In my calling function, $_SESSION is updated with everything that was held in 
$data, which means that $data was not corrupt - it worked when I returned it, 
but it did not work when I used session_decode.  This is a problem because I 
want to change my read($id) function so that it decodes $data, adds something 
extra to the $_SESSION, then re-encodes $data and returns it.

Thanks,
- Ryan


How did you get $data?

If it's just serialized data, you can simply call unserialize instead
of session_decode.

Tijnema

--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] repetition of tedious references

2007-07-19 Thread Tijnema

On 7/19/07, tedd <[EMAIL PROTECTED]> wrote:

At 2:24 PM +0200 7/18/07, Olav Mørkrid wrote:
>consider the following statement:
>
>$language =
>isset($_SERVER["HTTP_ACCEPT_LANGUAGE"]) &&
>$_SERVER["HTTP_ACCEPT_LANGUAGE"] != "" ?
>$_SERVER["HTTP_ACCEPT_LANGUAGE"] : "*";
>
>when using strings in arrays that may be non-existing or empty, you
>have to repeat the reference  *three* times, which gets excessive and
>unreadable.
>
>is there any way to only have to write
>$_SERVER["HTTP_ACCEPT_LANGUAGE"] only once?
>
>i know it's possible to supress "is not set" with @, but that just
>seems wrong in case there really is an error in the statement.
>
>i love php, but this is one of my pet peeves.

Olav:

Mine too.

But, Rasmus gave me this:

 $action = isset($_GET['action']) ? $_GET['action'] : null;

Which could be translated to:

 $language = isset
($_SERVER["HTTP_ACCEPT_LANGUAGE"]) ?
($_SERVER["HTTP_ACCEPT_LANGUAGE"]) : "*";

I think that might help.

Anyone see a problem with it?

Cheers,

tedd
--


Yes,what if the key does exists, but is empty?
Then it should fallback to the default value, which is exactly what
the OP script did, and what yours does too when you add != ""
statement, or empty().

Tijnema
--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Pirate PHP books online?

2007-07-19 Thread Tijnema

On 7/19/07, Austin Denyer <[EMAIL PROTECTED]> wrote:

Jim Moseby wrote:
>> The problem with that, though, is that a lot of publishers require
>> exclusivity, so an author is bound (no pun intended) by contract not
>> to publish elsewhere - including on their own website.
>>
> The idea of even offering an electronic version should be to drive sales for
> the hard copy. Maybe offer a "Condensed Version" electronically, that has
> enough content that readers can get enough of a feel for the product to
> drive a buying decision. Throughout, make reference to the full version
> having more complete content, complete with an "order now" link.  This
> method worked well for Readers Digest!

Or watermark the .pdf with something that uniquely identifies each copy
- this could be done with a script at the time of the order.  Maybe the
name of the original buyer, or the order number, etc.

Doesn't prevent the piracy, but does give traceability should you wish
to pursue the pirate.

Regards,
Austin.


One word:
Useless!

The watermark can be easily removed, and the guy who puts in on the
net will simply remove it, and can't be traced :)

Tijnema
--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Re: Pirate PHP books online?

2007-07-18 Thread Tijnema

I didn't read the full thread (because it is 80 emails...)

But really, it isn't special that these books are found on the net,
and you really can't stop them, nor can the author of the book.

With a quick search, I found these books related to PHP(all "free" to download):
Beginning Ajax with PHP: From Novice to Professional

Professional Search Engine Optimization with PHP: A Developer's Guide to

PHP 5 Advanced: Visual QuickPro Guide

Programming PHP 2nd

Professional Search Engine Optimization with PHP: A Developer's

Advanced PHP for Web Professionals

PHP Solutions: Dynamic Web Design Made Easy

Beginning PHP, Apache, MySQL Web Development

Wrox Professional Search Engine Optimization with PHP Apr 2007

Textpattern Solutions: PHP-Based Content Management Made Easy

Beginning PHP and PostgreSQL E-Commerce: From Novice to Professional

PHP 5 Advanced: Visual QuickPro Guide

Foundations of PEAR: Rapid PHP Development

PHP Developer's Cookbook (2nd)

Beginning PHP and PostgreSQL E-Commerce: From Novice to Professional

Pro PHP Security

Pro PHP XML and Web Services

Sams Teach Yourself PHP, MySQL and Apache (3rd)

Foundations of PEAR: Rapid PHP Development

Object-Oriented PHP: Concepts, Techniques, and Code

Foundation PHP 5 for Flash

PHP for the World Wide Web, Second

PHP & MySQL for Dummies 3r

Beginning Google Maps Applications with PHP and Ajax

Practical PHP and MySQL: Building Eight Dynamic Web Applications

Web Database Applications with PHP & MySQL

Advanced PHP Programming

Delphi 2007 PHP

Beginning PHP4

Web Applications Development With PHP

PHP & MySQL Web Development

Dynamic Site with PHP & MySQL

Building PHP Applications With Macromedia Dreamweaver MX

Learning PHP and MySQL

Core PHP Programming for Web Proffessionals

Advanced PHP for Web Professionals

PHP Solutions Dynamic Web Design Made Easy

Core Web Application Development with PHP and MySQL

How to Do Everything with PHP & MySQL

PHP Manual

Web Application Development With Php4

OReilly PHP Cookbook 2nd Edition Aug2006

PHP5 and MySQL Bible (2004)



need one?

Tijnema

--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Re: Encrypted Mail

2007-07-18 Thread Tijnema

On 7/18/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:


Please read the attachment to get the message.


 Attachment: No Virus found
 Norman AntiVirus - www.norman.com



In my mail(Gmail), there's no mail, I think it's blocked by the PHP
list (maybe because of incorrect MIME-type?)

Tijnema

--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: Re[4]: [PHP] Newbie seeks urgent help

2007-07-13 Thread Tijnema

On 7/14/07, Luc <[EMAIL PROTECTED]> wrote:

Hello Tijnema,

Friday, July 13, 2007, 10:09:05 PM, you wrote:

> You're using a ' here, which ends the string. Use one of these:
> $websitetitle = "John Doe's Site";
> OR
> $websitetitle = 'John Doe\'s Site';
> Just a matter of preference ;)

Thanks Tijnema

But still get:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE,
expecting T_STRING or T_VARIABLE or T_NUM_STRING in / on line 14

So i still don't have a clue what i could have snipped and if i have
everything in the correct order.


--
Best regards,
 Luc


You must have some unclosed single quote ( ' ) somewhere, on one of
these lines probably:
$youremail =
$websitetitle =
$thankyoupage =

For test, leave all of them empty and see if the error is still
popping up, if not, fill them back in one by one and see which one
causes the error,

OR

Use a IDE (like Adobe Dreamweaver), and with the color coding you'll
see directly where the fault is :)

Tijnema

ps. This is my last reply for today, as it is 3:45 AM here ;)  Just
try some things...

--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: Re[2]: [PHP] Newbie seeks urgent help

2007-07-13 Thread Tijnema

On 7/14/07, Luc <[EMAIL PROTECTED]> wrote:

Hello Daniel,

Friday, July 13, 2007, 5:50:53 PM, you wrote:

> In your code, all you have is this:

Unfortunately it doesn't work, probably because of my lack of php
skills :-) I copied and paste your solution as follows:



You're using a ' here, which ends the string. Use one of these:
$websitetitle = "John Doe's Site";
OR
$websitetitle = 'John Doe\'s Site';
Just a matter of preference ;)



// Path to "thanks for the message" page
$thankyoupage = './Contact_success1.php';
// Send notification to sender (use false if not required)
$sendnotification = true;
   $subjectline = "Orçamento de empresa";
   $body =<<

which gives the following error:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE,
expecting T_STRING or T_VARIABLE or T_NUM_STRING in / on line 14

--
Best regards,
 Luc


It's defenitely not line 14, but you probably snipped some stuff out of it ;)

Tijnema


--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] mail function from and reply to address problem

2007-07-13 Thread Tijnema

On 7/13/07, Tanner Postert <[EMAIL PROTECTED]> wrote:

figured it out...

the domain in question's dns is set to CNAME to the main domain on that
server, whereas, the remaining domains are just using the A record with the
IP. I changed one of the other domains to use the CNAME and it did the same
thing. So looks like thats the culprit.

I'll have to comb through the sendmail configuration and find out if I can
reverse this behavior.


Sendmail has a usenet newsgroup (comp.mail.sendmail), where you might
be able to find someone that can help you :)

Tijnema


On 7/13/07, Tanner Postert <[EMAIL PROTECTED]> wrote:
>
> mail function returns 1(true) whether or not i'm sending to the new
> virtual host domain name or any random domain name.
>
> turns out sendmail function does the same thing, so it looks like it's a
> sendmail problem... but how is that possible if i've never configured
> anything for this new domain except for http virtual host config? hmm.
>
> On 7/13/07, Tanner Postert <[EMAIL PROTECTED]> wrote:
> >
> > apache is definitely listed in the trusted users, as I mentioned, I can
> > send from dozens of other domains, its just one specific domain that I
> > can't. i'll let you know the results of sending the email from outside of
> > php.
> >
> > On 7/12/07, Chris < [EMAIL PROTECTED]> wrote:
> > >
> > > Richard Lynch wrote:
> > > > On Thu, July 12, 2007 6:33 pm, Tanner Postert wrote:
> > > >> I am currently running
> > > >>
> > > >> PHP 5.1.4
> > > >> Fedora Core 5
> > > >>
> > > >> i'm trying to exectute the following test script.
> > > >>
> > > >>  > > >> $to  = '[EMAIL PROTECTED]';
> > > >> $subject = 'the subject';
> > > >> $message = 'body';
> > > >> $headers = 'From: [EMAIL PROTECTED]' . "\r\n" .
> > > >> 'Reply-To: [EMAIL PROTECTED]' . "\r\n" .
> > > >> 'X-Mailer: PHP/' . phpversion();
> > > >>
> > > >> mail($to, $subject, $message, $headers);
> > > >> ?>
> > > >
> > > > You really ought to be getting the return value from mail() and
> > > > checking it for success...
> > > >
> > > > Error-checking is good. :-)
> > > >
> > > >> i have about 10 or so different virtual hosts running on this
> > > machine,
> > > >> and
> > > >> if i use any of them for the from & reply-to addresses, it works
> > > fine,
> > > >> or
> > > >> even if i use domains I don't control like aol.com or example.com
> > > >> those work
> > > >> too, but one particular new virtual host doesn't work, it re-writes
> > > >> the from
> > > >> address to the default virtual host address. which is strange
> > > because
> > > >> that
> > > >> isn't in the php.ini anywhere, but it could just be taking the
> > > >> hostname.
> > > >>
> > > >> anyone have any ideas?
> > > >
> > > > As I understand it:
> > > >
> > > > If the PHP (read: Apache) User is not "trusted" in sendmail config,
> > > > then sendmail won't let that user forge the return headers, and the
> > > > return comes from the default set in sendmail configuration.
> > >
> > > Which is mentioned in the documentation:
> > >
> > > http://www.php.net/manual/en/function.mail.php
> > >
> > > ;)
> > >
> > > Sendmail and exim definitely have this sort of problem, I don't think
> > > postfix or qmail do though.
> > >
> > > --
> > > Postgresql & php tutorials
> > >  http://www.designmagick.com/
> > >
> >
> >
>




--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Social Networking Sites OT

2007-07-13 Thread Tijnema

On 7/13/07, Robert Cummings <[EMAIL PROTECTED]> wrote:

On Thu, 2007-07-12 at 23:51 -0500, Richard Lynch wrote:
> It's gotten to the point where I pretty much view social networking
> sites as just another form of spammers...
>
> I blogged about it, and would like feedback from members of this
> lists, for various reasons I would hope would be obvious.
>
> PLEASE put responses in my blog, or your blog, or whatever, but not
> here, as I'm sure this thread could be quite annoying as it has
> minimal to zero concrete PHP content.
>
> http://richardlynch.blogspot.com/

I didn't feel like logging in so I'll post my comment here:


I agree with you ;) logging is too much :-P


The whole idea behind a social network is that you can socially
network... as such inviting your friends is a great approach. I use
facebook and from time to time I do indeed invite my friends. The
problem you are experiencing is abuse of the feature. You have entities
outside of what you would call friends that are hitting you up for a
connection. The solution to this really should be the opportunity to
register your address with the social network such that you will no
longer receive requests.

Cheers,
Rob.


I get invites from a lot of friends, but the problem is they all come
from different sites (hyves, facebook, some dutch sites,...)
I don't like to keep all of these sites up to date with my daily life
etc., so I decided to NOT to join any of these social networking
sites.
The problem is, that most people on the sites I saw were only trying
to get the most friends, most "friends" were even people they didn't
know anything about.
For me, No join, No "Social Networking Friends", no spam :)

Tijnema
--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Re: Announcing Xaja, a PHP Reverse Ajax framework

2007-07-13 Thread Tijnema

On 7/13/07, Nathan Nobbe <[EMAIL PROTECTED]> wrote:

> On 7/13/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> This isn't possible since you can't request a connection to the client's
> machine. Only the other way around.

hmm...  in that case perhaps the open connection could be employed and
the feature used selectively; only on certain pages for instance ?
im thinking mainly of a monitoring page; like an app that shows a servers
state,
or stock quotes or something.
the main reason i dont like a javascript timer refreshing the page is
sometimes you
dont want the whole page refreshed; especially when halfway through filling
out a
form on the page ;)

-nathan


Well, that's why AJAX is there, you do a check to a server to see if
there's any new data to parse, if so, then you update (and probably
only one or two divs on your site, and not the whole page)

Keeping connection open isn't quite bad for sites that are visited a
lot, as for each connection, a new port is opened to handle a client
connection. While you think you're connected to port 80, it is
actually redirected to another port (mostly from 3000 onwards). So, if
you have a lot of visiters, you might reach the limit of ports, 65536
(0-65535). Some of them are already in use, so you end up to have a
limit of about 65530 connections to keep open. For a normal site this
isn't a problem, but if you count on shared hosts, with let's say 20
sites, then they can all handle about 3200 connections. Half of the
users has probably more then one window open, which means another
connection. So you end up to have a maximum of about 2000 visiters at
same time for each site.


Tijnema



On 7/13/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
>
> On Fri, 2007-07-13 at 14:59 -0400, Nathan Nobbe wrote:
> > > On 7/13/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> > > I haven't looked at the code for Xaja and in no way do I want to
> > > subtract from its potential, but I'm going to guess that in some way
> > it
> > > holds the HTTP connection open and as such is an expensive feature.
> > > Also, I'm not entirely sure, but isn't that the principle that
> > Comet
> > > uses?
> >
> > As i said ive only imagined such a feature.  In my imagination i
> > wonder if it is possible to
> > track the clients address in a data structure within the application.
> > Then a connection could be
> > established whenever a push was needed.
>
> This isn't possible since you can't request a connection to the client's
> machine. Only the other way around.
>
> >   I also think the app would have to track the last page
> > a user requested in order to realize such an implementation.  This
> > *should* be feasible using
> > sessions because whenever the client makes a new request the last page
> > variable could be updated.
> > I havent seen nor heard of Comet; would you mind providing a link?
>
> http://ajaxian.com/archives/comet-a-new-approach-to-ajax-applications
>
> Cheers,
> Rob.
> --
> ...
> SwarmBuy.com - http://www.swarmbuy.com
>
> Leveraging the buying power of the masses!
> ...
>




--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Installation problem

2007-07-13 Thread Tijnema

On 7/13/07, William Sang Lee <[EMAIL PROTECTED]> wrote:

Hi,

I am trying to install a package using SSH because my Web-based PEAR is not
working. So, I type in "pear install Date." But, it only says

Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed:
Non-recoverable failure in name resolution in RPC.php on line 464

Warning: fsockopen(): unable to connect to pear.php.net:80 in RPC.php on
line 464
xml_rpc_client: Connection to RPC server pear.php.net failed

What do I do?

Thanks



You seem to have a problem with the DNS server of your server, does:
ping pear.php.net
give you the IP address of a pear server or does it fail?
90% sure that it will fail, and probably because there's a wrong
configuration setting for DNS. (DNS is for hostname-> IP conversion).
If you can't fix the DNS, you can always modify RPC.php, to change
pear.php.net to 216.92.131.66, which is the IP if I ping pear.php.net.
Note that this isn't a fix, but only a workaround, and the IP of the
pear server might change someday and then your stuck with the old IP.
So really try to fix the DNS problem..

Tijnema

--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Newbie seeks urgent help

2007-07-13 Thread Tijnema
 
> Número do telefone *
> 
> 
> 
> Fax
> 
> 
> 
> E-mail *
> 
> 
> 
> Produto *
> 
> 
> 
> Origem *
> 
> 
> 
> Destino *
> 
> 
> 
> Quantidade *
> 
> 
> 
> Peso *
> 
> 
> 
> Comprimento *
> 
> 
> 
> Altura *
> 
> 
> 
> Largura *
> 
> 
> 
> 
> 
> 
> 
> 
>
> --
> Best regards,
>  Luc
> 
>
>
> Powered by The Bat! version 3.99.3 with Windows XP (build 2600),
> version 5.1 Service Pack 2 and using the best browser: Opera.
>
> "Doctor to patient: I have good news and bad news - the good news is
> that you are not a hypochondriac."
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

   Luc,

   In your code, all you have is this:

   mail($youremail, $subjectline, "Orçamento de empresa");

   That instructs PHP to send an email to $youremail with the subject
$subjectline and the message "Orçamento de empresa."

   It should use a basic structure such as this


clandestine advertising   ^ :-P

Tijnema
--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Tijnema

On 7/12/07, Jon Anderson <[EMAIL PROTECTED]> wrote:

Daniel Brown wrote:
>Did you come before or after the chicken egg?
>
Relevant to the above:

$a = array('Chicken','Egg');
echo "The " . $a[array_rand($a)] . " comes first.";

I appologize if this one's already been done...I've only glanced at a
few entries in this thread, entertaining though it is. :-)

jon



The same fault is made over and over again ;) as the fish egg was
earlier (as noted here)
Your code should be this:
$a = array('Chicken','Chicken egg');
echo "The " . $a[array_rand($a)] . " comes first.";

Tijnema
--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Tijnema

On 7/12/07, Daniel Brown <[EMAIL PROTECTED]> wrote:

On 7/12/07, Tijnema <[EMAIL PROTECTED]> wrote:
> You can probably remember the good old time of being a child and
> having holiday ;)
>
> Tijnema
> --
> Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info
>

   Don't rub it in, Tijnema ;-P

--
Daniel P. Brown


Hehe ;)

*fixed your post * :P

Tijnema

--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Tijnema

On 7/12/07, Daniel Brown <[EMAIL PROTECTED]> wrote:

On 7/12/07, Colin Guthrie <[EMAIL PROTECTED]> wrote:
> Thijs Lensselink wrote:
> >>  >> $evil[] = "6";
> >> $evil[] = "6";
> >> $evil[] = "6";
> >> for($i=0;$i >> $_ = sqrt($evil);
> >> }
> >> ?>

   It was supposed to be "money is the root of all evil," but the
code above wouldn't work correctly anyway, as each time through the
for() loop it'll try to get the square root of the array.

> Thank _God_ it's Friday??? Covering all bases are we? ;)

   No, I said, "thank God it's ALMOST Friday."  Nothing to do with
the puzzle, I'm just exhausted this week for some reason.

--
Daniel P. Brown


You can probably remember the good old time of being a child and
having holiday ;)

Tijnema
--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Re: Simple PHP setting arrays with keys question

2007-07-10 Thread Tijnema

On 7/10/07, Jim Lucas <[EMAIL PROTECTED]> wrote:

Tijnema wrote:
> On 7/10/07, Jim Lucas <[EMAIL PROTECTED]> wrote:
>> Fredrik Thunberg wrote:
>> >
>> > Dan skrev:
>> >> Oh yeah, the problem isn't that I'm using -> instead of =>.  Well that
>> >> was a problem but I fixed that and it's still not working.
>> >>
>> >> - Dan
>> >>
>> >> ""Dan"" <[EMAIL PROTECTED]> wrote in message
>> >> news:[EMAIL PROTECTED]
>> >>> I'm having a little problem assigning a value to an array which has a
>> >>> key. It's simple, I just don't know what I'm doing wrong.
>> >>>
>> >>>foreach($Checkout as $value)
>> >>>   {
>> >>>   $products[] = $value['productName'] ->
>> >>> $value['actualValue'];
>> >>>}
>> >>>
>> >>> HELP!
>> >>
>> >
>> > either:
>> >
>> > $products[$value['productName']] = $value['actualValue'];
>> >
>> > OR
>> >
>> > $products[] = array( $value['productName'] => $value['actualValue'] );
>> >
>> But these are not the same...
>>
>> --
>> Jim Lucas
>
> This one is:
> $products += array( $value['productName'] => $value['actualValue'] );
>
> :)
>
> Tijnema
>
well, I was leaving it up to Fredrik to figure out in what way they were 
different

:)

--
Jim Lucas


I'm sorry ;) I was a little too fast :)

Tijnema

--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Re: Simple PHP setting arrays with keys question

2007-07-10 Thread Tijnema

On 7/10/07, Jim Lucas <[EMAIL PROTECTED]> wrote:

Fredrik Thunberg wrote:
>
> Dan skrev:
>> Oh yeah, the problem isn't that I'm using -> instead of =>.  Well that
>> was a problem but I fixed that and it's still not working.
>>
>> - Dan
>>
>> ""Dan"" <[EMAIL PROTECTED]> wrote in message
>> news:[EMAIL PROTECTED]
>>> I'm having a little problem assigning a value to an array which has a
>>> key. It's simple, I just don't know what I'm doing wrong.
>>>
>>>foreach($Checkout as $value)
>>>   {
>>>   $products[] = $value['productName'] ->
>>> $value['actualValue'];
>>>}
>>>
>>> HELP!
>>
>
> either:
>
> $products[$value['productName']] = $value['actualValue'];
>
> OR
>
> $products[] = array( $value['productName'] => $value['actualValue'] );
>
But these are not the same...

--
Jim Lucas


This one is:
$products += array( $value['productName'] => $value['actualValue'] );

:)

Tijnema

--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Another simple question (Probably)

2007-07-10 Thread Tijnema

On 7/10/07, Jason Pruim <[EMAIL PROTECTED]> wrote:

While we are on the subject of certain dates, does this date mean
anything? :)

Tue, Nov-30-99 12:00:00?



November 30th, 1999 - In Seattle, Washington, United States, protests
against the WTO meeting by anti-globalization protesters catch police
unprepared and force the cancellation of opening ceremonies.

November 30th, 1999 - British Aerospace and Marconi Electronic Systems
merge to form BAE Systems, Europe's largest defence contractor and the
fourth largest aerospace firm in the world.



Currently that is the date I get when I try to submit any date
through the form. I'm sure I just have something messed up in my
mktime, or in the way I'm grabbing the variable.

Thanks for looking!
--

Jason Pruim


All weird dates here  :P, seems to be no relation to any Unix/PHP things ;)

Tijnema

--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] system() call in PHP5 on win2003

2007-07-10 Thread Tijnema

On 7/10/07, Xiaogang <[EMAIL PROTECTED]> wrote:

We used to use php 4 on our web server on win2000, and use the system()
to call some DOS programs. That how we call it:

$cmd = "c:\\Inetpub\\wwwroot\\test.exe";
$last_line = system($cmd, $retval);
print ("\nretval =\"". $retval. "\"\n");

It was working perfectly for years.

However, recently we moved to a win2003 server, and install the php
5.2.3, and now the system() no longer works as expected:

   1. It no longer work in the web, the only result returned
  to the web browser is "retval =-1";

   2. It still works if tested in DOS commandline (use the
  command such as "php test.php");

   3. Even change the $cmd to "type test.txt" or "dir", the
  result is the same: works in DOS prompt window, but
  not web browser (received only "retval =-1").

I have checked the permissions on all those files/folders, even tried
giving read/execute permission to "everyone", still no help.

In our configuation, the safe mode is off.

Any clue? Thanks in advance.

Xiaogang



Are you sure PHP does actually read the config file?
Check if safe_mode is really off using phpinfo(); like this:


Tijnema
--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Where does PHP look for php.ini??

2007-07-09 Thread Tijnema

On 7/9/07, Mario Guenterberg <[EMAIL PROTECTED]> wrote:

On Mon, Jul 09, 2007 at 10:38:24PM +0200, Tijnema wrote:
>  On 7/9/07, Mario Guenterberg <[EMAIL PROTECTED]> wrote:
> > On Mon, Jul 09, 2007 at 05:16:20PM +0200, Tijnema wrote:
> > >  I've build my own Linux, so good to know how to change it :)
> > >
> > >  Tijnema
> >
> > Ahh, a linux from scratch user, eh? :-)
> > If you need it or want some usefull input, I have very usefull
> > build scripts for apache/php and mysql/postgresql. I use this scripts
> > for my own builds from scratch or vanilla source.
> >
> > Greetings
> > Mario
> >
>
>  It has an LFS base yes ;)
>
>  When I had the base LFS system, I continued on my own, no BLFS or
>  such, and a lot of unstable code "fixes", which was more like making
>  bugs in programs to fix compile errors ;), commenting out some mem
>  calls or such :P
>
>  Can't remember that I've changed anything in PHP/Apache/MySQL or
>  PostgreSQL, but still interested in your scripts :)
>
>  Tijnema

I don't change the sources even if security bugs or issues are known.
The only 3rd party patch I ever applied for php is hardened php/suhosin.

I attach the scripts to this mail.

Greetings
Mario


I didn't say security fixes , I only change the source for compile errors ;)

Thanks for the scripts :)
I'll take a look at them and see if I can learn something from
them/use them in my own environment :)

Tijnema

--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Where does PHP look for php.ini??

2007-07-09 Thread Tijnema

On 7/9/07, Mario Guenterberg <[EMAIL PROTECTED]> wrote:

On Mon, Jul 09, 2007 at 05:16:20PM +0200, Tijnema wrote:
>  I've build my own Linux, so good to know how to change it :)
>
>  Tijnema

Ahh, a linux from scratch user, eh? :-)
If you need it or want some usefull input, I have very usefull
build scripts for apache/php and mysql/postgresql. I use this scripts
for my own builds from scratch or vanilla source.

Greetings
Mario



It has an LFS base yes ;)

When I had the base LFS system, I continued on my own, no BLFS or
such, and a lot of unstable code "fixes", which was more like making
bugs in programs to fix compile errors ;), commenting out some mem
calls or such :P

Can't remember that I've changed anything in PHP/Apache/MySQL or
PostgreSQL, but still interested in your scripts :)

Tijnema

--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Another simple question (Probably)

2007-07-09 Thread Tijnema

On 7/9/07, Daniel Brown <[EMAIL PROTECTED]> wrote:

On 7/9/07, Tijnema <[EMAIL PROTECTED]> wrote:
> On 7/9/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> > On 7/9/07, Shafiq Rehman <[EMAIL PROTECTED]> wrote:
> > > Hi,
> > >
> > > correct syntax for mktime is mktime( int hour, int minute, int second,  
int
> > > month, int day, int year)
> > >
> > > --
> > > Shafiq Rehman (ZCE)
> > > http://www.phpgurru.com | http://shafiq.pk
> > > Cell: +92 300 423 9385
> > >
> > > On 7/9/07, Jason Pruim <[EMAIL PROTECTED]> wrote:
> > > >
> > > > Okay so given this section of code:
> > > >
> > > > $taskTime=mktime(00,00,00,$_POST['txtReschedule']);
> > > >
> > > > echo << > > >
> > > > 
> > > > ID#, {$row['id']} 
> > > > TicklerName, {$row['task_name']}  

> > > > Instructions, Instructions
> > > > DayOfWeekWord, {$dowword} 
> > > > DateToReschedule,  > > > name='tasks[{$row['id']}][txtReschedule]' value=''>
> > > > DateRescheduled, {$Date}
> > > >  > > > &taskdate={$taskdate}'>Click here!
> > > > CheckboxForWhenDone,
> > > >  > > > name='tasks[{$row['id']}][chkDone]'
> > > > value='{$row['id']}'>
> > > > 
> > > >
> > > > HTML;
> > > >
> > > > Why am I getting a time stamp of:
> > > >
> > > > 1165640400
> > > > Sat, Dec-09-06?
> > > >
> > > > I have been fighting with trying to figure this out and finally
> > > > decided to show my ignorance of the language and ask for help :)
> > > > Besides, the boss wants this done :)
> > > >
> > > > Jason
> > > >  > > >
> > > > if($brain =="Monday"){
> > > > echo "Let me go home!"
> > > > };
> > > >
> > > > ?>
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > > >
> > >
> >
> >That's correct, but not all are explicitly required.  The function
> > should actually be written as follows:
> >
> >int mktime( [int hour [,int minute [,int second [,int month [,int
> > day [,int year [,int dst]]] )
> >
> >And by default, if date() is given a second parameter, but that
> > parameter is null or empty, date() will return `9 December, 2006`
> > (formatted accordingly).  I'm not certain of the significance of this,
> > nor am I sure that all versions of PHP will return this same value.
> > I'd have expected Unix epoch time, so 9 December, 2006, could be an
> > easter egg date.  Worth reading up on, but nothing I can find so far
> > explains it.  ANYONE ELSE KNOW?  I'd love to find out!
> >
>
> The only thing I could find about 9 dec 2006:
> "9 December, 2006 - Shuttle Discovery launches on the STS-116 mission
> at 8:45 P.M., the first night launch in 4 years (STS-113 being the
> last)."
>
> Tijnema
>
> --
> Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info
>

   Yeah, I saw that on Wikipedia that and the Moscow fire that
was the biggest since 1977 or something I think it said it killed
45 women.

   Damn.


Yes, the Moscow Hospital Fire [1] was also on 9 December, was it maybe
the wife of one of the developers of Unix that wife died there in the
hospital? :P

Tijnema

[1] http://en.wikipedia.org/wiki/Moscow_hospital_fire

--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Another simple question (Probably)

2007-07-09 Thread Tijnema

On 7/9/07, Daniel Brown <[EMAIL PROTECTED]> wrote:

On 7/9/07, Shafiq Rehman <[EMAIL PROTECTED]> wrote:
> Hi,
>
> correct syntax for mktime is mktime( int hour, int minute, int second,  int
> month, int day, int year)
>
> --
> Shafiq Rehman (ZCE)
> http://www.phpgurru.com | http://shafiq.pk
> Cell: +92 300 423 9385
>
> On 7/9/07, Jason Pruim <[EMAIL PROTECTED]> wrote:
> >
> > Okay so given this section of code:
> >
> > $taskTime=mktime(00,00,00,$_POST['txtReschedule']);
> >
> > echo << >
> > 
> > ID#, {$row['id']} 
> > TicklerName, {$row['task_name']}  
> > Instructions, Instructions
> > DayOfWeekWord, {$dowword} 
> > DateToReschedule,  > name='tasks[{$row['id']}][txtReschedule]' value=''>
> > DateRescheduled, {$Date}
> >  > &taskdate={$taskdate}'>Click here!
> > CheckboxForWhenDone,
> >  > name='tasks[{$row['id']}][chkDone]'
> > value='{$row['id']}'>
> > 
> >
> > HTML;
> >
> > Why am I getting a time stamp of:
> >
> > 1165640400
> > Sat, Dec-09-06?
> >
> > I have been fighting with trying to figure this out and finally
> > decided to show my ignorance of the language and ask for help :)
> > Besides, the boss wants this done :)
> >
> > Jason
> >  >
> > if($brain =="Monday"){
> > echo "Let me go home!"
> > };
> >
> > ?>
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>

   That's correct, but not all are explicitly required.  The function
should actually be written as follows:

   int mktime( [int hour [,int minute [,int second [,int month [,int
day [,int year [,int dst]]] )

   And by default, if date() is given a second parameter, but that
parameter is null or empty, date() will return `9 December, 2006`
(formatted accordingly).  I'm not certain of the significance of this,
nor am I sure that all versions of PHP will return this same value.
I'd have expected Unix epoch time, so 9 December, 2006, could be an
easter egg date.  Worth reading up on, but nothing I can find so far
explains it.  ANYONE ELSE KNOW?  I'd love to find out!



The only thing I could find about 9 dec 2006:
"9 December, 2006 - Shuttle Discovery launches on the STS-116 mission
at 8:45 P.M., the first night launch in 4 years (STS-113 being the
last)."

Tijnema

--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Where does PHP look for php.ini??

2007-07-09 Thread Tijnema

On 7/8/07, Mario Guenterberg <[EMAIL PROTECTED]> wrote:

On Sat, Jul 07, 2007 at 02:08:21AM +0200, Tijnema wrote:
>  Hi,
>
>  I just noted that my php (CLI and Apache2 SAPI) doesn't read my php.ini in
>  /etc
>  I have compiled php with --prefix=/usr, and my /usr/etc is symlinked
>  to /etc, but it doesn't read the php.ini file..
>  when I use the CLI with -c /etc it works fine :)
>
Hi...

you can use the configure parameter --with-config-file-path.

Greetings
Mario
--


I've build my own Linux, so good to know how to change it :)

Tijnema
--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] About DOM function in PHP

2007-07-08 Thread Tijnema

On 7/8/07, Kelvin Park <[EMAIL PROTECTED]> wrote:

I'm getting the following fatal error message:

*Fatal error*: Cannot instantiate non-existent class: domdocument in *
/home/hosting/infotechnow_com/htdocs/admin/inventory/catalog.php* on line *3
*
when running this code:

// Initialize new object for DOMDocument
$doc = new DOMDocument();

What's the problem?
**


Which PHP version are you using?

from the manual[1]:
"The DOM extension allows you to operate on XML documents through the
DOM API with PHP 5.

For PHP 4, use DOM XML. "

Tijnema

[1] http://www.php.net/manual/en/ref.dom.php

--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



  1   2   3   4   5   6   7   8   >