Re: [PHP] help with adding

2005-02-25 Thread gustav
Hi there!

I guess
$sum =+ intval($_POST['qty'.$i]);

should be
$sum += intval($_POST['qty'.$i]);

/G
@varupiraten.se

> Jay Fitzgerald wrote:
>> I have messed with this for a couple of days and cant get it right.
>> Maybe I
>> need sleep :-)
>>
>>
>>
>> The code below is echoing the qty correctly (10, 5, 25)
>>
>>
>>
>> for ($i = 1; $i <= $sendnum; $i++)
>>
>> {
>>
>> $qty = $_POST['qty'.$i];
>>
>> echo $qty . '';
>>
>> }
>>
>>
>>
>> The question is, how would I take add each of these numbers (10+5+25)?
>
> $sum = 0 // init the var
> for ($i = 1; $i <= $sendnum; $i++) {
>  $sum =+ intval($_POST['qty'.$i]);
> }
> echo "$sum";
>
>>
>>
>>
>> Any help is appreciated.
>>
>>
>>
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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



Re: [PHP] Create MDB File

2005-03-29 Thread gustav
What's the reason reason converting from MySQL to Access? *curious*

/G
@varupiraten.se



> Thanks for your reply,
>
> but this only works on Windows. I need a program that will create an MDB
> file on the fly from a query on the MySQL database...
>
>
> "Johannes Findeisen" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> Sorry,
>>
>> i forgot that link:
>>
>> http://www.convert-in.com/sql2acc.htm
>>
>>
>> On Monday 28 March 2005 22:46, Johannes Findeisen wrote:
>>> Hello,
>>>
>>> i had the same problem some years ago. At this time i have set up all
>>> tables in Access and wrote a script which reads from MySQL and inserts
>>> into
>>> the MDB file via the ODBC connector. This works but is much work when
>>> your
>>> database is very big.
>>>
>>> 2 Years ago i had the same problem but it must go as fast as possible
>>> so
>>> i
>>> decided to buy a converteer since i didn't find anything free. They are
>>> working very good. I don't know where i have buyed them but i think
>>> there
>>> is only one company which delivers this software.
>>>
>>> Regards
>>> Johannes
>>>
>>> On Monday 28 March 2005 22:08, Shaun wrote:
>>> > Hi,
>>> >
>>> > Does anyone know if its possible to create an MDB file from a Mysql
>>> > database using a PHP script, I have only managed to find Access to
>>> > Mysql
>>> > conversion programs so far...
>>> >
>>> > Thanks for your help
>>>
>>> --
>>> # Johannes Findeisen
>>
>> --
>> # Johannes Findeisen
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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



Re: [PHP] problem with Firefox print preview?

2006-08-11 Thread gustav
> Hi all,
>
> I've developed this site in PHP and its basically finished, now I have a
> problem with the printing and print preview.
> I have a dynamic table that can span various pages depending on the
> number of records pulled from the database.
>
> The print preview (and printed page) doesnt print the first few rows but
> instead just prints blank then only prints the last line of the table on
> a new page. The table is embedded inside a fieldset component. Im not
> sure if its a mozilla/firefox bug because it seems fine in IE.
>
> Has anyone come across this problem before?
>
> Thanks in advance
> Angelo
>
Seems like it is a standard html-problem.
IE shows most webbpages, even if they're not strictly html-coded from the
standard of html.
FireFox is more sensitive about the strict html-code.

Best regards
/Gustav Wiberg

> --
> 
> Angelo Zanetti
> Systems developer
> 
>
> *Telephone:* +27 (021) 469 1052
> *Mobile:*   +27 (0) 72 441 3355
> *Fax:*+27 (0) 86 681 5885
> *
> Web:* http://www.zlogic.co.za
> *E-Mail:* [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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



RE: [PHP] highlight_string()

2006-03-06 Thread gustav
> The only way I could work around this was to put empty  at the
> Beginning of the text and now highlight_string() highlights only what
> Is inside 
>
> You can see an example of the problematic text in the example
> Area of this page : http://www.weberdev.com/get_example-4345.html
>
> Notice the empty  at the beginning of the example.
> Without them, all of the example, including the text and HTML
> Part will be painted by highlight_string().
>
> Is this a bug?
>
> -Original Message-
> From: Weber Sites LTD [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 06, 2006 11:29 AM
> To: php-general@lists.php.net
> Subject: [PHP] highlight_string()
>
> Hi
>
> From what I see, highlight_string() should only change text between  ?>.
> Any idea why it highlights all of the text I send to it (even text outside
>  ?
>
> Thanks
>
> berber
>
> --
> PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
> http://www.php.net/unsub.php
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Hi guys!

Maybe you could take a look at this code:
http://aidanlister.com/repos/v/PHP_Highlight.php

Best regards
/Gustav Wiberg

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



Re: [PHP] Convert all named entities into numeric character references

2006-03-06 Thread gustav
Hi there!

http://se.php.net/manual/en/function.htmlentities.php

?

Best regards
Gustav Wiberg

> Does anyone know of a Php funtion that can do this:
> http://golem.ph.utexas.edu/~distler/blog/NumericEntities.html
>
>
> Thanks,
> Jacob
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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



RE: [PHP] output Today's date

2006-03-06 Thread gustav
>
>> On Sat, Mar 04, 2006 at 07:01:55PM -0700, Paul Goepfert wrote:
>> > Hi all,
>> >
>> > ls there anyway I can set the date to the timezone of the clients
>> > timezone?  For example, if a person opens the web page at 3/6 12:01
>> > EST and another person opens the same page at 3/5 10:01 MST I would
>> > like the date to be the above days on the client computers.  I know
>> > everyone knows this but the way I described this the two people
>> > accessed the webpage at the same time but I want the
>> correct date for
>> > the client computer to be outputted.
>>
>> There are some tools that you can detect where the person is
>> located and and you would be able to use the timezone from
>> that information. One site I found from a quick google search:
>>
>>  http://www.ip2location.com/
>>
>>
>> The cheapest and simpliest method would be to use some
>> javascript to detect the timezone. Or let the user specify
>> which one he wants to use.
>
> Hi,
>
> Javascripts' Date object has a getTimezoneOffset() method, which returns
> the difference between local time and universal time in
> minutes.
>
> Jared
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Hi there!

Yes, Javascript may have a such function, BUT think of the reliability...
It's not sure, that user has the Javascript-functionality turned on, what
happens then?

Best regards
Gustav Wiberg

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



Re: [PHP] Re: test security of code

2006-03-08 Thread gustav
> Gregory Machin wrote:
>> Hi
>> Is there an application that can pass source code and report potential
>> security problem and or the live site ?
>> Many thanks
>> --
>> Gregory Machin
>> [EMAIL PROTECTED]
>> [EMAIL PROTECTED]
>> www.linuxpro.co.za
>> www.exponent.co.za
>> Web Hosting Solutions
>> Scalable Linux Solutions
>> www.iberry.info (support and admin)
>>
>> +27 72 524 8096
> Nothing that would find every security hole.
> Because every developed site is different, has different variables, uses
> probably flash/cgi/javascript and a MySQL/PostgreSQL/MSAccess Database
> and so on.
>
> There will be never such a program that can do your specific security
> test, or it would just cost thousands of dollars and would have to keep
> better up to date than the developer of your applications.
>
> Best thing is always to test it yourself!
>
> Write down what function you have and what it does, then think about how
> somone could breach in.
>
> I know there are some people offering such a service.
>
> Probably it's that what you search for ;)
>
> Greets
>   Barry
> --
> Smileys rule (cX.x)C --o(^_^o)
> Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Or why not post to the list directly... and ask if WE see anything :-)

Best regards
/Gustav Wiberg

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



Re: [PHP] require_once hell

2006-03-29 Thread gustav
> Hi
>
> this may be a stupid moment but i cant find an help on google so.i
> am including two classes in my code using the  "require_once("path to
> file")" method.  this works fine for the first class but when including
> the second it simply outputs the contents on to the page.  I feel I must
> be missing something stupid so i have not included any example code, any
> general ideas?
>
> Thanks in advance
>
> Ade
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Hi!

It would be easier if you would include some code...

/Gustav Wiberg

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



Re: [Fwd: Re: Re: [PHP] Problem with IE and not displaying the correct images...]

2006-03-29 Thread gustav
> if anyone feels like DDoS'ing ksa.zajil.com ...
>
> be my guest :-/
>
*LOL*

>  Original Message 
> Return-Path: <[EMAIL PROTECTED]>
>
> Received: from localhost (localhost [127.0.0.1])  by mx1.moulin.nl
> (Postfix) with ESMTP id 392B7172C08   for
>
> Received: from mx1.moulin.nl ([127.0.0.1]) by localhost (moulin
> [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id
>
> Received: from zlinuxweb.zajil.net (zlinuxweb.zajil.net
> [212.24.224.144]) by mx1.moulin.nl (Postfix) with ESMTP id
>
> Received: (qmail 414 invoked by uid 0); 29 Mar 2006 14:03:34 +0300
> Date: 29 Mar 2006 14:03:34 +0300
> Message-ID: <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> From: [EMAIL PROTECTED]
>
> Cc:
> Subject: Re: Re: [PHP] Problem with IE and not displaying the correct
> images...
> Content-Type: text/plain; charset="UTF-8"
> Content-Transfer-Encoding: 8bit
> Content-Disposition: inline
> X-Virus-Scanned: amavisd-new at moulin.nl
>
> Please use [EMAIL PROTECTED] instead of [EMAIL PROTECTED]
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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



Re: [PHP] HTTP status code

2006-03-31 Thread gustav
> No,
> I'm creating remote service and it's returning codes according to passed
> parameters. I only wanted to test it using browsers...
>
> I do not care about the output actually, but the status code
>
> B.
>
It seems to me, that this is more html-related. Maybe the tags in the
html-document screws it up regarding to the use of html. IE is more
insensitive regarding correct typing of html-tags.

>>header('HTTP/1.1 404 Not Found');
>>header("Status: 404 Not Found");

Why do you have ' on the first line and " on the second?

/Gustav Wiberg

> Jasper Bryant-Greene wrote:
>> The default Apache error handler is not called when PHP sends a 404
>> header. The code that does Apache error handling happens *before* PHP
>> gets in the loop, and checks to see if the script being referenced
>> exists, which it indeed does, whether it sends a 404 header or not.
>>
>> Tested on Apache 2.2 with PHP 5.1.
>>
>> If you really want to get the default Apache error handler to appear
>> then either readfile() it or redirect to it.
>>
>> Jasper
>>
>> Anthony Ettinger wrote:
>>
>>> well, you typically would redirect 404 to something like
>>> foo.com/404.html
>>>
>>> Otherwise, it's whatever your server (apache/IIS) has as the default
>>> 404 handler...
>>>
>>> Default is something like this:
>>>
>>>   Not Found
>>>
>>>   The requested URL /asdf was not found on this server.
>>>   Apache Server at foo.org Port 80
>>>
>>>
>>> On 3/30/06, Jasper Bryant-Greene <[EMAIL PROTECTED]> wrote:
>>>
>>>> In other words, if you want Firefox/Opera/etc to display something,
>>>> you
>>>> have to output something. Strange, that. :P
>>>>
>>>> Jasper
>>>>
>>>> Anthony Ettinger wrote:
>>>>
>>>>> Then it's workingFireFox, et. al. show you the server 404, IE on
>>>>> the otherhand has it's own 404 error page (for those newbies who
>>>>> don't
>>>>> know what a 404 is). You can disable it under IE options.
>>>>>
>>>>> On 3/30/06, Bronislav Klucka <[EMAIL PROTECTED]> wrote:
>>>>>
>>>>>> Yes, I do...
>>>>>> B.
>>>>>>
>>>>>> Anthony Ettinger wrote:
>>>>>>
>>>>>>> Are you seeing the IE-specific 404 page? The one that looks like
>>>>>>> this:
>>>>>>>
>>>>>>> http://redvip.homelinux.net/varios/404-ie.jpg
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 3/30/06, Bronislav Klucka <[EMAIL PROTECTED]> wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>> I'm using following construction to send http status code
>>>>>>>> --
>>>>>>>> header('HTTP/1.1 404 Not Found');
>>>>>>>> header("Status: 404 Not Found");
>>>>>>>> exit;
>>>>>>>> --
>>>>>>>>
>>>>>>>> MSIE displays "Page not found", but FireFox and Opera don't
>>>>>>>> display
>>>>>>>> anything. Just blank page with no text...
>>>>>>>>
>>>>>>>> full headers sent by this script (and server itself) are:
>>>>>>>>
>>>>>>>> --
>>>>>>>> Date: Thu, 30 Mar 2006 18:02:49 GMT
>>>>>>>> Server: Apache/2.0.55 (Debian) PHP/4.4.0-4 mod_ssl/2.0.55
>>>>>>>> OpenSSL/0.9.8a
>>>>>>>> X-Powered-By: PHP/5.1.2
>>>>>>>> Keep-Alive: timeout=15, max=99
>>>>>>>> Connection: Keep-Alive
>>>>>>>> Transfer-Encoding: chunked
>>>>>>>> Content-Type: text/html
>>>>>>>>
>>>>>>>> 404 Not Found
>>>>>>>> --
>>>>>>>>
>>>>>>>> can anyone tell me, why those two browsers are not affected?
>>>>>>>>
>>>>>>>> Brona
>>>>>>>>
>>>>>>>> --
>>>>>>>> PHP General Mailing List (http://www.php.net/)
>>>>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Anthony Ettinger
>>>>>>> Signature: http://chovy.dyndns.org/hcard.html
>>>>>>>
>>>>>> --
>>>>>> PHP General Mailing List (http://www.php.net/)
>>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> Anthony Ettinger
>>>>> Signature: http://chovy.dyndns.org/hcard.html
>>>>>
>>>> --
>>>> Jasper Bryant-Greene
>>>> General Manager
>>>> Album Limited
>>>>
>>>> http://www.album.co.nz/ 0800 4 ALBUM
>>>> [EMAIL PROTECTED]  021 708 334
>>>>
>>>>
>>>
>>>
>>> --
>>> Anthony Ettinger
>>> Signature: http://chovy.dyndns.org/hcard.html
>>>
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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



Re: [PHP] Uploading Image File

2006-05-10 Thread gustav
> Morning all.
>
> I would like to know if anybody could e-mail an example of code to upload
> files into a MySQL server using PHP from
> a form.
>
> Thanks a lot.
>
> Best Regards,
>
> RENZO CLAVIJO
>
What exactly do you mean?

Best regards
/Gustav Wiberg

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



[PHP] DOS-textfile?

2004-11-17 Thread gustav
Hello!

I have a problem. I have som code in PHP that creates a textfile. The code
is on a Linux-server, but when creating the textfile it is in Mac-mode. I
can convert the textfile to DOS-textfile through TextPad (An editor), but
I want the textfile to be in DOS-mode through the PHP-code. Can I do
that???

/Gustav Wiberg
Swedish site:
http://www.varupiraten.se/

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



[PHP] File-handling

2004-12-17 Thread gustav
Hi there!

Can someone explain the major difference between fgets and fopen? Which is
the best together with plain textfiles? and why?

eof and feof. What's the difF? *don't get it*

When using fget. Is it something special you should think when taking care
of line-breaks? (/n, /r/n ...)

/G

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



[PHP] or-die option - Opinions please...

2005-01-03 Thread gustav
Hi there all!

I'm thinking of the "or die" suffix (or option or whatever it is called)...

I can use or die together with opening a db.

open_mysqldb("bla.bla.") or die("couldn't connect to db");

But this is just useful when developing?

I don't want my users to see that a specific table can't be opened?
Or do I want that? What's your opinion?

/G
@varupiraten.se

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



[PHP] SSL

2005-01-05 Thread gustav
Hi there!

Thinking of going from http to https on the server. My question is: Would
there be any differences in my php-code from now?

/G
@varupiraten.se

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



[PHP] Which script runs first?

2005-01-08 Thread gustav
Hi there!

I have two frames, one with left.php in the left frame and one with
main.php in the right frame.

I refresh the contents of main.hp at the end of left.php.  (With help of
Javascript actually, maybe could be done with HEADER(...))

My Question:
Is it ALWAYS so that left.php must be executed before the right frame is
loaded? I wonder this because a session-variable are set in left.php that
main.php is dependent of. So this session-variable must be set before
main.php is loaded.


/G
@varupiraten.se

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



[PHP] Not about PHP, more about this list...

2005-01-08 Thread gustav
Hi there!

I'm wondering. Why don't I see my own posts in the list? I have to guess
that the mail has arrived correctly to the list. I only see them when
someone has posted and replied on my questions...

/G
@varupiraten.se

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



[PHP] $_REQUEST or $_POST?

2005-01-17 Thread gustav
Hi there!

I've learned to use $_REQUEST but it seems to me that it uses any $_GEt,
or $_POST. Is it better to $_POST when I'm just using $_POST? It seems
like that if I want "good code", but I mean is it faster with $_POST?

/G
@varupiraten.se

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



[PHP] read file from specific line

2005-01-27 Thread gustav
Hi there!

Is there any way reading a file from a specific line? (textfile)

/G
@varupiraten.se

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



[PHP] How to know?

2005-10-13 Thread gustav
Hi there!

I have a string like this... (envorinment string)

HOSTfriggAUDIODEV/tmp/SUNWut/dev/utaudio/8dtstart_sessionlogfile/dev/nullDTSCREENSAVERLISTStartDtscreenBlankXMBINDDIR/usr/dt/lib/bindingsUTAUDIODEV/tmp/SUNWut/dev/utaudio/8AB_CARDCATALOG/usr/dt/share/answerbooks/C/ab_cardcatalogLC_ALLCDTLOGINDISPLAYCLASSSunRayOSTYPEsolarisPWD/home/student/2003/a03guswi/ht05USERa03guswiSESSION_SVRfriggLANGCLOGNAMEa03guswiGROUPstudentGNOME_DESKTOP_SESSION_IDDefaultG_BROKEN_FILENAMESyesSHLVL2XMICONBMSEARCHPATH/home/student/2003/a03guswi/.dt/icons/%B%M.bm:/home/student/2003/a03guswi/.dt/icons/%B%M.pm:/home/student/2003/a03guswi/.dt/icons/%B:/usr/dt/appconfig/icons/%L/%B%M.bm:/usr/dt/appconfig/icons/%L/%B%M.pm:/usr/dt/appconfig/icons/%L/%B:/usr/dt/appconfig/icons/C/%B%M.bm:/usr/dt/appconfig/icons/C/%B%M.pm:/usr/dt/appconfig/icons/C/%BPATH/usr/local/bin/system:/usr/bin:/usr/openwin/bin:/opt/SUNWspro/bin:/usr/ccs/bin:/usr/ucb:/opt/SUNWut/bin:/usr/sfw/bin:/opt/sfw/bin:/usr/local/bin:/openpkg/bin:/usr/dt/bin:.WINDOWID9437227DTXSERVERLOCATIONlocalCOLORTERMgnome-terminalHELPPATH/usr/openwin/lib/locale:/usr/openwin/lib/helpHOSTTYPEsun4DTDEVROOT/tmp/SUNWut/sessions/34TERMxtermHOME/home/student/2003/a03guswiCORONA_TOKENpseudo.080020b9346fXFILESEARCHPATH/usr/openwin/lib/locale/%L/%T/%N%S:/usr/openwin/lib/%T/%N%SMANPATH/usr/man:/usr/openwin/man:/usr/dt/man:/usr/local/man:/opt/SUNWspro/man:/openpkg/man:/opt/SUNWut/man:/usr/sfw/man:/opt/sfw/manDISPLAYfrigg:34DTHELPSEARCHPATH/home/student/2003/a03guswi/.dt/help/a03guswi-frigg-34/%H:/home/student/2003/a03guswi/.dt/help/a03guswi-frigg-34/%H.sdl:/home/student/2003/a03guswi/.dt/help/a03guswi-frigg-34/%H.hv:/home/student/2003/a03guswi/.dt/help/%H:/home/student/2003/a03guswi/.dt/help/%H.sdl:/home/student/2003/a03guswi/.dt/help/%H.hv:/usr/dt/appconfig/help/%L/%H:/usr/dt/appconfig/help/%L/%H.sdl:/usr/dt/appconfig/help/%L/%H.hv:/usr/dt/appconfig/help/C/%H:/usr/dt/appconfig/help/C/%H.sdl:/usr/dt/appconfig/help/C/%H.hvGTK_RC_FILES/etc/gtk/gtkrc:/home/student/2003/a03guswi/.gtkrc-1.2-gnome2EDITOR/usr/dt/bin/dtpadMAIL/var/mail/a03guswiTZMETSDT_NO_DTDBCACHE1DTDATABASESEARCHPATH/home/student/2003/a03guswi/.dt/types,/etc/dt/appconfig/types/%L,/etc/dt/appconfig/types/C,/usr/dt/appconfig/types/%L,/usr/dt/appconfig/types/CVENDORsunXMICONSEARCHPATH/home/student/2003/a03guswi/.dt/icons/%B%M.pm:/home/student/2003/a03guswi/.dt/icons/%B%M.bm:/home/student/2003/a03guswi/.dt/icons/%B:/usr/dt/appconfig/icons/%L/%B%M.pm:/usr/dt/appconfig/icons/%L/%B%M.bm:/usr/dt/appconfig/icons/%L/%B:/usr/dt/appconfig/icons/C/%B%M.pm:/usr/dt/appconfig/icons/C/%B%M.bm:/usr/dt/appconfig/icons/C/%BLC_CTYPECGNOME_KEYRING_SOCKET/var/tmp/keyring-6VSyxE/socketUTDEVROOT/tmp/SUNWut/sessions/34/unitSTART_SPECKEYSDnoSESSIONTYPEaltDtDTAPPSEARCHPATH/home/student/2003/a03guswi/.dt/appmanager:/etc/dt/appconfig/appmanager/%L:/etc/dt/appconfig/appmanager/C:/usr/dt/appconfig/appmanager/%L:/usr/dt/appconfig/appmanager/CDTUSERSESSIONa03guswi-frigg-34OPENWINHOME/usr/openwin_/usr/bin/gnome-sessionDESKTOP_STARTUP_IDSDT_NO_TOOLTALK1MACHTYPEsparcSHELL/bin/tcshSESSION_MANAGERlocal/frigg:/tmp/.ICE-unix/22161,inet6/frigg:38974,inet/frigg:[EMAIL
 PROTECTED],UTF-8SUN_SUNRAY_TOKENpseudo.080020b9346f

I want to divide it into something like

HOST=frigg
AUDIODEV=HOSTfriggAUDIODEV/tmp/SUNWut/dev/utaudio/8dtstart_sessionlogfile/dev/null
DTSCREENSAVERLISTS=tartDtscreenBlank
XMBINDDIR=/usr/dt/lib/bindings
UTAUDIODEV=/tmp/SUNWut/dev/utaudio/
8AB_CARDCATALOG=/usr/dt/share/answerbooks/C/ab_cardcatalog
LC_ALLCDTLOGINDISPLAYCLASS=SunRay
OSTYPEsolarisPWD/home/student/2003/a03guswi/ht05USERa03guswiSESSION_SVRfriggLANGCLOGNAMEa03guswiGROUPstudentGNOME_DESKTOP_SESSION_IDDefaultG_BROKEN_FILENAMESyesSHLVL2XMICONBMSEARCHPATH/home/student/2003/a03guswi/.dt/icons/%B%M.bm:/home/student/2003/a03guswi/.dt/icons/%B%M.pm:/home/student/2003/a03guswi/.dt/icons/%B:/usr/dt/appconfig/icons/%L/%B%M.bm:/usr/dt/appconfig/icons/%L/%B%M.pm:/usr/dt/appconfig/icons/%L/%B:/usr/dt/appconfig/icons/C/%B%M.bm:/usr/dt/appconfig/icons/C/%B%M.pm:/usr/dt/appconfig/icons/C/%BPATH/usr/local/bin/system:/usr/bin:/usr/openwin/bin:/opt/SUNWspro/bin:/usr/ccs/bin:/usr/ucb:/opt/SUNWut/bin:/usr/sfw/bin:/opt/sfw/bin:/usr/local/bin:/openpkg/bin:/usr/dt/bin:.WINDOWID9437227DTXSERVERLOCATIONlocalCOLORTERMgnome-terminalHELPPATH/usr/openwin/lib/locale:/usr/openwin/lib/helpHOSTTYPEsun4DTDEVROOT/tmp/SUNWut/sessions/34TERMxtermHOME/home/student/2003/a03guswiCORONA_TOKENpseudo.080020b9346fXFILESEARCHPATH/usr/openwin/lib/locale/%L/%T/%N%S:/usr/openwin/lib/%T/%N%SMANPATH/usr/man:/usr/openwin/man:/usr/dt/man:/usr/local/man:/opt/SUNWspro/man:/openpkg/man:/opt/SUNWut/man:/usr/sfw/man:/opt/sfw/manDISPLAYfrigg:34DTHELPSEARCHPATH/home/student/2003/a03guswi/.dt/help/a03guswi-frigg-34/%H:/home/student/2003/a03guswi/.dt/help/a03guswi-frigg-34/%H.sdl:/home/student/2003/a03guswi/.dt/help/a03guswi-frigg-34/%H.hv:/home/student/2003/a03guswi/.dt/help/%H:/home/student/2003/a03guswi/.dt/help/%H.sdl:/home/student/2003/a03guswi/.dt/help/%H

Re: [PHP-I18N] Encoding detection

2001-03-18 Thread Gustav Foseid

Atanas Vassilev:
> I need a way to detect default browser encoding so that i can set a
> variable for language and present the whole site in different
> languages based on encoding. I know encoding does not determine
> language but I only have to switch between german and bulgarian so in
> my case encoding will do the trick... of course if I knew a way to get
> the encoding of the user's browser...

You have the information you need in $HTTP_ACCEPT_CHARSET.

-- 
Gustav Foseid, Initio IT-løsninger AS
[EMAIL PROTECTED]

-- 
PHP Internationalization Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-I18N] Encoding detection

2001-03-19 Thread Gustav Foseid

Atanas Vassilev:
> I formed my include like this:
> include "lang_".$HTTP_ACCEPT_LANGUAGE.".INC";

This will not work properly. Firts of all, youmight get a request from
someone having another language set in their preferences. You can also have
more than one language set, in my requests HTTP_ACCEPT_LANGUAGE is set to
"no, en, sv".

-- 
Gustav Foseid, Initio IT-løsninger AS
[EMAIL PROTECTED]

-- 
PHP Internationalization Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] source code protection

2005-02-26 Thread Gustav Wiberg
Hi there!
What's the point of doing that? The PHP-codes are well protected if they are 
on a well
configured server.

/G
@varupiraten.se
- Original Message - 
From: "shabanip" <[EMAIL PROTECTED]>
To: 
Sent: Saturday, February 26, 2005 4:43 PM
Subject: [PHP] source code protection


is there any way to protect PHP files source code?
thanks,
Payam Shabanian
shabanip -at- avapajoohesh.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 266.5.0 - Release Date: 2005-02-25


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 266.5.0 - Release Date: 2005-02-25
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Apache and PHP

2005-02-28 Thread Gustav Wiberg
Hi there!
I've just installed Apache on a new computer. (just for testing)
It's Windows XP. I've then installed PHP and it says that Apache could be 
not configured automatically.

Newbies question as hell probably but here it goes:
I can access my Apache-server, I have the document-root to c:\webb and the 
apace-files is in c:\program\Apache
I've changed a little in httpd.conf file and restarted the Apace-service. I 
have changed the documentRoot and another parameter that was very alike 
documentRoot...

But my problem...
The sourcecode for PHP shows when I access the http-server with php-files.
I don't cant getting any full support answers on this, just give me hints... 
:-)

/G
@varupiraten.se 

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


Re: [PHP] Apache and PHP

2005-02-28 Thread Gustav Wiberg
Hi there!
Thanx! :-)
I hope I can solve this myself now... :-)
/G
@varupiraten.se
- Original Message - 
From: "dan" <[EMAIL PROTECTED]>
To: 
Sent: Monday, February 28, 2005 11:23 PM
Subject: Re: [PHP] Apache and PHP


Gustav Wiberg wrote:
Hi there!
I've just installed Apache on a new computer. (just for testing)
It's Windows XP. I've then installed PHP and it says that Apache could be 
not configured automatically.

Newbies question as hell probably but here it goes:
I can access my Apache-server, I have the document-root to c:\webb and 
the apace-files is in c:\program\Apache
I've changed a little in httpd.conf file and restarted the Apace-service. 
I have changed the documentRoot and another parameter that was very alike 
documentRoot...

But my problem...
The sourcecode for PHP shows when I access the http-server with 
php-files.

I don't cant getting any full support answers on this, just give me 
hints... :-)

/G
@varupiraten.se
Check out:
http://www.php.net/manual/en/install.windows.apache2.php
Pay particular attention to the AddType directives.  This will make Apache 
"process" PHP files.

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


[PHP] Sessions and frames

2005-04-14 Thread Gustav Wiberg
Hi there!
I have built my site into frames.
I want to transfer a session-variable from my left frame to my right 
frame... How do I do this best? Thoughts?

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


Re: [PHP] Sessions and frames

2005-04-16 Thread Gustav Wiberg
Hi there!
Thanx a lot, i thought it was like that, but I wasn't sure
/G
@varupiraten.se
- Original Message - 
From: "Chris W. Parker" <[EMAIL PROTECTED]>
To: "Gustav Wiberg" <[EMAIL PROTECTED]>; "PHP General" 

Sent: Friday, April 15, 2005 1:26 AM
Subject: RE: [PHP] Sessions and frames

Gustav Wiberg <mailto:[EMAIL PROTECTED]>
   on Thursday, April 14, 2005 4:00 PM said:
I have built my site into frames.
I want to transfer a session-variable from my left frame to my right
frame... How do I do this best? Thoughts?
You do this best by setting some session data on one page (any page),
and then accessing that same data on another page (any page). If both
frame sources are within the same domain they both have access to the
same session data.

Chris.
--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.11 - Release Date: 2005-04-14
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Single SQL-statement in PHP to order...

2005-04-18 Thread Gustav Wiberg
Hi there!
I guess this is off-topic? but I want to know if this is possible. (If 
there's anyone out there that have a solution, I would appreciate it 
though)

I want to know if there is anyway of showing tables in PHP in an order 
like this in a single SQL-statement...

Table is like this:
IDCategory
7
15
4
3
I want to order the table like this: First everything that is IDCategory 
4, then the rest of the posts (doesn't matter which order)

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


[PHP] Re: [PHP-WIN] Confused

2007-08-24 Thread Gustav Wiberg

AHA.. Thanx :-)

/Gustav

- Original Message - 
From: "John Mertic" <[EMAIL PROTECTED]>

To: "Gustav Wiberg" <[EMAIL PROTECTED]>
Cc: "Aaron Kenney" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, August 24, 2007 9:47 PM
Subject: Re: [PHP-WIN] Confused



Just grab the windows installer and choose LDAP under the Extensions tree.

John

On 8/24/07, Gustav Wiberg <[EMAIL PROTECTED]> wrote:

Hi again!

Sorry I'm so dumb, but what exactly should I download? I've tried to
download OpenLDAP (Is this wrong?)
ftp://ftp.openldap.org/pub/OpenLDAP/openldap-stable/openldap-stable-20070110.tgz
but I found no php_ldap.dll

Best regards
/Gustav Wiberg


- Original Message -
From: "Aaron Kenney" <[EMAIL PROTECTED]>
To: "Gustav Wiberg" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, August 24, 2007 4:44 PM
Subject: Re: [PHP-WIN] Confused


> To get LDAP working in PHP for Windows, you first need to download the
> ZIP package of PHP. Extract the ZIP package to some folder (do NOT
> overwrite your PHP installation!). From the files you have extracted,
> open the /ext folder and copy the php_ldap.dll file. Paste   the file
> into the /ext folder of your PHP installation. Make sure that the file
> has appropriate security so that your web server can access it.
> Then edit the php.ini file and remove the ; so that the line
>
> ;extension=php_ldap.dll
>
> reads
>
> extension=php_ldap.dll
>
> if you do not have the original line, simply add the new line before
> the Module Settings section. Restart IIS or Apache (whichever one you
> are using).
>
> Here is an example of connecting and binding:
>
> $ldaprdn = '[EMAIL PROTECTED]';
> $ldappass = 'PWD';
> $ds = 'servername.domainname.net';
> $dn = 'dc=domainname,dc=net';
> $ldapport = 389;
> $ldapconn = ldap_connect($ds, $ldapport)
> or die("Could not connect to LDAP server.");
>
> if ($ldapconn)
> {
> ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION,3);
> ldap_set_option($ldapconn, LDAP_OPT_REFERRALS,0);
> $ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass);
> }
>
> I hope this helps.
> -Aaron Kenney
>
> On 8/24/07, Gustav Wiberg <[EMAIL PROTECTED]> wrote:
>> Hi there!
>>
>> Yes, thank you - please send me examples. LDAP seems to be a part of
>> Active Directory. I guess in true Microsoft-spirit, it isn't possible 
>> to

>> turn it on or off.
>>
>> It seems you have to compile LDAP together with PHP on Windows. How do 
>> I
>> do that? I tried to follow the instructions on php.net but I got 
>> lost...

>>
>> Best regards
>> /Gustav Wiberg
>>
>>
>>
>> -Original Message-
>> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>> Sent: Friday, August 24, 2007 4:04 PM
>> To: Gustav Wiberg
>> Subject: Re: [PHP-WIN] Confused
>>
>> I don't know exactly how to do it but LDAP connection is available as 
>> a
>> setting on active directory. I'm not sure how one turns it on or off, 
>> but
>> it is possible. It was discussed on this list some time ago. I can 
>> send

>> you an example of the script I used to connect if needed.
>> Sent via BlackBerry from T-Mobile
>>
>> -Original Message-
>> From: Gustav Wiberg <[EMAIL PROTECTED]>
>>
>> Date: Fri, 24 Aug 2007 15:56:00
>> To:"'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
>> Subject: FW: [PHP-WIN] Confused
>>
>> Hello!
>>
>> IS Active Directory an LDAP server? (dumb question I know but I need 
>> to

>> know :-))
>>
>> Best regards
>> /Gustav Wiberg
>>
>>
>> -Original Message-
>> From: Gustav Wiberg [mailto:[EMAIL PROTECTED]
>> Sent: Friday, August 24, 2007 3:53 PM
>> To: '[EMAIL PROTECTED]'
>> Subject: [PHP-WIN] Confused
>>
>> Hi!
>>
>> LDAP Server, LDAP Client
>>
>> LDAP is a protocol
>>
>>
>> LDAP Client is needed to be installed and compiled together with PHP 
>> so

>> it would work.
>>
>> Do I Have to install an LDAP Server also? Where do I find that? *can't
>> figure it out really*
>>
>>
>>
>> /Gustav
>>
>>
>> No virus found in this outgoing message.
>> Checked by AVG Free Edition.
>> Version: 7.5.484 / Virus Database: 269.12.4/969 - Release Date:
>> 2007-08-23 16:04
>>
>>
>> --
>> PHP Windows Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>> No virus found in this outgoing message.
>> Checked by AVG Free Edition.
>> Version: 7.5.484 / Virus Database: 269.12.4/969 - Release Date:
>> 2007-08-23 16:04
>>
>>
>> --
>> PHP Windows Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>

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





--
--
John Mertic"Explaining a joke
is like dissecting a frog: you
[EMAIL PROTECTED]  understand it better,
but the frog dies in the
 process."

 -Mark Twain



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



[PHP] Why not user...?

2007-08-27 Thread Gustav Wiberg

Hi!

Why is it so that I get this error. I'm using Windows Integrated 
authorization-method for actual webb I'm testing on.


Notice: Undefined index: PHP_AUTH_USER in C:\www\utveckling\username.php on 
line 2



?

Best regards
/Gustav Wiberg 


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



Re: [PHP] Why not user...?

2007-08-27 Thread Gustav Wiberg

Hi!

Thanx!
I figured it out. The username wasn't in server-variable PHP_AUTH_USER but 
in AUTH_USER 


Best regards
/Gustav Wiberg


- Original Message - 
From: "Stut" <[EMAIL PROTECTED]>

To: "Gustav Wiberg" <[EMAIL PROTECTED]>
Cc: "PHP General" 
Sent: Monday, August 27, 2007 3:51 PM
Subject: Re: [PHP] Why not user...?



Gustav Wiberg wrote:
Why is it so that I get this error. I'm using Windows Integrated 
authorization-method for actual webb I'm testing on.


Notice: Undefined index: PHP_AUTH_USER in C:\www\utveckling\username.php 
on line 2


For some reason it's not getting set. This could be because you've not 
configured IIS correctly, are you sure you've disabled anonymous 
authentication?


If you're sure it's configured correctly try var_dump'ing $_SERVER - it's 
possible (though unlikely) the username is in another place.


-Stut

--
http://stut.net/



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



[PHP] why?

2007-08-27 Thread Gustav Wiberg

Hi!

I can't figure the thing with Windows Integrated authentication... I have 
checked a website for doing this. I still have to enter username and 
password even if I'm on the local computer (through a VPN though) This would 
be the same as using computer locally on the network, but I have to enter 
username and password. I'm sure I have checked the "Windows Integreated 
authenication" - checkbox for the website it's about.


When I have entered username and password I can go on and do whatever I want 
on that site...


I've tested with both IE6, and IE7. What could be the problem?

Best regards
/Gustav Wiberg

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



[PHP] windows auth with php

2007-08-27 Thread Gustav Wiberg

Hi again!

I read
"The HTTP Authentication hooks in PHP are only available when it is running 
as an Apache module and is hence not available in the CGI version. In an 
Apache module PHP script, it is possible to use the header() function to 
send an "Authentication Required" message to the client browser causing it 
to pop up a Username/Password input window. Once the user has filled in a 
username and a password, the URL containing the PHP script will be called 
again with the predefined variables PHP_AUTH_USER, PHP_AUTH_PW, and 
AUTH_TYPE set to the user name, password and authentication type 
respectively. These predefined variables are found in the $_SERVER and 
$HTTP_SERVER_VARS arrays. Both "Basic" and "Digest" (since PHP 5.1.0) 
authentication methods are supported. See the header() function for more 
information."



I'm checking Windows Integrated Authentication in IIS 6.0 and I'm using PHP 
5.0.1.


PHP is working as an ISAPI-module. Is this the problem? Is that why the 
authentication is not working automatically? (without logging in with 
username and password at first)


Or is the version of PHP the problem? Should it be larger than 5.1.0 ? Is 
that why the authentication is not working automatically? (without logging 
in with username and password at first)


I'm trying with IE6 and IE7...


Best regards
/Gustav Wiberg






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



Re: [PHP] why?

2007-08-27 Thread Gustav Wiberg

Hi!

No it doesn't seem to work locally either (I haven't tested myself, but a 
working-friend did)


Best regards
/Gustav Wiberg

- Original Message - 
From: "Stut" <[EMAIL PROTECTED]>

To: "Gustav Wiberg" <[EMAIL PROTECTED]>
Cc: "PHP General" 
Sent: Monday, August 27, 2007 8:51 PM
Subject: Re: [PHP] why?



Gustav Wiberg wrote:
I can't figure the thing with Windows Integrated authentication... I have 
checked a website for doing this. I still have to enter username and 
password even if I'm on the local computer (through a VPN though) This 
would be the same as using computer locally on the network, but I have to 
enter username and password. I'm sure I have checked the "Windows 
Integreated authenication" - checkbox for the website it's about.


When I have entered username and password I can go on and do whatever I 
want on that site...


I've tested with both IE6, and IE7. What could be the problem?


Transparent authentication between IE and IIS may not work over a VPN 
depending on a huge number of factors, but mainly how the VPN server has 
been configured.


Does it work when on the same network as the web server and AD server?

-Stut

--
http://stut.net/



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



Re: [PHP] why?

2007-08-27 Thread Gustav Wiberg

Hi!

Ok. Of course Why didn't I think of that? Thanx! :-)

Best regards
/Gustav Wiberg


- Original Message - 
From: "Stut" <[EMAIL PROTECTED]>

To: "Gustav Wiberg" <[EMAIL PROTECTED]>
Cc: "PHP General" 
Sent: Monday, August 27, 2007 8:59 PM
Subject: Re: [PHP] why?



Gustav Wiberg wrote:
No it doesn't seem to work locally either (I haven't tested myself, but 
a working-friend did)


I suggest you find a Windows Server mailing list and ask there. This is 
almost certainly not an issue with PHP.


You might also want to find/write an ASP script that will show the 
username of the logged in user so you can take PHP out of the equation. 
Once it's working with ASP it should work with PHP.


-Stut


- Original Message - From: "Stut" <[EMAIL PROTECTED]>
To: "Gustav Wiberg" <[EMAIL PROTECTED]>
Cc: "PHP General" 
Sent: Monday, August 27, 2007 8:51 PM
Subject: Re: [PHP] why?



Gustav Wiberg wrote:
I can't figure the thing with Windows Integrated authentication... I 
have checked a website for doing this. I still have to enter username 
and password even if I'm on the local computer (through a VPN though) 
This would be the same as using computer locally on the network, but 
I have to enter username and password. I'm sure I have checked the 
"Windows Integreated authenication" - checkbox for the website it's 
about.


When I have entered username and password I can go on and do whatever 
I want on that site...


I've tested with both IE6, and IE7. What could be the problem?


Transparent authentication between IE and IIS may not work over a VPN 
depending on a huge number of factors, but mainly how the VPN server 
has been configured.


Does it work when on the same network as the web server and AD server?


-Stut

--
http://stut.net/



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



Re: [PHP] why?

2007-08-27 Thread Gustav Wiberg

Hi!

Yes, a single sign-on it is... It doesn't work together with Windows (and 
PHP) you mean?


Best regards
/Gustav Wiberg

- Original Message - 
From: "Jay Blanchard" <[EMAIL PROTECTED]>
To: "Jay Blanchard" <[EMAIL PROTECTED]>; "Gustav Wiberg" 
<[EMAIL PROTECTED]>; "PHP General" 

Sent: Monday, August 27, 2007 9:26 PM
Subject: RE: [PHP] why?


[snip]
... be the same as using computer locally on the network, but I have
to
enter username and password. I'm sure I have checked the "Windows
Integreated authenication" - checkbox for the website it's about.

When I have entered username and password I can go on and do whatever I
want on that site...

I've tested with both IE6, and IE7. What could be the problem?

http://us.php.net/features.http-auth
[/snip]

I hit send before I finished my thoughts

Are you trying to do single sign-on? This would be one of the holy
grails of the PHP on Linux, Windows clients operations. This is
available with .Net and with legacy ASP/Jscript apps but not with
PHPeven on windows

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



Re: [PHP] Why not user...?

2007-08-27 Thread Gustav Wiberg

Hi!

Thnank you for your input, but I used AUTH_USER-server variable instead of 
PHP_AUTH_USER and that did the trick! :-)


Best regards
/Gustav W iberg

- Original Message - 
From: "Richard Lynch" <[EMAIL PROTECTED]>

To: "Stut" <[EMAIL PROTECTED]>
Cc: "Gustav Wiberg" <[EMAIL PROTECTED]>; "PHP General" 


Sent: Tuesday, August 28, 2007 3:20 AM
Subject: Re: [PHP] Why not user...?



On Mon, August 27, 2007 8:51 am, Stut wrote:

Gustav Wiberg wrote:

Why is it so that I get this error. I'm using Windows Integrated
authorization-method for actual webb I'm testing on.

Notice: Undefined index: PHP_AUTH_USER in
C:\www\utveckling\username.php
on line 2


For some reason it's not getting set. This could be because you've not
configured IIS correctly, are you sure you've disabled anonymous
authentication?

If you're sure it's configured correctly try var_dump'ing $_SERVER -
it's possible (though unlikely) the username is in another place.


Going for the more obvious...

Did you perhaps take code written with the default setting of E_ALL ~
E_NOTICE and are now running it with E_ALL, and this is the first
page-view before you've even typed in your usernane/password?

Cuz that for sure would do it.

Change the code to be more like this:

if (isset($_SERVER['PHP_AUTH_USER'])){
 //try to login
}

You'll probably have a fair number of these E_NOTICE thingies to fix
before you are through.

They're all trivial to fix, and there's no real excuse to have code
that has E_NOTICE messages firing off anyway.

Under extreme pressure, you can switch to E_ALL ~ E_NOTICE for this
app for now and put it on the ToDo list to fix it right someday...

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?




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



[PHP] Open Source mailinglist?

2006-07-19 Thread Gustav Wiberg

Hi there!

I hope you don't kill me out there, but I'm totally out of luck here. I've 
been doing some research on Open Source questions because I want a product 
of mine to become better in any ways (yes, it's written in PHP and yes, it's 
Open Source). Because of not doing advertising here, I'll skip the name :-)


I can't seem to find any place on the net where you can discuss Open 
Source-related questions in general???


Best regards
/Gustav Wiberg 


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



Re: [PHP] Open Source mailinglist?

2006-07-19 Thread Gustav Wiberg


[snip]
I hope you don't kill me out there, but I'm totally out of luck here.
I've
been doing some research on Open Source questions because I want a
product
of mine to become better in any ways (yes, it's written in PHP and yes,
it's
Open Source). Because of not doing advertising here, I'll skip the name
:-)

I can't seem to find any place on the net where you can discuss Open
Source-related questions in general???
[/snip]

Don't Sourceforge and Freshmeat have lists?

I've checked there, but I just find newsletters. At freshmeat I found some 
chat-function located at IRC, and I don't want to install IRC.

, but no mailinglists...
(or else I'm blind)

Best regards
/Gustav Wiberg 


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



[PHP] Quotes?

2006-09-05 Thread Gustav Wiberg

I want to save this to a string...


</pre><tt>var uri = '<a  rel="nofollow" href="http://impse.tradedoubler.com/imp/img/16352388/1122503">http://impse.tradedoubler.com/imp/img/16352388/1122503</a>?' + new 
</tt><tt>String (Math.random()).substring (2, 11);
</tt><tt>document.write('<a 
</tt><tt>href="<a  rel="nofollow" href="http://clk.tradedoubler.com/click?p=48859&a=1122503&g=16352388"">http://clk.tradedoubler.com/click?p=48859&a=1122503&g=16352388"</a>; 
</tt><tt>target="_blank"><img src="'+uri+'" border=0></a>');
</tt><pre style="margin: 0em;">



How could i type?

I've tried with ' and ".. but can't get it to work.

tested diffrent types..
$str = '';
</pre><tt>$str = 'var uri = '<a  rel="nofollow" href="http://impse.tradedoubler.com/imp/js/16350344/1122503">http://impse.tradedoubler.com/imp/js/16350344/1122503</a>?' + 
</tt><tt>new String (Math.random()).substring (2, 11);';
</tt><tt>$str = ""document.write('<sc'+'ript language="JavaScript" src="'+uri+'" 
</tt><tt>charset="ISO-8859-1"></sc'+'ript>');"";
</tt><pre style="margin: 0em;">
$str = """";

Best regards
/Gustav Wiberg
Stammis Internet

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



[PHP] Random pictures - not twice

2006-12-03 Thread Gustav Wiberg

Hi there!

I have created a script the generates random pictures...


  



With this above script the same picture can be shown twice. Is there any 
smart way of avoiding this without having to rely on cookies/sessionids?


Best regards
/Gustav Wiberg
Stammis Internet - http://www.stammis.com/ - pedigrees on the net

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



Re: [PHP] Random pictures - not twice

2006-12-03 Thread Gustav Wiberg
- Original Message - 
From: <[EMAIL PROTECTED]>

To: 
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, December 03, 2006 11:52 PM
Subject: Re: [PHP] Random pictures - not twice


Without using cookies or session information, you're going to go through 
your picture list faster depending on how many users are accessing the 
random pic page.  If you don't make it user-specific, then it doesn't 
really matter if you go through the images sequentially.. it may appear 
random on the user end because other users are going to be grabbing 
sequential pics as well.


If you want to stir the waters a bit, you could run them sequentially but 
randomize the sequence.  This is what some music playlist programs do when 
you randomize a playlist.  Instead of pulling a random song from the list 
and risking playing the same song back to back, it just shuffles the 
playlist and plays it sequentially.  When you get to the end of your 
randomized list, you can re-shuffle it and start over.  This gives some 
semblance of randomness.


If you want to make sure each image gets its fair amount of time in the 
spotlight,  you could keep track of how many times each image has been 
displayed.  Having a database table with a list of all the image names and 
their 'served' count would let you weight your list a bit to give 
preference to the images that havn't been displayed that often.



And if you want to give each user the total package, you can keep track of 
how many times each image was served to a specific user and weight your 
shuffling that way.



I'm sure there are other ways, but there are just a few that may be viable 
for you, depending on the level of randomness per user you need.


Let us know what solution you come up with.  I'm sure others have had 
similar questions and just havn't asked.


-TG

= = = Original message = = =

Hi there!

I have created a script the generates random pictures...


  



With this above script the same picture can be shown twice. Is there any
smart way of avoiding this without having to rely on cookies/sessionids?

Best regards
/Gustav Wiberg
Stammis Internet - http://www.stammis.com/ - pedigrees on the net



___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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



Hi again!

I've solved it with array_rand. It wasn't that hard at all, just had to know 
which function to use! :-)


code:



Best regards
/Gustav Wiberg
Stammis Internet - http://www.stammis.com/ - pedigrees on the net

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



Re: [PHP] Random pictures - not twice

2006-12-04 Thread Gustav Wiberg


- Original Message - 
From: "tedd" <[EMAIL PROTECTED]>
To: "Gustav Wiberg" <[EMAIL PROTECTED]>; "PHP General" 


Sent: Monday, December 04, 2006 4:15 PM
Subject: Re: [PHP] Random pictures - not twice



At 11:20 PM +0100 12/3/06, Gustav Wiberg wrote:

Hi there!

I have created a script the generates random pictures...


-snip-

With this above script the same picture can be shown twice. Is there any 
smart way of avoiding this without having to rely on cookies/sessionids?


Random does mean it can happen more than once. I think what you want is 
more along a shuffle. Look into the array function "shuffle".


Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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


Hi there!

Ok, thanx! I will check the function out :-)

Best regards
Gsutav Wiberg
http://www.stammis.com/ - Stammis Internet - pedigrees on the net

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



[PHP] RSS / XML

2006-02-25 Thread Gustav Wiberg

Hi there guys!

Where is a good startpoint for learning XML Reader on a very, very basic 
level? (I appreciate links)

Is RSS a technique for retrieving XML? I can't clue the pieces together...

/G

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



Re: [PHP] RSS / XML

2006-02-25 Thread Gustav Wiberg
- Original Message - 
From: "Weber Sites LTD" <[EMAIL PROTECTED]>
To: "'Gustav Wiberg'" <[EMAIL PROTECTED]>; "'PHP General'" 


Sent: Saturday, February 25, 2006 7:37 PM
Subject: RE: [PHP] RSS / XML



Here are a few (from easy to hard)

Parsing XML With DOMXML And PHP
http://www.weberdev.com/ViewArticle-158.html

Converting XML Into a PHP Data Structure
http://www.weberdev.com/ViewArticle-389.html

Building XML Trees with PEAR's XML_Tree Class
http://www.weberdev.com/ViewArticle-345.html

Building XML Web Services with PHP NuSOAP
http://www.weberdev.com/ViewArticle-336.html

Serializing XML With PHP
http://www.weberdev.com/ViewArticle/450

Injecting XML Content Into Page Templates With patXMLRenderer
http://www.weberdev.com/ViewArticle/441

berber
-Original Message-
From: Gustav Wiberg [mailto:[EMAIL PROTECTED]
Sent: Saturday, February 25, 2006 2:55 PM
To: PHP General
Subject: [PHP] RSS / XML

Hi there guys!

Where is a good startpoint for learning XML Reader on a very, very basic
level? (I appreciate links) Is RSS a technique for retrieving XML? I can't
clue the pieces together...

/G

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

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


Thanx!

/G 


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



[PHP] Expat + PHP Examples...

2006-02-25 Thread Gustav Wiberg

Hi there!

I've found out that I can use expat XML, but I can't figure out HOW to 
use... it seems simple, but I tried and can't figure it out...


I'd like to get retrieve info from
http://www.frisim.com/frisim/servlet/rss?searchString=google

and convert it to html...

I've read a lot a of text for Expat, but found no really good example (I 
found one at phpbuilder.com but with links that went to xml-files that 
didn't exists ):


Someone who have used expat.. ..and can give me a hint...

/G 


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



[PHP] HOW update time and date-fields to mysql....

2006-02-28 Thread Gustav Wiberg

Hi there guys!

I have used a date-field and a time-field in a mysql-database.

How should I update these fields through php?
This is my code now (it works fine locally with data on a win-machine, but 
not on Linux at my webhotel - Time doesn't work at all)



function safeQuote($value)
{
  // Stripslashes
  if (get_magic_quotes_gpc()) {
  $value = stripslashes($value);
  }
  // Quote if not integer
  if (!is_numeric($value)) {
  $value = "'" . mysql_real_escape_string($value) . "'";
  }

  return $value;
}


$sql = "UPDATE tbforum SET";
$sql .= " question=" . safeQuote($frmQuestion);
$sql .= ", insertDate='" . $dat . "'";
$sql .= ", insertTime='" . time() . "'";
$sql .= " WHERE IDForum=" . safeQuote($idForum);
$querys = mysql_query($sql);

/G 


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



[PHP] About date & time...

2006-02-28 Thread Gustav Wiberg

Hi

Thanx for your input about date & time...

Here's some functions that worked for me after some searching...


function currenttime() {

$today = getdate();

$ithours = $today["hours"];
if (intval($ithours)<10) {
 $ithours = "0" . $ithours;
}

$itminutes = $today["minutes"];
if (intval($ithours)<10) {
 $ithours = "0" . $ithours;
}

$itseconds = $today["seconds"];
if (intval($itseconds)<10) {
 $itseconds = "0" . $itseconds;
}


$it = $ithours . ":" . $itminutes . ":" . $itseconds;
return $it;
}

function currentdate() {

$today = getdate();

$idyear = $today["year"];
if (intval($idyear)<10) {
 $idyear = "0" . $idyear;
}

$idmonthnr = $today["mon"];
if (intval($idmonthnr )<10) {
 $idmonthnr  = "0" . $idmonthnr ;
}

$idmonthday = $today["mday"];
if (intval($idmonthday)<10) {
 $idmonthday = "0" . $idmonthday;
}


$id = $idyear . "-" . $idmonthnr . "-" . $idmonthday;
return $id;

}

$insertTime = currenttime();
$insertDate = currentdate();



/G

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



Re: [PHP] About date & time...

2006-02-28 Thread Gustav Wiberg


- Original Message - 
From: "tedd" <[EMAIL PROTECTED]>

To: ; "Gustav Wiberg" <[EMAIL PROTECTED]>
Sent: Tuesday, February 28, 2006 4:17 PM
Subject: Re: [PHP] About date & time...



>Thanx for your input about date & time...


Here's some functions that worked for me after some searching...

function currenttime() {

-snip- lot's of code.


Hi Gustav:

Not meaning to embarrass, but your code could be shortened considerably by 
using date(), like so:


Your lengthy  -- function currenttime()

can be replaced simply with:

   echo("Date: " . date('Y\-\ m\-\ d') . "" );

and your -- function currentdate()

can be replaced with:

echo("Time: " . date('h\:\ i\:\ s') . "" );

If you don't like the spaces in the output, then strip them out, like so:

$date = date('Y\-\ m\-\ d');
$date = str_replace(" ", "", $date);
echo("Date: " . $date. "" );

and

$date = date('h\:\ i\:\ s') ;
$date = str_replace(" ", "", $date);
echo("Time: " . $date. "" );

You can find more code examples at:

http://www.weberdev.com/AdvancedSearch.php?searchtype=title&search=date&Submit1.x=0&Submit1.y=0


tedd

--

http://sperling.com


Hi there!

Not meaning to embarrass, but your code could be shortened considerably by 
using date(), like so:
*hehe* It's all okey, it was something like this you're typing that I was 
searching for, but couldn't find it exactly as I wanted. Thanx a lot!!! :-) 
I really appreciate it!


/G 


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



Re: [PHP] About date & time...

2006-02-28 Thread Gustav Wiberg


- Original Message - 
From: "tedd" <[EMAIL PROTECTED]>

To: ; "Gustav Wiberg" <[EMAIL PROTECTED]>
Sent: Tuesday, February 28, 2006 4:17 PM
Subject: Re: [PHP] About date & time...



>Thanx for your input about date & time...


Here's some functions that worked for me after some searching...

function currenttime() {

-snip- lot's of code.


Hi Gustav:

Not meaning to embarrass, but your code could be shortened considerably by 
using date(), like so:


Your lengthy  -- function currenttime()

can be replaced simply with:

   echo("Date: " . date('Y\-\ m\-\ d') . "" );

and your -- function currentdate()

can be replaced with:

echo("Time: " . date('h\:\ i\:\ s') . "" );

If you don't like the spaces in the output, then strip them out, like so:

$date = date('Y\-\ m\-\ d');
$date = str_replace(" ", "", $date);
echo("Date: " . $date. "" );

and

$date = date('h\:\ i\:\ s') ;
$date = str_replace(" ", "", $date);
echo("Time: " . $date. "" );

You can find more code examples at:

http://www.weberdev.com/AdvancedSearch.php?searchtype=title&search=date&Submit1.x=0&Submit1.y=0


tedd

--

http://sperling.com


Hi there!

I've now done coding like this...


function currenttime() {

 $t = date('h\:\ i\:\ s');
 $returnTime = str_replace(" ", "", $t);
 return $returnTime;

}

function currentdate() {

 $d = date('Y\-\ m\-\ d');
 $returnDate = str_replace(" ", "", $d);
 return $returnDate;

}

$insertTime = currenttime();
$insertDate = currentdate();

I'm a swede, and I we use hours 0 - 24.

8 pm = 20 for us.
9 pm = 21 for us
10 pm = 22...

and so on...

But with date()-function there is 10 pm that shows (and I want 22 to show 
instead)


I'm using PHP 4.0.3...

Do I have to use getdate() then? (getdate()-function showed 22...)

/G

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



Re: [PHP] About date & time...

2006-02-28 Thread Gustav Wiberg


- Original Message - 
From: "Grant Young" <[EMAIL PROTECTED]>

To: 
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, February 28, 2006 11:25 PM
Subject: Re: [PHP] About date & time...



Hi Gustav.



I'm a swede, and I we use hours 0 - 24.

8 pm = 20 for us.
9 pm = 21 for us
10 pm = 22...

and so on...

But with date()-function there is 10 pm that shows (and I want 22 to 
show instead)


I'm using PHP 4.0.3...

Do I have to use getdate() then? (getdate()-function showed 22...)


The docs for date() (http://www.php.net/date) show that there are a 
number of different options for the first parameter.  If you check out 
the table on that page, you'll find:


>> H | 24-hour format of an hour with leading zeros | 00 through 23

With this in mind, the following will work (if I understand your 
question correctly):


$t = date('H\:\ i\:\ s');

HTH, Grant


AHA!!!

Sometimes I'm so stupid... hm...

Thanx! :-)

/G

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



Re: [PHP] About date & time...

2006-02-28 Thread Gustav Wiberg


- Original Message - 
From: "tedd" <[EMAIL PROTECTED]>

To: ; "Gustav Wiberg" <[EMAIL PROTECTED]>
Sent: Tuesday, February 28, 2006 11:34 PM
Subject: Re: [PHP] About date & time...



Gustav:


I'm a swede, and I we use hours 0 - 24.


Well... I don't know what I am, but non sum qualis eram.

In any event, you want military time -- simple enough -- just change the h 
to H, like so:


  echo("Time: " . date('H\:\ i\:\ s') . "" );

You can find more code examples at:

http://www.weberdev.com/AdvancedSearch.php?searchtype=title&search=date&Submit1.x=0&Submit1.y=0

Also, you need to review the php manual regarding date() -- it's a super 
function that has lot's of formatting symbols.


tedd

--

http://sperling.com

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


Yes, thanx! I've totally missed the part about 12/24-h setting... :-)

/G

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



[PHP] Mailto members..?

2006-03-01 Thread Gustav Wiberg

Hi guys!

Anyone knows of something like this, but for free?
http://www.webscriptsdirectory.com/PHP/E-Mail-Systems/Php-Newsletter-Script-L1237/

All I want to do is to send "a html mail" to all my members at 
http://www.stammis.com/ (swedish site for pedigrees). It would be a 
informative letter that tells them about latest news at Stammis Internet.


I could something like this...

while ($dbArray = mysql_fetch_array($querys)) {
...sendmail (from, to, htmltext...)...
}

but this will bring a timeout. Any suggestions? (I don't want to change the 
timeout - value, it doesn't seem correct)



/G
ps. OT: Planning of making this site Open Source, do you think it matters if 
the site is in swedish for the sake of Open Source? (the code is in 
english). 


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



Re: [PHP] Mailto members..?

2006-03-01 Thread Gustav Wiberg


- Original Message - 
From: "Kevin Davies - Bonhurst Consulting" <[EMAIL PROTECTED]>
To: "'Jim Moseby'" <[EMAIL PROTECTED]>; "'Gustav Wiberg'" 
<[EMAIL PROTECTED]>; "'PHP General'" 

Sent: Wednesday, March 01, 2006 4:32 PM
Subject: RE: [PHP] Mailto members..?




Others here have mentioned the use
of a mailer class I can't remember the name of (phpmailer maybe?).



PHPMailer is really good for sending HTML/Text/Both emails - I'm using it 
on

a few different sites.

Link: http://phpmailer.sourceforge.net/

Also, if you're going to use PHPMailer an excellent tutorial can be found
here: http://www.phpfreaks.com/tutorials/130/0.php

HTH

Cheers,

Kev

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


Hi there!

THANX! This was really what I was looking for! :-)

/G

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



Re: [PHP] About date & time...

2006-03-01 Thread Gustav Wiberg


- Original Message - 
From: "Marcus Gnaß" <[EMAIL PROTECTED]>

To: "Gustav Wiberg" <[EMAIL PROTECTED]>
Sent: Wednesday, March 01, 2006 5:24 PM
Subject: Re: [PHP] About date & time...



Gustav Wiberg schrieb:

function currenttime() {

 $t = date('h\:\ i\:\ s');
 $returnTime = str_replace(" ", "", $t);
 return $returnTime;

}

function currentdate() {

 $d = date('Y\-\ m\-\ d');
 $returnDate = str_replace(" ", "", $d);
 return $returnDate;

}

Although beeing a totally noob to PHP I suggest this instead:
function currenttime() {return date('H\:i\:s');}
function currentdate() {return date('Y\-m\-d');}

Marcus


Why?

return date('H\:i\:s') doesn't work as expected... :-)

/G

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



Re: [PHP] Mailto members..?

2006-03-01 Thread Gustav Wiberg
- Original Message - 
From: "Marcus Gnaß" <[EMAIL PROTECTED]>

To: "Gustav Wiberg" <[EMAIL PROTECTED]>
Sent: Wednesday, March 01, 2006 5:29 PM
Subject: Re: [PHP] Mailto members..?



Gustav Wiberg schrieb:

while ($dbArray = mysql_fetch_array($querys)) {
...sendmail (from, to, htmltext...)...
}
Why let PHP do all the work? If the body is all the same for all 
recipients you could send only one mail with all recipients in the 
BCC-field and only one dummy-adress in the To-field. This would lead to a 
very short execution-time.


Marcus


Yes, that's true! Is there any sideffects maybe...?

/G

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



Re: [PHP] Mailto members..?

2006-03-01 Thread Gustav Wiberg


- Original Message - 
From: "Jim Moseby" <[EMAIL PROTECTED]>
To: "'Gustav Wiberg'" <[EMAIL PROTECTED]>; "Marcus Gnaß" 
<[EMAIL PROTECTED]>

Cc: "PHP General" 
Sent: Wednesday, March 01, 2006 7:29 PM
Subject: RE: [PHP] Mailto members..?





> Gustav Wiberg schrieb:
>> while ($dbArray = mysql_fetch_array($querys)) {
>> ...sendmail (from, to, htmltext...)...
>> }
> Why let PHP do all the work? If the body is all the same for all
> recipients you could send only one mail with all recipients in the
> BCC-field and only one dummy-adress in the To-field. This
would lead to a
> very short execution-time.
>
> Marcus

Yes, that's true! Is there any sideffects maybe...?


This type of email may be more susceptible to being caught in spam traps.
Check with your webhost to learn of any limits to the number of recipients
per message, and number of messages per day/hour/etc.

JM


Aha.. that's a reason good enough for me for not using this method.

Thanx.

/G

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



[PHP] internal error when mailing...

2006-03-01 Thread Gustav Wiberg

Here's my code


if (strtoupper(substr(PHP_OS,0,3)=='WIN')): $eol="\r\n"; elseif 
(strtoupper(substr(PHP_OS,0,3)=='MAC')): $eol="\r"; else: $eol="\n"; endif;


//Message Subject
$emailsubject="Stammis Internet nyhetsbrev " . date("Y/m/d H:i:s");

//Message Body
ob_start();
 require("emailbody.php");// page for showing in the email (no html and 
body-tags here)

$body=ob_get_contents(); ob_end_clean();

// Common Headers
//

$headers .= 'From: Stammis Internet <[EMAIL PROTECTED]>'.$eol;
$headers .= 'Reply-To: Stammis Internet <[EMAIL PROTECTED]>'.$eol;
$headers .= 'Return-Path: Stammis Internet <[EMAIL PROTECTED]>'.$eol;// 
these two to set reply address
$headers .= "Message-ID: <".$now." 
TheSystem@".$_SERVER['SERVER_NAME'].">".$eol;
$headers .= "X-Mailer: PHP v".phpversion().$eol;  // These two to 
help avoid spam-filters

$headers .= 'MIME-Version: 1.0'.$eol;
$headers .= "Content-type: text/html; charset=iso-8859-1\n";

// HTML Version
//
$msg = $body.$eol.$eol;

// SEND THE EMAIL(s)
// FROM MYSQL-db
//

require("../phpfunctions/opendb.php");

$sql = "SELECT mail FROM tbusers ORDER BY mail";
$querys = mysql_query($sql);

while ($dbArray = mysql_fetch_array($querys)) {
$dbMail = $dbArray["mail"];

$emailaddress=$dbMail;

ini_set(sendmail_from,'[EMAIL PROTECTED]');  // the INI lines are to force 
the From Address to be used !

 mail($emailaddress, $emailsubject, $msg, $headers);
ini_restore(sendmail_from);

echo "SENT EMAIL TO $dbMail right now";
}

mysql_close();
?>

When I tested this script all mails I think was sent, BUT this error showed 
when the loop hade gone through all posts...



HTTP/1.1 200 OK Date: Wed, 01 Mar 2006 20:41:15 GMT Server: Apache 
X-Powered-By: PHP/4.4.1 Connection: close Transfer-Encoding: chunked 
Content-Type: text/html; charset=iso-8859-1

OK
The server encountered an internal error or misconfiguration and was unable 
to complete your request.
Please contact the server administrator, [EMAIL PROTECTED] and inform them 
of the time the error occurred, and anything you might have done that may 
have caused the error.


More information about this error may be available in the server error log.



What could have caused this?



/G

ps. YES http://phpmailer.sourceforge.net/ seems very great, but this code 
above is mostly for testing and experimenting...


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



Re: [PHP] Mailto members..?

2006-03-01 Thread Gustav Wiberg


- Original Message - 
From: "Jim Moseby" <[EMAIL PROTECTED]>
To: "'Gustav Wiberg'" <[EMAIL PROTECTED]>; "Jim Moseby" 
<[EMAIL PROTECTED]>

Cc: "PHP General" 
Sent: Wednesday, March 01, 2006 9:17 PM
Subject: RE: [PHP] Mailto members..?



> This type of email may be more susceptible to being caught
in spam traps.
> Check with your webhost to learn of any limits to the
number of recipients
> per message, and number of messages per day/hour/etc.
>
> JM

Aha.. that's a reason good enough for me for not using this method.


It would still be to your advantage to check with your hosting about 
limits.
I ran up against that on the last newsletter I coded where I could have 
only

25 recipients per message and 99 total messages per day.

JM


That's true!

Thanx again!

/G

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



Re: [PHP] internal error when mailing...

2006-03-01 Thread Gustav Wiberg
- Original Message - 
From: "John Nichel" <[EMAIL PROTECTED]>

To: "Gustav Wiberg" <[EMAIL PROTECTED]>
Sent: Wednesday, March 01, 2006 9:57 PM
Subject: Re: [PHP] internal error when mailing...



Gustav Wiberg wrote:

Here's my code


if (strtoupper(substr(PHP_OS,0,3)=='WIN')): $eol="\r\n"; elseif 
(strtoupper(substr(PHP_OS,0,3)=='MAC')): $eol="\r"; else: $eol="\n"; 
endif;


//Message Subject
$emailsubject="Stammis Internet nyhetsbrev " . date("Y/m/d H:i:s");

//Message Body
ob_start();
 require("emailbody.php");// page for showing in the email (no html 
and body-tags here)

$body=ob_get_contents(); ob_end_clean();

// Common Headers
//

$headers .= 'From: Stammis Internet <[EMAIL PROTECTED]>'.$eol;
$headers .= 'Reply-To: Stammis Internet <[EMAIL PROTECTED]>'.$eol;
$headers .= 'Return-Path: Stammis Internet <[EMAIL PROTECTED]>'.$eol; 
// these two to set reply address
$headers .= "Message-ID: <".$now." 
TheSystem@".$_SERVER['SERVER_NAME'].">".$eol;
$headers .= "X-Mailer: PHP v".phpversion().$eol;  // These two to 
help avoid spam-filters

$headers .= 'MIME-Version: 1.0'.$eol;
$headers .= "Content-type: text/html; charset=iso-8859-1\n";

// HTML Version
//
$msg = $body.$eol.$eol;

// SEND THE EMAIL(s)
// FROM MYSQL-db
//

require("../phpfunctions/opendb.php");

$sql = "SELECT mail FROM tbusers ORDER BY mail";
$querys = mysql_query($sql);

while ($dbArray = mysql_fetch_array($querys)) {
$dbMail = $dbArray["mail"];

$emailaddress=$dbMail;

ini_set(sendmail_from,'[EMAIL PROTECTED]');  // the INI lines are to force 
the From Address to be used !

 mail($emailaddress, $emailsubject, $msg, $headers);
ini_restore(sendmail_from);

echo "SENT EMAIL TO $dbMail right now";
}

mysql_close();
?>

When I tested this script all mails I think was sent, BUT this error 
showed when the loop hade gone through all posts...



HTTP/1.1 200 OK Date: Wed, 01 Mar 2006 20:41:15 GMT Server: Apache 
X-Powered-By: PHP/4.4.1 Connection: close Transfer-Encoding: chunked 
Content-Type: text/html; charset=iso-8859-1

OK
The server encountered an internal error or misconfiguration and was 
unable to complete your request.
Please contact the server administrator, [EMAIL PROTECTED] and inform 
them of the time the error occurred, and anything you might have done 
that may have caused the error.


More information about this error may be available in the server error 
log.




What could have caused this?


Gremlins?  ;)

Misconfigured mail server.

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]


Ok, but the code is okay right?

/G

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



[PHP] Only 4 of 5...

2006-03-02 Thread Gustav Wiberg

Hi there!

What's wrong here??

0) {

?>
Visa telefonbilder för :
0) {

   $dbNameManufacturer = $dbArray["nameManufacturer"];

 ?>
 Visa telefonbilder för :
 
Alla telefonbilder i arkivet:

 height="130">

 

I have 5 posts in the table, but the images shown are only four! Why?

/G

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



Re: [PHP] Only 4 of 5...

2006-03-02 Thread Gustav Wiberg


- Original Message - 
From: <[EMAIL PROTECTED]>

To: <[EMAIL PROTECTED]>; 
Sent: Thursday, March 02, 2006 11:05 PM
Subject: RE: [PHP] Only 4 of 5...


[snip]
I have 5 posts in the table, but the images shown are only four! Why?
[/snip]

Are you counting starting with 1 or 0?

Don't understand your question... I have 5 posts in the table, but I'll only 
retrieve 4 posts when going through the array... like this...


while ($dbArray = mysql_fetch_array($querys)) {
 $dbIDPic = $dbArray["IDPic"];
 $dbPicNameSmall = $dbArray["picNameSmall"];
 ?>
 
 . 


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



Re: [PHP] Only 4 of 5...

2006-03-02 Thread Gustav Wiberg


- Original Message - 
From: <[EMAIL PROTECTED]>

To: <[EMAIL PROTECTED]>; 
Sent: Thursday, March 02, 2006 11:15 PM
Subject: RE: [PHP] Only 4 of 5...


[snip]
while ($dbArray = mysql_fetch_array($querys)) {
 $dbIDPic = $dbArray["IDPic"];
 $dbPicNameSmall = $dbArray["picNameSmall"];
 ?>
 
 http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

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



Re: [PHP] Only 4 of 5...

2006-03-02 Thread Gustav Wiberg


- Original Message - 
From: "Thorsten Suckow-Homberg" <[EMAIL PROTECTED]>
To: "Gustav Wiberg" <[EMAIL PROTECTED]>; "PHP General" 


Sent: Thursday, March 02, 2006 11:13 PM
Subject: Re: [PHP] Only 4 of 5...



Because of this:


$dbArray = mysql_fetch_array($querys);


This will fill $dbArray with the first row fetched from the table. 4 are 
left which you are calling in your loop at the end of your code example. 
What's your reason anyway to call mysql_fetch_array() here?

Delete this line and I'd bet you're getting your 5 results ;)

HTH

Thorsten


Aha, this seems reasonable! Thanx, this solved it!

/G

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



Re: [PHP] Only 4 of 5...

2006-03-03 Thread Gustav Wiberg
- Original Message - 
From: "John Nichel" <[EMAIL PROTECTED]>

To: "PHP General" 
Sent: Friday, March 03, 2006 2:30 AM
Subject: Re: [PHP] Only 4 of 5...



Gustav Wiberg wrote:

Hi there!

What's wrong here??



You're pulling the first row here


if (intval($frmIDModel)>0) {

?>
Visa telefonbilder för :
0) {

   $dbNameManufacturer = $dbArray["nameManufacturer"];

 ?>
 Visa telefonbilder för :
 
Alla telefonbilder i arkivet:


So now there are only 4 rows left when you loop thru them here.


   while ($dbArray = mysql_fetch_array($querys)) {
 $dbIDPic = $dbArray["IDPic"];
 $dbPicNameSmall = $dbArray["picNameSmall"];
 ?>
 height="130">

 

I have 5 posts in the table, but the images shown are only four! Why?

/G




--
By-Tor.com
...it's all about the Rush
http://www.by-tor.com

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


Thanx, I got feedback on this one yesterday! :) Thanx anyway!

/G

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



Re: [PHP] Re: DOMElement::setAttribute() manual example question

2006-03-03 Thread Gustav Wiberg
- Original Message - 
From: "Rob" <[EMAIL PROTECTED]>

To: "Andreas Korthaus" <[EMAIL PROTECTED]>
Cc: 
Sent: Friday, March 03, 2006 4:43 PM
Subject: [PHP] Re: DOMElement::setAttribute() manual example question



Andreas Korthaus wrote:

Hi!

I've a question regarding the example in DOMElement::setAttribute() 
chapter of the PHP manual: http://de3.php.net/dom-domelement-setattribute


There, an attribute is added to an element this way:

createElement("root");
$newnode = $doc->appendChild($node);
$newnode->setAttribute("align", "left");
echo $doc->saveXML();
?>

$doc->createElement() returns the created DOMElement, $doc->appendChild() 
returns the appended DOMNode. Isn't this the same object? Is it a 
reference?


Check out:
http://de3.php.net/manual/en/function.dom-domdocument-createelement.php
( This function creates a new instance of class DOMElement. This node will 
not show up in the document unless it is inserted with e.g. 
DOMNode->appendChild().)


I really don't understand WHY your next example is working...

/G








I'm asking, because the following works too:

createElement("root");
$node->setAttribute("align", "left");
$doc->appendChild($node);
echo $doc->saveXML();
?>


I like the 2nd example more, because first you create an object 
(DOMElement), add some attributes to the object and after that append it 
somewhere to the DOM tree. The 1st example creates a new DOMElement 
object, appends it to the DOM tree, and adds the attributes not to the 
created object, but to another object (the DOMNode appended to the tree), 
which seems to be a reference to the original object.


Why does the manual prefer the (IMO less intuitive) 1st way? Is there a 
problem with the 2nd way?


Both ways are perfectly valid. $node and $newnode refer to the same 
object. It was written the 1st way to demonstrate the return value of 
appendChild(), because in many cases people create the element 
differently.


i.e.

$newnode = $doc->appendChild($doc->createElement("root"));
or
$newnode = $doc->appendChild(new DOMElement("root"));

Also, in the event $node is created using the new DOMElement syntax:

$node = new DOMElement("root");

the node is read only and must be appended into the tree before it can be 
modified, so the example just tries to be neutral here regarding the 
syntax used.


Rob

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



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



Re: [PHP] Coding Practice: Use global $var or pass in by refernce

2006-03-03 Thread Gustav Wiberg
- Original Message - 
From: "Mark Steudel" <[EMAIL PROTECTED]>

To: 
Sent: Friday, March 03, 2006 7:46 PM
Subject: [PHP] Coding Practice: Use global $var or pass in by refernce



I was wondering what the general rule on using the global driective versus
passing in a variable by reference, why you should or shouldn't, etc.

e.g.

function ()
{
   global $db;

   $res =& $db->query( "SQL");
}

or

function ( &$db )
{

   $res =& $db->query( "SQL");
}

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


Hi!

My oponion is that is insane to use global variables. The main drawback with 
global variables is that is very easy to mix up variables, and keep track of 
what variable belongs to what. So an advice: Don't use it!


/G

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



Re: [PHP] Re: DOMElement::setAttribute() manual example question

2006-03-03 Thread Gustav Wiberg


- Original Message - 
From: "Rob" <[EMAIL PROTECTED]>

To: "Gustav Wiberg" <[EMAIL PROTECTED]>
Cc: "Andreas Korthaus" <[EMAIL PROTECTED]>; 
Sent: Friday, March 03, 2006 8:04 PM
Subject: Re: [PHP] Re: DOMElement::setAttribute() manual example question



Gustav Wiberg wrote:


Check out:
http://de3.php.net/manual/en/function.dom-domdocument-createelement.php
( This function creates a new instance of class DOMElement. This node 
will not show up in the document unless it is inserted with e.g. 
DOMNode->appendChild().)


I really don't understand WHY your next example is working...


Every example so far has called appendChild(). The only difference has 
been when at which point it is called to append the element and how the 
element to append has been created.


Rob

Maybe it is so that the objects propertys is created in a certain order 
undependet of the script order?


/G

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



Re: [PHP] Coding Practice: Use global $var or pass in by refernce

2006-03-03 Thread Gustav Wiberg


- Original Message - 
From: "Andreas Korthaus" <[EMAIL PROTECTED]>

To: ; "Gustav Wiberg" <[EMAIL PROTECTED]>
Sent: Friday, March 03, 2006 8:53 PM
Subject: Re: [PHP] Coding Practice: Use global $var or pass in by refernce



Hi Gustav!

Gustav Wiberg wrote:

My oponion is that is insane to use global variables. The main drawback 
with global variables is that is very easy to mix up variables, and keep 
track of what variable belongs to what. So an advice: Don't use it!


Ok, so what's your recommendation to solve the problem with using a DB 
class in many other objects/methodes? Think of a DB class:


class DB {...}

And a lot of classes which want to use the DB class:

class Foo {
  function saveChangesInDb() {...}
}

class Bar {
  function saveChangesInDb() {...}
}

- You can use a global "$db = new DB..." and pass it to every 
class/methode,


- you can make $db "global" in each methode,

- you can create a new instance ("new DB") in every methode (but you 
usually only want a single DB-connection per script, and where do you pass 
config-data to access the DB?) or


- use a factory/singleton, which is not so much better than a global 
variable (and again, what about config-data?).



So what's the way you'd recommend and why?


best regards
Andreas

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


Hi Andreas!

I don't have that much experience with classes, but wouldn't it work to:

1. make a connection to the db like $db = , and then pass around 
this variable?


2. Extend the DB - class, so the saveChangesInDb()  - function in the 
Foo-class would be an extension from the DB-class

? (I think this works to extend a class in PHP right?)

3 . Use already existing classes for db...http://www.phpclasses.org/ PHP 
Scripts / Databases


I hope this'll help!

/G

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



[PHP] Swedish sourgeforge for php-prg

2006-03-03 Thread Gustav Wiberg

Hi there!

I wonder as a swedish PHP-programmer if there are any sites like 
sourgeforge.net but in swedish?


/G

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



Re: [PHP] Mysql Rows

2006-03-04 Thread Gustav Wiberg


- Original Message - 
From: "tedd" <[EMAIL PROTECTED]>

To: 
Cc: "benifactor" <[EMAIL PROTECTED]>; "Murray @ PlanetThoughtful" 
<[EMAIL PROTECTED]>; "Anthony Ettinger" <[EMAIL PROTECTED]>

Sent: Saturday, March 04, 2006 3:14 PM
Subject: Re: [PHP] Mysql Rows



planetthoughtful  wrote:

But, too often I've seen people new to database design not liking 'gaps' 
because 'user1' will have a unique id of '1', while 'user2' will have a 
unique id of '6' because the records associated with unique ids '2' 
through '5' were deleted during testing, and so on. So, they feel that 
'user2' should have a unique id of '2', ignoring the fact that that's not 
a unique id at all, if you had id '2' associated with another record at 
some point.


And, Anthony wrote:


I remember the days where i'd
clear a database after testing to keep the auto_increment inline, but
eventually, you will get out of sync on that, so it's not a reliable way 
of

keeping a numerical sequence.


Well... I'm one of those people who don't like gaps. I understand that if 
the dB is relational, then you shouldn't be concerned about gaps. Gaps are 
only perceived from a perspective of an artificial ordering system -- who 
knows where the data actually is in memory or on disk.


However, when I'm working with a flat dB and want to step through the 
records to do editing, I like the records to be in order based upon an 
"id" (i.e., Record 1, Record 2, Record 3, and so on). I use an 
auto_increment unique "id"  for this.


It's not a big problem for me to keep the records in order either. 
Whenever I delete a record, I simply follow with:


$dbQuery = "ALTER TABLE $dbtable ";
$dbQuery .= "DROP id, ";
$dbQuery .= "ADD id INT UNSIGNED NOT NULL AUTO_INCREMENT,";
$dbQuery .= "AUTO_INCREMENT = 1";
$result = mysql_query($dbQuery) or die("2. Could not renumber dB $dbQuery" 
. mysql_error());


and my dB is in order and all things are right with the world again. I'm 
simple-minded that way.


Now, I'm not allowing more one than one person (namely me) the ability to 
delete and reorder things, so I don't think there are any problems. Of 
course I could lock down the tables, delete, and then do the reorder if 
the dB is online -- but I haven't encountered any problems thus far.


I've read numerous dB books about why it isn't necessary to reorder and 
everyone deplores the action, which is only done by newbies. But I don't 
really understand, with a flat dB, as to why it's a bad idea to do this?


Now, is there a problem with the way I'm doing this? If so, *please* 
enlighten me. Please tell me why this isn't a reliable way of keeping a 
numerical sequence AND what technique would be?


Many thanks.

tedd
--

http://sperling.com

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



Hi Tedd!

Generally speaking about db's it's not a good pratice to do in that you 
describe, but as I understand you've already figured that out...


But one thing not doing "your" way is lack of performance:

I'll quote you:

"not a big problem for me to keep the records in order either.

Whenever I delete a record, I simply follow with:

$dbQuery = "ALTER TABLE $dbtable ";
$dbQuery .= "DROP id, ";
$dbQuery .= "ADD id INT UNSIGNED NOT NULL AUTO_INCREMENT,";
$dbQuery .= "AUTO_INCREMENT = 1";
$result = mysql_query($dbQuery) or die("2. Could not renumber dB $dbQuery" 
. mysql_error());"


No, maybe not when it's a small db, but when you try to delete 50.000 posts 
I have a strong feeling this would be very much slower then if you don't 
alter table after each deletion.


/G

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



Re: [PHP] Mysql Rows

2006-03-05 Thread Gustav Wiberg
- Original Message - 
From: "tedd" <[EMAIL PROTECTED]>

To: 
Cc: "Gustav Wiberg" <[EMAIL PROTECTED]>; "Robert Cummings" 
<[EMAIL PROTECTED]>

Sent: Sunday, March 05, 2006 12:58 AM
Subject: Re: [PHP] Mysql Rows



Hi:

Gustav said:

No, maybe not when it's a small db, but when you try to delete 50.000 
posts I have a strong feeling this would be very much slower then if you 
don't alter table after each deletion.


First, I'm not deleting 50,000 records -- I dropping a table and 
renumbering it.


In any event, I just tested your claim on my host and I was able to 
renumber 50,000 records in less than 1/2 second. Even though I tried it 
several times, the results were never above 0.47 seconds. If I was dealing 
with a database that was accessible to others, then I would either lock 
tables or use transaction and then renumber -- but in either case the 
difference in time is less than additional 1/10 of a second.
Ok, it wasn't really a claim, it was more a "feeling", but I couldn't say it 
for sure, so I applogize for misleading you there! :-)


Half a second or 0.47 seconds may not be a big issue, but as I see it this 
could be "unessescary time", if you could achieve the same
functionality (without doing some alter-statements) faster and without have 
to lock the db. Have you tested without the alter-table statement? *just 
curious*


Aha... I missed the part ...
"I was dealing with a database that was accessible to others"
Only YOU are using the db? Ok, then it would not be a problem.







I don't know if 1/2 second is a big deal in your world, or not, but it 
seems a bit slow to me. I wrote splay binary tree search routine that 
would perform 100,000 searches in a two million record dB in less than one 
second on my Mac. And if you know what a splay algorithm is, then you also 
know that it not only preforms a search but then reorders the tree each 
time a search is successful and thus is very laborious. Yet the time it 
took to preform 100,000 searches and reorders was still less than one 
second.


Perhaps my host is running something slower -- after all, I'm only paying 
$7.00 per year for the service. But with all things considered, a half 
second is not that significant with a small 50,000 record dB. That's 
probably less than the majority of web sites that use MySQL, don't you 
think?


Ok, I got your point! :-) But there is another side to it , and that is 
scalability. Ok, you don't have so many posts in your database.

Ok, it does take less then a second...

What if you had do make the db visible to other users? Then this link that 
might intrest you: (it's about pitfalls with transactions as may see in the 
link)

http://www.onlamp.com/pub/a/php/2003/12/18/transaction_pitfalls.htmlhttp://www.onlamp.com/pub/a/php/2003/12/18/transaction_pitfalls.html

But what If you suddenly hade to change host for some reason... The new host 
server maybe wouldn't be as fast as yours is today.
And as someone mentioned, what about if your db was growing to include a 
couple of million posts.


Of course, if you don't think your db will grow so much, and it works fine, 
then of course you could contiuning doing the ALTER-statement thing, but 
there's always two sides of the story... ;-)


"That's probably less than the majority of web sites that  use MySQL, don't 
you think?"

I really have no clue, I could only guess... :-)



Rod said:


*LOL* I knew those MySQL people shouldn't have made the ALTER TABLE
syntax available to just anyone. Gun --> foot --> *BLAM*. I hope to God
you never get your hands on a real database with millions of entries.


I'm glad that you were amused. Considering that I was talking about a flat 
dB, then you have already shot yourself in the foot if your "real 
database" is in the millions of entries and is flat. I hope to God that 
normalization may be something you consider in your next database design.


In any event, it's interesting that I posted a question here and I 
expected some ribbing, but I also expected something of value.


If the ALTER TABLE statement is prone to error, then I would like to know 
that and why. However, I suspect that claim isn't true, it's just that 
it's misuse has generated an urban myth of "Don't do that! That's 
dangerous!" without any real substance other than for programer error.
*LOL* I have to say, that I agree with you on this one. I've searched on 
issues/regarding ALTER TABLE, and could only find errors regarding this when

Microsoft was involved ;-)

Of course, I've run into windozes programmers who
accept the occasional crash and burn as "it comes with the territory", but 
that's unfortunate to apply this "apprehension" to MySQL.

:-)



In my previous post I plea

[PHP] What am I missing?

2006-03-07 Thread Gustav Wiberg

Hi there!

Why...

I have this code:

Add manufacturer:
action="admin/phpfunctions/addnewmanufacturer.php?frmManufacturer=$frmIDManufacturer;?>&frmModel=" method="post">





When i press the submit - button, I get this error:

Not Found
The requested URL 
/mobilkamera/admin/admin/phpfunctions/addnewmanufacturer.php was not found 
on this server.


Apache/2.0.53 (Win32) Server at 192.168.0.3 Port 80

Why is there TWO admins? Why isn't the path like this...?
The requested URL /mobilkamera/admin/phpfunctions/addnewmanufacturer.php was 
not found on this server.


???

If this is not a question that suits the list, please guide me tips where to 
look...


Best regards
/Gustav Wiberg

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



Re: [PHP] What am I missing?

2006-03-07 Thread Gustav Wiberg


- Original Message - 
From: "Shaunak Kashyap" <[EMAIL PROTECTED]>
To: "Gustav Wiberg" <[EMAIL PROTECTED]>; "PHP General" 


Sent: Tuesday, March 07, 2006 8:05 PM
Subject: RE: [PHP] What am I missing?


It is more of an HTML/HTTP question than PHP but here's my shot at a
possible explanation:

The file containing the form code seems to live in the
/mobilkamera/admin/ directory. Therefore action="admin/phpfunctions..."
implies that the form is to be submitted to that path starting from the
current directory (i.e. /mobilkamera/admin/), which resolves to
/mobilkamera/admin/admin/phpfunctions...

One solution would be remove the "admin/" from the action. Another (and
probably better solution) would be to use absolute paths, as Joe Henry
suggests.

Shaunak Kashyap

Senior Web Developer
WPT Enterprises, Inc.
5700 Wilshire Blvd., Suite 350
Los Angeles, CA 90036

Direct: 323.330.9870
Main: 323.330.9900

www.worldpokertour.com

Confidentiality Notice:  This e-mail transmission (and/or the
attachments accompanying) it may contain confidential information
belonging to the sender which is protected.  The information is intended
only for the use of the intended recipient.  If you are not the intended
recipient, you are hereby notified that any disclosure, copying,
distribution or taking of any action in reliance on the contents of this
information is prohibited. If you have received this transmission in
error, please notify the sender by reply e-mail and destroy all copies
of this transmission.



-Original Message-
From: Gustav Wiberg [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 07, 2006 10:45 AM
To: PHP General
Subject: [PHP] What am I missing?

Hi there!

Why...

I have this code:

Add manufacturer:

action="admin/phpfunctions/addnewmanufacturer.php?frmManufacturer=
echo
$frmIDManufacturer;?>&frmModel="

method="post">





When i press the submit - button, I get this error:

Not Found
The requested URL
/mobilkamera/admin/admin/phpfunctions/addnewmanufacturer.php was not

found

on this server.

Apache/2.0.53 (Win32) Server at 192.168.0.3 Port 80

Why is there TWO admins? Why isn't the path like this...?
The requested URL

/mobilkamera/admin/phpfunctions/addnewmanufacturer.php

was
not found on this server.

???

If this is not a question that suits the list, please guide me tips

where

to
look...

Best regards
/Gustav Wiberg

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


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

Thanx!!!

/Gustav Wiberg

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



Re: [PHP] making a tutorial

2006-03-16 Thread Gustav Wiberg


- Original Message - 
From: "John Taylor-Johnston" <[EMAIL PROTECTED]>

To: "PHP-General" 
Sent: Friday, March 17, 2006 7:51 AM
Subject: [PHP] making a tutorial



I'm making a tutorial and don't really understand how to do this myself :)

Which of the following pets do have at home:
dog
cat
snake
snake
none of these


How do I parse favourite[]? I might have 2 or 5, so I need to parse ^0]
- nMax. It is a checkbox.

I might use favourite[] with mail() or store it in a mysql field.

If mysql, would I store it in a varchar(20) or an enum() and how?

John



Hi there!

Do you have to name it as favourite[]? Can't you name it as "just" favourite 
(without brackets)
If you name it as just favourite, at least in Javascript you could loop 
through favourite as an array. I don't know if this works in PHP as well.


Best regards
/Gustav Wiberg

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



[PHP] Div-element at same vert. position?

2006-03-28 Thread Gustav Wiberg

Hi guys!

I have a code-snippet here:

while ($dbArray = mysql_fetch_array($querys)) {
$dbIDLevel1 = $dbArray["IDLevel1"];
$dbLevel1Name = $dbArray["level1Name"];
$dbFactsLevel1Name = $dbArray["factsLevel1Name"];
$dbFactsPictureLevel1Name = $dbArray["factsPictureLevel1Name"];
?>



align="top" width="200" height="150">







   $sql2 = "SELECT tblevel2catlevel1cat.ForIDLevel1Cat, 
tblevel2catlevel1cat.ForIDLevel2Cat, tblevel2cat.IDLevel2, 
tblevel2cat.level2Name FROM tblevel2catlevel1cat";
   $sql2 .= " LEFT JOIN tblevel2cat ON (tblevel2cat.IDLevel2 = 
tblevel2catlevel1cat.ForIDLevel2Cat)";
   $sql2 .= " WHERE tblevel2catlevel1cat.ForIDLevel1Cat = " . 
safeQuote($dbIDLevel1);

   $querys2 = mysql_query($sql2);

   $nrRows++;
   while ($dbArray2 = mysql_fetch_array($querys2)) {
   $dbIDLevel2 = $dbArray2["IDLevel2"];
   $dbLevel2Name = $dbArray2["level2Name"];
   ?>
   title="">$dbLevel2Name;?>

   
   
   
You'll see that two div-elements are created. I want "rightmenu_$dbIDLevel1;?>" to be at the same vertical level as div-element: 
"factsmenu_"


Any ideas? (I tried with $yMenu +=(8*intval($nrRows)) with the rule that any 
row is 8 pixels, but this doesn't seem to be true)


/G

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



Re: [PHP] Div-element at same vert. position?

2006-03-28 Thread Gustav Wiberg


- Original Message - 
From: "Jay Blanchard" <[EMAIL PROTECTED]>
To: "Gustav Wiberg" <[EMAIL PROTECTED]>; "PHP General" 


Sent: Tuesday, March 28, 2006 10:00 PM
Subject: RE: [PHP] Div-element at same vert. position?


[snip]
I have a code-snippet here:

while ($dbArray = mysql_fetch_array($querys)) {
$dbIDLevel1 = $dbArray["IDLevel1"];
$dbLevel1Name = $dbArray["level1Name"];
$dbFactsLevel1Name = $dbArray["factsLevel1Name"];
$dbFactsPictureLevel1Name = $dbArray["factsPictureLevel1Name"];
?>









   
   
   
   
" to be at the same vertical level as div-element:
"factsmenu_"

Any ideas? (I tried with $yMenu +=(8*intval($nrRows)) with the rule that
any
row is 8 pixels, but this doesn't seem to be true)
[/snip]

A. The is a CSS question
2. You didn't provide a way to see it.
III. Using absolute positioning is a bad thing and the left div should
be floated to the left.

Ok, I got your message you all! But I really wanted to do the postitioning 
in PHP with absolute positioning (just for the sakes cause ;-))


/G

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



Re: [PHP] Div-element at same vert. position?

2006-03-28 Thread Gustav Wiberg


- Original Message - 
From: "Jay Blanchard" <[EMAIL PROTECTED]>
To: "Gustav Wiberg" <[EMAIL PROTECTED]>; "PHP General" 


Sent: Tuesday, March 28, 2006 11:52 PM
Subject: RE: [PHP] Div-element at same vert. position?


[snip]
A. The is a CSS question
2. You didn't provide a way to see it.
III. Using absolute positioning is a bad thing and the left div should
be floated to the left.

Ok, I got your message you all! But I really wanted to do the
postitioning
in PHP with absolute positioning (just for the sakes cause ;-))
[/snip]

While you may be using PHP to output attributes for CSS you are not
doing positioning with CSS.

And your point is?

/Gustav Wiberg

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



[PHP] ID-tags from picture?

2006-04-03 Thread Gustav Wiberg

Hi guys!

If I've got this right, there will be some kind of tag that is saved in a 
picture (hidden). Is it possible to retrieve this information from PHP and 
what it is called? Any ideas / suggestions would be approciated!


/Gustav Wiberg 


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



Re: [PHP] ID-tags from picture?

2006-04-04 Thread Gustav Wiberg
- Original Message - 
From: "Chris" <[EMAIL PROTECTED]>

To: "Gustav Wiberg" <[EMAIL PROTECTED]>
Cc: "PHP General" 
Sent: Tuesday, April 04, 2006 4:14 AM
Subject: Re: [PHP] ID-tags from picture?



Gustav Wiberg wrote:

Hi guys!

If I've got this right, there will be some kind of tag that is saved in a 
picture (hidden). Is it possible to retrieve this information from PHP 
and what it is called? Any ideas / suggestions would be approciated!


Depends on what information you are after.

Some images may have exif info, but not all.

http://www.php.net/exif

Possibly IPTC information too (but only applies to jpegs apparently):

http://www.php.net/iptcparse

--
Postgresql & php tutorials
http://www.designmagick.com/


Hi!

And thanx a lot! Exactly what I was looking for!

Best regards
/Gustav Wiberg 


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



[PHP] Convert from jpg to gif ... change dpi...

2006-05-07 Thread Gustav Wiberg

Hi there!

Is there any way of converting a jpg to gif and change dpi on the fly?

Best regards
Gustav Wiberg

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



[PHP] Copy of image -> smaller

2006-05-15 Thread Gustav Wiberg

Hi there!

When I upload a picture from a form, then I want to create a copy with a 
smaller image.
For example: I upload a picture with dimensions 200x150 name 4.jpg. I also 
want a copy of this image but with the dimensions 100x75 pixels. I've tried 
this below, but I'm missing something I think... :-)


I'm using PHP 4.x  (don't know exactly the vers.nr, but I can search for it 
if it is of importance)


The code down below is a function for uploading a picture. The part I want 
help with is after the comment: //What should/could I do here?


Best regards
Gustav Wiberg



0)
  {
  //ECHO "yes! ID=$idUpload PIC=$picUpload ADD=$addUpload";
  $uploaddir = dirname($_FILES[$picUpload]['tmp_name']) . "/";

  //Replace .jpeg to .jpg
  //
  $_FILES[$picUpload]['name'] = 
str_replace(".jpeg",".jpg",$_FILES[$picUpload]['name']);


  //Get first 4 last characters of uploaded filename
  //
  $ble = strtolower(substr($_FILES[$picUpload]['name'], -4, 4));

  //Move to path $toPath (followed by what to add after file (that is sent 
to this function)) and ext.)

  //
  $mfileAdd = $idUpload . $addUpload . $ble;

  move_uploaded_file($_FILES[$picUpload]['tmp_name'], $toPath . $mfileAdd);


  //echo "mfileAdd=$mfileAdd";
  //Set appropiate rights for file
  //
  //echo "FILE TO TEST=$mfileAdd";
  chmod($toPath . $mfileAdd, intval('0755', 8));


  //Copy this file to another file?
  //
  if (strlen($copyFile)>0) {
  $mfile = $idUpload . $copyFile . $ble;
  //echo "MFILE=$mfile";
  copy($toPath . $mfileAdd, $toPath . $mfile);
  chmod($toPath . $mfile, intval('0755', 8));
  }


//What should/could I do here?
//

   //Set new width and height
   //
  $new_width = 100;
  $new_height = 200;
  $tmp_image=imagecreatefromjpeg($toPath . $mfileAdd);
  $width = imagesx($tmp_image);
  $height = imagesy($tmp_image);
  $new_image = imagecreatetruecolor($new_width,$new_height);
   ImageCopyResized($new_image, $tmp_image,0,0,0,0, $new_width, 
$new_height, $width, $height);


   //Grab new image
   ob_start();
   ImageJPEG($new_image);
   $image_buffer = ob_get_contents();
   ob_end_clean();
   ImageDestroy($new_image);

   //Create temporary file and write to it
   $fp = tmpfile();
   fwrite($fp, $image_buffer);
   rewind($fp);

   //Upload new image
   $copyTo = 'http://www.ledins.se/test.jpg';
   $conn_id = ftp_connect('');
   ftp_login($conn_id,'','');
   ftp_fput($conn_id, $copyTo, $fp, FTP_BINARY);
   fclose($fp);



  //Return the filename created based on productID
  //
  return $mfileAdd;
  }



}


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



Re: [PHP] Copy of image -> smaller

2006-05-15 Thread Gustav Wiberg

Hi there!

If I understand this right, I must have adminstration rights for installing 
Magic Wand...
The problem is that my host doesn't have any support for this application. 
(It's not MY server)


Is there any workaround?

Best regards
/Gustav Wiberg

- Original Message - 
From: "Sascha Braun" <[EMAIL PROTECTED]>

To: "Gustav Wiberg" <[EMAIL PROTECTED]>
Sent: Monday, May 15, 2006 9:18 AM
Subject: Re: [PHP] Copy of image -> smaller


I dont have the code you  need handy at the moment, but please take a look 
at

imagemagick.org and the

convert -size 120x80 in.jpg -resize 120x80 out.jpg

command.

First you have to use gd getimagesize command to find out
the width and height of the uploaded image, to find out if
the image has a higher width or height value.

The scale it down by the factor needed.

200 / 120 * factor i guess.

Don't forget the path in the convert command otherwise
you are going to delete the original image.

Normaly i do a copy(/tmp/file, /to/destination/path);

unlink(/tmp(file);

convert original source path to thumbnail destination path

and so forth.

When you get handy with ffmpeg you can do the same stuff
with movies. Lame helps you to do the same with audio files.

Have fun!

Sascha Braun
___
SMS schreiben mit WEB.DE FreeMail - einfach, schnell und
kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192



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



[PHP] Check before uploading

2006-05-15 Thread Gustav Wiberg

Hi there!

Just a thought. Someone posted a question if you could check filesize before 
uploading some days ago. Maybe this is possible with Javascript?
Javascript wouldn't be the best solution, cause of it's incompability 
between browsers, that users can inactivate it. But it's might be better 
than nothing.. The important thing is not to RELY on the Javascript-code.


Best regards
/Gustav Wiberg 


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



Re: [PHP] Copy of image -> smaller

2006-05-15 Thread Gustav Wiberg


- Original Message - 
From: "Chris" <[EMAIL PROTECTED]>

To: "Gustav Wiberg" <[EMAIL PROTECTED]>
Cc: "PHP General" 
Sent: Monday, May 15, 2006 9:42 AM
Subject: Re: [PHP] Copy of image -> smaller



Gustav Wiberg wrote:

Hi there!

When I upload a picture from a form, then I want to create a copy with a 
smaller image.
For example: I upload a picture with dimensions 200x150 name 4.jpg. I 
also want a copy of this image but with the dimensions 100x75 pixels. 
I've tried this below, but I'm missing something I think... :-)


I'm using PHP 4.x  (don't know exactly the vers.nr, but I can search for 
it if it is of importance)


First of all *run* to this thread and add some security checks to your 
image uploading:


http://marc.theaimsgroup.com/?l=php-general&m=114755779206436&w=2

Secondly, what does or doesn't happen with your code?

It looks fine at first glance but do you get an error? What do you expect 
it to do and what does it actually do?


--
Postgresql & php tutorials
http://www.designmagick.com/

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


Hi there!

Thanx for tip about security!

There is no errors displayed, but the file test.jpg isn't created. It isn't 
accessible when accessing http://www.ledins.se/test.jpg


Best regards
/Gustav Wiberg

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



Re: [PHP] Check before uploading

2006-05-15 Thread Gustav Wiberg


- Original Message - 
From: "Stut" <[EMAIL PROTECTED]>

To: "Gustav Wiberg" <[EMAIL PROTECTED]>
Cc: "PHP General" 
Sent: Monday, May 15, 2006 12:50 PM
Subject: Re: [PHP] Check before uploading



Gustav Wiberg wrote:

Just a thought. Someone posted a question if you could check filesize 
before uploading some days ago. Maybe this is possible with Javascript?
Javascript wouldn't be the best solution, cause of it's incompability 
between browsers, that users can inactivate it. But it's might be 
better than nothing.. The important thing is not to RELY on the 
Javascript-code.



This was suggested at the time, but for what should be obvious reasons 
it's not possible due to security restrictions.


-Stut


Hi there!

Ok, do you have a solution the problem now?

Best regards
/Gustav Wiberg

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



Re: [PHP] Copy of image -> smaller

2006-05-15 Thread Gustav Wiberg


- Original Message - 
From: "Rabin Vincent" <[EMAIL PROTECTED]>

To: "Gustav Wiberg" <[EMAIL PROTECTED]>
Cc: "PHP General" 
Sent: Monday, May 15, 2006 1:35 PM
Subject: Re: [PHP] Copy of image -> smaller


On 5/15/06, Gustav Wiberg <[EMAIL PROTECTED]> wrote:
[snip]

//What should/could I do here?
//

//Set new width and height
//
   $new_width = 100;
   $new_height = 200;
   $tmp_image=imagecreatefromjpeg($toPath . $mfileAdd);
   $width = imagesx($tmp_image);
   $height = imagesy($tmp_image);
   $new_image = imagecreatetruecolor($new_width,$new_height);
ImageCopyResized($new_image, $tmp_image,0,0,0,0, $new_width,
$new_height, $width, $height);


I can't see anything wrong with this resizing.


//Grab new image
ob_start();
ImageJPEG($new_image);
$image_buffer = ob_get_contents();
ob_end_clean();
ImageDestroy($new_image);
//Create temporary file and write to it
$fp = tmpfile();
fwrite($fp, $image_buffer);
rewind($fp);


Instead of doing this, you may want to use the filename
argument of ImageJPEG to save the image directly to a file.


//Upload new image
$copyTo = 'http://www.ledins.se/test.jpg';
$conn_id = ftp_connect('');
ftp_login($conn_id,'','');
ftp_fput($conn_id, $copyTo, $fp, FTP_BINARY);


Destination file ($copyTo) is supposed to be a path (eg.
public_html/test.jpg) and not a URL.

Ok! Thanx, that might be the problem! :-)

Best regards
/Gustav Wiberg

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



Re: [PHP] Check before uploading

2006-05-15 Thread Gustav Wiberg


- Original Message - 
From: "Stut" <[EMAIL PROTECTED]>

To: "Gustav Wiberg" <[EMAIL PROTECTED]>
Cc: "PHP General" 
Sent: Monday, May 15, 2006 10:32 PM
Subject: Re: [PHP] Check before uploading



Gustav Wiberg wrote:

From: "Stut" <[EMAIL PROTECTED]>

Gustav Wiberg wrote:

Just a thought. Someone posted a question if you could check filesize 
before uploading some days ago. Maybe this is possible with Javascript?
Javascript wouldn't be the best solution, cause of it's incompability 
between browsers, that users can inactivate it. But it's might be 
better than nothing.. The important thing is not to RELY on the 
Javascript-code.


This was suggested at the time, but for what should be obvious reasons 
it's not possible due to security restrictions.


Ok, do you have a solution the problem now?


It wasn't my problem, and not I don't really have the solution. There 
really isn't a solution short of using a Java applet. PHP doesn't get a 
look in until the file has been uploaded, and Javascript doesn't have the 
security scruples.


-Stut

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


Ok!

Best regards
/Gustav Wiberg 


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



[PHP] Pictures and caches

2006-05-18 Thread Gustav Wiberg

Hi!

The thing I want to do is to copy a picturefile to another picturefile.
The thing is that I want to copy this file, show it , and then delete it 
(when it has been shown) .Is this possible?


I want to do this, because of avoiding problems with cache when uploading 
file through an admin-online-system... (the customer uses IE)


When I delete the file in code down below, the picture is not shown (I guess 
because the browser hasn't rendered out all info?)


If you want more code, tell me :-)

Best regards
/Gustav Wiberg



$fileName = "pictures/products/$dbIDProduct1" . "_small";

$ran = strval(mktime()); //Current time

if (file_exists($fileName . ".gif")) {

   copy($fileName . ".gif", "pictures/products/1_$ran.gif");
   showpicture("pictures/products/1_$ran.gif", $dbProductName1, 300, 150, 
"top");

   //deletefile("pictures/products/1_$ran.gif");

}

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



[PHP] Range mktime?

2006-05-18 Thread Gustav Wiberg

Hi

I wondew which range the mktime has? (in digits)
In my case it always start with 1.
something like
1147951344

Is this ALWAYS TRUE (that it would start with 1)

Best regards
/Gustav Wiberg

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



Re: [PHP] Re: Range mktime?

2006-05-18 Thread Gustav Wiberg


- Original Message - 
From: "Barry" <[EMAIL PROTECTED]>

To: ; "Gustav Wiberg" <[EMAIL PROTECTED]>
Cc: "PHP General" 
Sent: Thursday, May 18, 2006 1:45 PM
Subject: [PHP] Re: Range mktime?



Gustav Wiberg schrieb:

Hi

I wondew which range the mktime has? (in digits)
In my case it always start with 1.
something like
1147951344

Is this ALWAYS TRUE (that it would start with 1)

Best regards
/Gustav Wiberg

mktime is giving you the time in seconds since 1st april 1970

So no. It's not true.

--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

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


Ok, thanx!

Best regards
/Gustav Wiberg

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



[PHP] Freing memory resources?

2005-06-16 Thread Gustav Wiberg

Hi there!

I have a script that runs about 10 minutes... Localy on my computer (Windows 
XP 2.6Ghz, Apache) the computer hangs a little now and then when the script 
is running. Is there any good way of releasing more memory while the script 
is running? The script could take 20 minutes, it's not a big matter how long 
the script takes. (As long as the server can do other things at the same 
time)


(In production environment, the php-script is on Apache and Linux (if it 
matters))


Best regards
Gustav Wiberg
@varupiraten.se

Here is my script:
";

//Close file for writing to logfile
//
fclose($logHandle);

}
//Set limitstart for first time
//
if (!isset($limitStart)) {$limitStart = 0;}

if (isset($_REQUEST["updateActions"])) {$updateActions = 
$_REQUEST["updateActions"];}
if (isset($_REQUEST["deleteActions"])) {$deleteActions = 
$_REQUEST["deleteActions"];}

if (isset($_REQUEST["startTime"])) {$startTime = $_REQUEST["startTime"];}

if ($_REQUEST["limitstart"]) {
 $limitStart = $_REQUEST["limitstart"];
}


require ("phpfunctions/opendb.php");


   $sql = "SELECT COUNT(IDVara) cn FROM tbvara WHERE Varunamn LIKE 
'$checkLev%'";

   $querys = mysql_query($sql);

   //Count products in db
   //
   if ($limitStart == 0) {

 $dbArray = mysql_fetch_array($querys);
 $nrOfProducts = $dbArray["cn"];
 echo "Antal produkter: $nrOfProducts";

   //Create logfile or delete all content from current logfile
   //
   $logHandle = fopen($logFileName,"wb");
   fclose($logHandle);


 //Get starttime of script
 //
 $startTime = time();
   }

   else {

 $nrOfProducts = $_REQUEST["nrofproducts"];

  }

  if ($limitStart > $nrOfProducts) {
$nrSeconds = time() - $startTime;
$nrMinutes = $nrSeconds / 60;
?>
Klar med uppdatering av saldo och ev. borttagningar för 
GNT.
Tid för uppdatering:  sekunder eller 
 minuter

Antal uppdateringar: 
Antal produkter som ej visas efter uppdatering:  $deleteActions;?>
href="captech_checksaldo_step2.php?deleteActions=0&updateActions=0">Kolla 
captech produkter

Avslutar scriptet nu!";
   exit;

   }




   //Go through database with products from GNT
   //
   $sql = "SELECT tbvara.IDVara, tbvara.Saldo, tbvara.startPris, 
tbvara.Varunamn, tbvara.synligVara, tbvara.lastPris, 
tbunderkategori.marginalProcent, tbunderkategori.Underkategori FROM tbvara";
   $sql .= " LEFT JOIN tbunderkategorivara ON (tbvara.IDVara = 
tbunderkategorivara.ForIDVara)";
   $sql .= " LEFT JOIN tbunderkategori ON (tbunderkategori.IDUnderKategori 
= tbunderkategorivara.ForIDUnderKategori)";
   $sql .= " WHERE Varunamn LIKE '$checkLev%' AND 
tbunderkategori.marginalProcent>-1 AND tbunderkategori.Underkategori<>'Ej 
tilldelade' ORDER BY IDVara LIMIT $limitStart,$limitSteps";

   //echo $sql;
   //exit;
   $querys = mysql_query($sql);

   while ($toarray = mysql_fetch_array($querys)) {

   //Get current row from db
   //
   $idproduct = $toarray["IDVara"];
   $dbSaldo = $toarray["Saldo"];
   $dbArtNr = $toarray["Varunamn"];
   $dbPris = $toarray["startPris"];
   $dbSynligVara = $toarray["synligVara"];
   $dbLastPris = $toarray["lastPris"];
   $dbMarginalProcent = $toarray["marginalProcent"];
   $dbUnderKategori = $toarray["Underkategori"];

   //Taken from table tbunderkategori
   //
   $marginalProcent = intval($dbMarginalProcent);

   //Delete $checkLev from string $dbArtNr for the sake of 
comparing

   //(take away the three first characters)
   //
   $dbArtNr = substr($dbArtNr, 3);


   //Go through whole textfile and compare with current row in db
   //
   $handle = fopen($fileName, "r");



   $foundProduct= false;
   ob_start();

   while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) {

  $textSaldo = $data[$saldoColumn];
  $textArtNr = $data[$artNrColumn];
  $textPris = $data[$priceColumn];


   //Default marginal is 15 when marginal isn't set for 
undercategory

   //
   if (intval($marginalProcent) == 0) {

 $marginalProcent = 15;

   }

   //echo "Marginal för underkategori $dbUnderKategori är 
$marginalProcent%";


   //Set price based on price from textfile + marginal set
   //for undercategory
   //
   $newPrice = $textPris + (($textPris * 
($marginalProcent/100)));

   $newPrice = round($newPrice,0);


  if (isset($textArtNr) AND isset($textSaldo)

[PHP] Fast count of recordset in php...

2005-08-06 Thread Gustav Wiberg

Hello there!

How do i get a fast count of a recordset in php?

Look at this code:

   $sql = "SELECT COUNT(IDVara) cn FROM tbvara WHERE Varunamn LIKE 
'$checkLev%'";

   $querys = mysql_query($sql);

   //Count products in db
   //
   $dbArray = mysql_fetch_array($querys);
   $nrOfProducts = $dbArray["cn"];


It's slow... Why? Any suggestions?

/mr G
@varupiraten.se

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



Re: [PHP] Fast count of recordset in php...

2005-08-06 Thread Gustav Wiberg

Hi again!

Thanx!!! I think this will help a lot!!!

/mr G
@varupiraten.se


- Original Message - 
From: "TalkativeDoggy" <[EMAIL PROTECTED]>

To: "Sebastian" <[EMAIL PROTECTED]>
Cc: "Gustav Wiberg" <[EMAIL PROTECTED]>; 
Sent: Sunday, August 07, 2005 6:04 AM
Subject: Re: [PHP] Fast count of recordset in php...



if you just wana get count of recordset,
don't do this:
$sql = mysql_query("SELECT col FROM tbvara WHERE Varunamn LIKE 
'$checkLev%'");

// record count
echo mysql_num_rows($sql);

be coz this way is slow and costs more overload.

   $sql = "SELECT COUNT(IDVara) cn FROM tbvara WHERE Varunamn LIKE 
'$checkLev%'";

   $querys = mysql_query($sql);

   //Count products in db
   //
   $dbArray = mysql_fetch_row($querys);
   $nrOfProducts = $dbArray[0];

Sebastian wrote:
you'd be suprized how fast an index can be.. you should read the manual 
on indexes,

http://dev.mysql.com/doc/mysql/en/mysql-indexes.html

"If a table has 1,000 rows, this is at least 100 times faster than 
reading sequentially"


while you may not get 100x faster, it will be faster than having no 
index.. also try using mysql_num_rows()


$sql = mysql_query("SELECT col FROM tbvara WHERE Varunamn LIKE 
'$checkLev%'");

// record count
echo mysql_num_rows($sql);


PS, 'reply all' to list.

Gustav Wiberg wrote:


Hi there!

There are about 300 records.
You're right, I can add an index, but Is that the only way to get a 
faster solution?


/mr G
@varupiraten.se

- Original Message - From: "Sebastian" 
<[EMAIL PROTECTED]>

To: "Gustav Wiberg" <[EMAIL PROTECTED]>
Sent: Saturday, August 06, 2005 11:08 PM
Subject: Re: [PHP] Fast count of recordset in php...


how many records in the table? its going to be slow no matter what, 
especially if you have a lot of records.. your searching each record 
then counting them.. do you have any indexes? judging by your query 
you can add index on Varunamn and it should be more speedy..


Gustav Wiberg wrote:


Hello there!

How do i get a fast count of a recordset in php?

Look at this code:

   $sql = "SELECT COUNT(IDVara) cn FROM tbvara WHERE Varunamn LIKE 
'$checkLev%'";

   $querys = mysql_query($sql);

   //Count products in db
   //
   $dbArray = mysql_fetch_array($querys);
   $nrOfProducts = $dbArray["cn"];


It's slow... Why? Any suggestions?

/mr G
@varupiraten.se


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



--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.10.0/63 - Release Date: 2005-08-03




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



[PHP] Unique user?

2005-08-19 Thread Gustav Wiberg

Hi there!

Is there any way of doing this:

1. User may vote 1-10 on a joke on a site X.
2. Same User may NOT vote again dependent of the computer...

I know this works if I check IP-adress, but because some users doesn't have 
a fixed ip-adress... it won't work correct.


Thought of getting a mac-adress, but I think is impossible to... :-)

Any ideas?

/G
@varupiraten.se

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



[PHP] possible to get a function from another domain

2005-08-23 Thread Gustav Wiberg

hi there!

Is it possible in PHP to retrieve value from one domain to another than my 
own?


Something like this:

Other domain: function getValueForMp3Player()

My domain: $price = getValueForMp3Player('Inno AX VB4393') //retrieves value 
from other domain


/G
@varupiraten.se 


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



Re: [PHP] possible to get a function from another domain

2005-08-23 Thread Gustav Wiberg

Hi!

Njae

I have a webshop and want to see a price from another webshop online 
(directly).


Let's call my webshop - varupiraten.se
and the other webshop - inwarehouse.se

I want to be able to see what price inwarehouse.se has for a certain product 
directly. (without no copying). Of course I have to know the implemenation 
of the code that inwarehouse.se has given to varupiraten.se


Do you understand what I'm trying to do? :-)

/G
@varupiraten.se

- Original Message - 
From: "Rory Browne" <[EMAIL PROTECTED]>

To: "Gustav Wiberg" <[EMAIL PROTECTED]>
Cc: "PHP General" 
Sent: Tuesday, August 23, 2005 9:45 PM
Subject: Re: [PHP] possible to get a function from another domain


I'm not sure I understand but:

You define a function on one machine;

You want to use that function on another machine;

If I understand you correctly, then you should be able to just

cp function_server.php function_server.txt
,

and include it over http

and done



On 8/23/05, Gustav Wiberg <[EMAIL PROTECTED]> wrote:

hi there!

Is it possible in PHP to retrieve value from one domain to another than my
own?

Something like this:

Other domain: function getValueForMp3Player()

My domain: $price = getValueForMp3Player('Inno AX VB4393') //retrieves 
value

from other domain

/G
@varupiraten.se

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




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



--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.10.14/79 - Release Date: 2005-08-22

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



Re: [PHP] possible to get a function from another domain

2005-08-23 Thread Gustav Wiberg

Hi!

Can I use require with http?

My domain: www.varupiraten.se

Other domain: www.webshop2.se

Does this kind of code work?

Code for my domain:
http://www.webshop2.se/externfunctions.php);
$x = getValueFromProduct('Inno AX5000'); //This function retrieves price 
from webshop2.se

?


/G
@varupiraten.se

- Original Message - 
From: "Jasper Bryant-Greene" <[EMAIL PROTECTED]>

To: 
Sent: Tuesday, August 23, 2005 9:47 PM
Subject: Re: [PHP] possible to get a function from another domain



Gustav Wiberg wrote:
Is it possible in PHP to retrieve value from one domain to another than 
my own?


Something like this:

Other domain: function getValueForMp3Player()

My domain: $price = getValueForMp3Player('Inno AX VB4393') //retrieves 
value from other domain


What exactly do you mean by domain in this example? You can include() or 
require() the file with the function declaration in it...


Jasper

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



--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.10.14/79 - Release Date: 2005-08-22




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



Re: [PHP] possible to get a function from another domain

2005-08-24 Thread Gustav Wiberg

Hi there!

Thanx for the help!

And everybody else that helped me with the solution of course! :-)

/G
@varupiraten.se

- Original Message - 
From: "Rory Browne" <[EMAIL PROTECTED]>

To: "Jim Moseby" <[EMAIL PROTECTED]>
Cc: 
Sent: Tuesday, August 23, 2005 10:21 PM
Subject: Re: [PHP] possible to get a function from another domain


I withdraw my information in my earlier post.

I was in a cybercafe in a hurry - and didn't have time to consider
what was said, nor what I was saying myself.

What I said before has little or not merit. 


You can make an experimental interface, and parse the html without the
other domain owners co-operation(although it may be considered rude to
do it without his consent). Your interface breaks when he changes his
system.

You can get him to create an XML page, that you can parse, if you have
his co-operation, or you could possibly get him to create an XML-RPC
or SOAP interface to his site.

On 8/23/05, Jim Moseby <[EMAIL PROTECTED]> wrote:

> [snip]
> Can I use require with http?
>
> My domain: www.varupiraten.se
>
> Other domain: www.webshop2.se
>
> Does this kind of code work?
>
> Code for my domain:
>  require(http://www.webshop2.se/externfunctions.php);
> $x = getValueFromProduct('Inno AX5000'); //This function
> retrieves price
>
> from webshop2.se
> ?
> [/snip]
>
> Have you tried it?
>
> Really, unless you own the the other domain and have a way to
> access the
> data, you really cannot do this without some sort of screen
> scraping or
> URL munging. Let us say that you know the product listing for
> the other
> domain is something like
>
> http://www.webshop2.com/productInfo.php?product=Inno_AX5000
>
> You could retrieve that data and manipulate it.
>

But even if you did, you're giving the other guy the power to break your
site.  All he has to do is change the URL or the format of the page, and
BOOM, your site croaks.

So a relevant question is: "Do you have control of the other site, or at
least the cooperation of the other site's owner?"

JM

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




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



--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.10.14/79 - Release Date: 2005-08-22

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



[PHP] Computer name?

2005-08-25 Thread Gustav Wiberg

Is it possible to retrieve (view) the computers name from the client in PHP?

/G
@varupiraten.se

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



  1   2   3   >