[PHP] problem with ODBC

2003-03-21 Thread Frank
Hi, I'm Frank
I have problem when I use conection odbc, give me a error:

PHP Warning: SQL error: [Microsoft][ODBC Driver Manager] Data source name not found 
and no default driver specified, SQL state IM002 in SQLConnect in 
c:\php\includes\adodb\drivers\adodb-odbc.inc.php on line 166

the DSN yes exist, and is a conection to Oracle database, and I use with other program 
and no have problem, only with php. the same problem have with Access

I have a window nt server 4.0, php 4.3.1 and IIS 4.0

Help me please
Frank.-


Re: [PHP] Problems with post data

2003-03-30 Thread Frank
Does this bug also applies to passing variables in an URL.

I'v noticed  that when the directive register_globals is set to off as it is
recommended in the php.ini file no variables are passed on to other pages.
Switching it to on would be the simplest solution, but scripts like
phpMyAdmin do not seem to have these problems.

Any idea or suggestion.

Frank

"John W. Holmes" <[EMAIL PROTECTED]> schreef in bericht
news:[EMAIL PROTECTED]
> I bet the web server that works is not running Apache 2, is it? Either
> way, it's an Apache2 and PHP bug. It's in the bug tracker somewhere...
> Use Apache 1.3.27 or whatever the latest is...
>
> ---John W. Holmes...
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
>
> > -Original Message-
> > From: Mark Douglas [mailto:[EMAIL PROTECTED]
> > Sent: Saturday, March 29, 2003 7:57 AM
> > To: '[EMAIL PROTECTED]'
> > Subject: [PHP] Problems with post data
> >
> > I'm having problems with my post variables. Here's the page I use to
> > submit
> > data:
> >
> > 
> >  > />   />
> > 
> >
> > Here's the test2.php page:
> >
> >  > print_r($_POST);
> > ?>
> >
> > This is all very simple, and works on one of my webservers. However,
> on
> > another webserver with a practically identical configuration, if I
> post
> > "testing" the result that I get is this:
> >
> > Array ( [new_area] => testingnew_area=testing )
> >
> > I've spent hours scouring my two configurations, changing options here
> and
> > there, and have had zero success in making the problem webserver work.
> >
> > The server is a dual processor RedHat 8 system running apache 2.0.43,
> and
> > php 4.3.1. You can see the phpinfo at
> > http://inexorable.sagelikefool.net/phpinfo.htm (yes htm, not php). Any
> and
> > all 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



[PHP] Where is my REMOTE_USER?

2002-08-29 Thread Frank


Hi,

when logging in with username and password with the good old "Require user" 
mechanism in Apache I could earlier see the name of the user logging in as 
$REMOTE_USER.

But it seems now to have disappeared. It seems to be nowhere, neither as

$GLOBALS['REMOTE_USER']
$_SERVER['REMOTE_USER']
$_ENV['REMOTE_USER']

or in the older

$HTTP_SERVER_VARS['REMOTE_USER']

or in any of the other superglobals.

Did it possibly fall out of the PHP implementation? Or should it be there 
and I am overlooking something?

Thanks!

Frank
U5.com


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




Re: [PHP] Where is my REMOTE_USER?

2002-08-29 Thread Frank

At 06:03 29/8/2002 -0400, David T-G wrote:

 > Frank, et al --
 > ..and then Frank said...
 > %
 > % Hi,
 > %
 > % when logging in with username and password with the good old "Require 
user"
 > % mechanism in Apache I could earlier see the name of the user logging 
in as
 > % $REMOTE_USER.
 > This sort of thing has come up on the list frequently.
 > You should set
 > register_globals = on
 > in your php.ini file and kick your web server.
 >
 > HTH & HAND

But! Two things:

1. register_globals were already turned on
2. Surely the PHP designers would not force users to have such a major 
security advantage turned off for getting a variable that is a true apache-var?

So problems remains: Where did the REMOTE_USER go?

I am BTW running Apache 2.0 with PHP 4.2.2 as a CGI-module. When it worked 
last time I was "only" running Apache 1.3.26. Maybe the Apache-guys changed 
something?! Could be a RTFM-case...

Well, probably I should drop using Apache's old auth-sceme and run all in 
PHP anyway.

Thank you for the input.

Best

Frank
U5com





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




Re: [PHP] Where is my REMOTE_USER?

2002-08-30 Thread Frank

At 16:42 30/8/2002 +1200, David Robley wrote:
>In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
>says...
>
>Is this snippet from the docs possibly relevant?
>
>Chapter 17. HTTP authentication with PHP
>
>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.


I think the "HTTP Authentication hooks" are something a little different 
but the problem might be related.

My other settings actually worked well for a long time, then I upgraded 
Apache & PHP and gone were the remote_user.

Thank you for drawing my attention to the relevant passage.

Frank




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




Re: [PHP] Setting date fields in mysql queries

2002-10-02 Thread Frank


Hi,

it's a great tip to install PhpMyAdmin - or phpPgAdmin for PostgresSQL - 
this will only take you at most half an hour even for a newcomer.

You can then easily test queries, see any error messages and see what 
result they have on tables.

In this case I'd echo out the query

echo $query = "UPDATE countertable SET CurrDate = '$ndate' WHERE ID = $id"

and try to cut-and-paste it into the query-field in PhpMyAdmin.

When you say "nothing happens" you'd probably discover that ID is a number 
not matching anything _or_ that $nDate and the field are not proper date 
values ;-)

Hope it helps!

Frank, U5


PHP work!

Looking for PHP work over the net? Or would like to try to work in South 
East Asia's most exiting place, Bangkok?
Then jump to http://www.u5.com/ and fill out the Developers Form.
We are urgently looking for new people in October 2002




At 15:16 2/10/2002 -0400, you wrote:
>I have the following line in a program I'm working on:
>
>$query = "UPDATE countertable SET CurrDate = '$ndate' WHERE ID = $id"
>
>$ndate is a properly formated date read from a text field on a form on the 
>previous page.  When I run the query using mysql_query, it returns TRUE 
>each time, but the field is not updated.  The only explanation I can think 
>of is that there is something wrong with the date value.  I've echoed it 
>to the screen and it looks fine, but the query still doesn't work.  Any 
>suggestions?
>
>Thanks in advance,
>
>Brad
>
>
>--
>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] Very slow pg access

2002-06-22 Thread Frank


I find it impossible that PHP should be "slow". PHP's Pg functions are - 
and shouldn't be - nothing more or else than a frontend to the Pg API.

The problem is most likely that you are not comparing the same values. I 
think the analyze values are calculated "internal" values that has little 
to do with real life through an API.

Postgres is very fast - but a connect and 3 queries in 0.002 ms? Hmmm!

The 0.1 s looks more like a "real" value to me.

Best

Frank


At 00:51 22/6/2002 +0200, you wrote:
>Hi!
>
>i made some benchmarks because my script is somehow very
>slow. In this script i execute 3 queries to PostgreSQL server
>and one connect string. I connect to socket.
>
>I check this queries in pg with explain analyze and i have
>result 1.18ms so i add a little and let say that for those 3
>queries need 2ms. (1 simple select, 1 delete, 1 insert)
>
>
>When i check from PHP i use microtime() to check times.
>
>Here is results
>
>0.0443  for connect
>0.0343  1 querydelete
>0.0034  2 queryselect
>0.0049  3 queryTHIS ONE is INSERT OR UPDATE
>
>0.087 TOTAL
>
>so complete time is about 0.090 s this is 90ms against 2ms. I
>thik that this is not normal. or is PHP so slow or there is
>something wrong with libraries
>
>I use PHP 4.1.2 and pg 7.2.1
>
>Any thoughts.
>
>--
>tia,
>  Uros  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




[PHP] Help needed with hexdec();

2002-07-06 Thread frank

Hi Guys,
 
I have a problem wich I hope has been solved by someone :-)
 
Here's the deal,
 
I have to convert a perl script to PHP trying to do so I get negative
values from hexdec(), If I use (int)hexdec() the numbers aren't negative
anymore, but they do not add up to what they should.
 
Here's the perl line:
$a = FF ($a, $b, $c, $d, $temparr[8],  $S11, hex("698098d8"));
 
 
this is PHP:
$a = FF ($a, $b, $c, $d, $temparr[8],  $S11, hexdec("698098d8"));
 
FF is a function:
function FF($a,$b,$c,$d,$x,$s,$ac)
{
 $a += F($b,$c,$d) + $x + $ac;
 if ($a > hexdec(""))
   {
   $a = substr($a,strlen($a)-9,9) ;
   }
 $a = RL($a,$s);
 $a += $b;
 return $a;
}
 
F is also a function:
function F($x, $y, $z)
{
 return ((($x) & ($y)) | ((~$x) & ($z)));
}
 
Could anybody tell me what I am missing here?
 
e-mail:   [EMAIL PROTECTED]
 



RE: [PHP] Re: Help needed with hexdec();

2002-07-08 Thread frank

Thank you for your answer Richard, unfortunately the port from perl to
PHP didn't work out the way I wanted it to - probably mainly because of
the lack of perl knowledge here.

And yes you are right, the numbers I use are a lot bigger than
2147483647.

If anyone has an idea on how to treat the numbers or hex number for that
matter please don't hesitate. 

Anyway, I'm dropping the project for now.

Thanks again.

-Oorspronkelijk bericht-
Van: Richard Lynch [mailto:[EMAIL PROTECTED]] 
Verzonden: zondag 7 juli 2002 0:12
Aan: [EMAIL PROTECTED]
Onderwerp: [PHP] Re: Help needed with hexdec();

>I have to convert a perl script to PHP trying to do so I get negative
>values from hexdec(), If I use (int)hexdec() the numbers aren't
negative
>anymore, but they do not add up to what they should.

>From the manual:  http://php.net/hexdec
"The largest number that can be converted is 7fff or 2147483647 in
decimal."

I'm betting your numbers are bigger than that.

I wrote a less-limited hex2dec function years ago, and threw it up on
Sklar,
or, uhhh, the *other* PHP code repository.  There were really only two,
back
then... :-)

-- 
Like Music?  http://l-i-e.com/artists.htm


-- 
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] Better standards in PHP-coding

2002-04-20 Thread Frank


"The nice thing about standards is that there are so many to choose between".

Subject: Uses of block markers in coding

GNU recommends a standard with block-markers aligned under each other and a 
number of people - including myself - find it senseless and 
counter-progressive to keep up an older standard resting from old days and 
doing the programmer a disfavor.

Too many programmers continue to use a style that originates back to the 
days where dumb terminals with one-line memory and line-editors was common.

Those days it could take long time to submit a line to the mainframe. I 
have tried it myself and in worst-case situations it could take up to half 
a minute to submit a line.

So naturally we put more things into one line. Statements like

if (tempratureM1>=tempratureSTP) {cout << "Warning! Cooling needed"; 
log(tempratureM1, "Warning);};

all in one line.

When editors became a little faster people started to write:

if (tempratureM1>=tempratureSTP)  {
   cout << "Warning! Cooling needed"; log(tempratureM1, "Warning); }

which is nicer to look at but would take many seconds more as one more line 
has to be submitted.

- - -

Nowadays few people have any problems with waiting for a CR.

But for mysterious reasons a rest from the old forced "standard" remains 
among people who use C(++) like languages.

It is still standard to write

if (some_expression) {
   statements;
   ...
}

What the "{" - the marking of the beginning of a block that should be 
indented - is doing in the end of the line nobody has yet been able to 
explain me.

Why, then, are functions not written as

function foo(parameter1, foo(parameter1, parameter2, ... parameterN) {
  statements
  ...
}

?

In other block-structured languages you of course align block-markers under 
each other, allowing for easy scan.

if expression
begin
   statement;
   ...
   ...
end;

I have yet to see anybody write

if expression begin
   statement;
   ...
   ...
end;

- - -

Does it matter? Oh, yes it does. A lot. As teacher I know from experience 
that programmers has a harder time tracking their own block with a number 
of "{"s dancing far out of sight in the right side of the screen. This is 
not a matter of experience. No experience can ever make it equally fast to 
control structures based on vertically aligned block-markers contra those 
where the marker can be found anywhere on a line.

As an amusing result of the weird practice it has been necessary to 
recommend a standard where the { }-pair is always used, even though there 
is only one statement following an if:

if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114) {
   oneStatement;
}

instead of simply

if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114)
   oneStatement;


Why the need for the extra "{ }"s?

Of course because the the difference between

if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114)
   oneStatement;

(correct) and

if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114)  {
   oneStatement;

(wrong) is easily overlooked because of the block marker put away to the right!


But nobody overlooks the difference betweeen

if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114)
   oneStatement;

and

if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114)
   {
   oneStatement;


where the missing "}" shines in the eyes.

- - -

We can only hope that some major standard-setters for PHP should make a 
rational decision about what standard to choose and not just keep "what we 
are used to" for the disadvantage of future generations of programmers.

http://www.gnu.org/prep/standards.htm
http://cs.nmhu.edu/personal/curtis/cs1htmlfiles/essentialssec6.htm


Best regards

SFM
U5com Co Ltd.


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




[PHP] PHP "ignoring" dotfiles

2002-04-29 Thread Frank


Hello list,

My PHP acts unexpected when requiring files with a leading dot. I'm on 
FreeBSD 4.3

In a directory I have the following two files:

.mydotfile.php:


myfile.php:



When I run myfile.php there is no output!

If I rename .mydotfile to something without a leading dot and change the 
name in the require-statement it writes "I am here!", as expected.

If I try to require a non-existing dot file PHP complains, as expected.

So - why don't I get an output from the run when written as above?

I know that it has worked as expected earlier, but after an upgrade (I 
think) I now get this strange problem. I have tried to play with the 
include_path but without result.

Anyone have a clue?

Best,

Frank


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




Re: [PHP] PHP "ignoring" dotfiles, permissions

2002-04-29 Thread Frank


>Just a hunch: do you get the same permissions output for the dotfiles as
>the normal ones?

Thanks for the idea. I am not sure what you mean by "permissions output" 
but it is same owner and an "ls -la" gives

-rwxr-xr-x   1 frank  wheel   27 Apr 29 23:05 .mydotfile.php
-rwxr-xr-x   1 frank  wheel0 Apr 29 23:08 myfile.php

- - -

I BTW forgot to tell that I am on PHP 4.1.1

BTW - if I introduce syntax errors in .mydotfile they are ignored - it is 
like PHP does not read the content at all. But take away the leading dot 
and it is all as expected.

Mystified!

Frank




>* and then Frank declared
> > .mydotfile.php:
> >  > echo "I am here!";
> > ?>
> >
> > myfile.php:
> >  > require '.mydotfile.php';
> > ?>
> >
> >
> > When I run myfile.php there is no output!
>
>Just a hunch: do you get the same permissions output for the dotfiles as
>the normal ones?
>- --
>Nick Wilson //  www.explodingnet.com
>


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




Re: [PHP] PHP "ignoring" dotfiles, permissions

2002-04-29 Thread Frank



>You know that "dot" files are hidden files ? ...

Yes, but I think this only is in contexts where directories are scanned by 
some application "respecting" this method of hiding - and that they 
otherwise are normal files when addressed explicitly.

However, there seems to be something else about dotfiles and PHP (or 
FreeBSD or my particular systems) I don't know.

>If you want to use them, try to fread() them.

Interesting idea. I will play with that.

- - -

Until something is clearer I recommend PHP-people using

require '.mydotfile';or
include '.mydotfile';   (I tried that as well)

to watch out for unexpected behavior and maybe entirely avoid this in 
PHP-solutions intended to be portable. At least at my computer it wouldn't 
work and it is a very mainstream one! :-)

- - -

BTW - there is no problem if I give the full path, like

require '/usr/home/frank/public_html/php_test/.mydotfile';

- - -

Thanks to all for testing and suggestions.

Frank





>HTH Oliver
>
>
>--
>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] PHP "ignoring" dotfiles, permissions

2002-04-29 Thread Frank


At 14:55 29/4/2002 -0400, J. Holmes wrote:
>what if you do this?
>
>require './.mydotfile.php';

I tried that! No effect. But...

Suddenly it worked!

I now think I to some extent might have been fooled by my desktop PC 
caching information where it shouldn't. I have never seen it before (have 
set oplocks in Samba) - but maybe the PC was overloaded and "forgot" about 
immediate write to desk. This could explain some of the things. At least it 
suddenly worked when the files were edited in a shell editor instead of 
textpad. It could be that when I thought I tried different combinations 
from the shell command line I really didn't - as they might not have been 
written to desk. Windows is a little special with files without anything 
before the dot. I dont think it explains it all though. I also recall to 
have had problems with dotfiles earlier and then making them work.

I will stay out of dotfiles in combination with PHP in the future, just to 
be safe.

Thanks for the suggestion...

Best

Frank







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




[PHP] The future of call time pass-as-reference

2002-05-15 Thread Frank


After installing PHP 4.2.0 I got the following error-message under a run:

"Warning: Call-time pass-by-reference has been deprecated - argument passed 
by value; If you would like to pass it by reference, modify the declaration 
of [runtime function name](). If you would like to enable call-time 
pass-by-reference, you can set allow_call_time_pass_reference to true in 
your INI file. However, future versions may not support this any longer. "

This is actually big news as parameter passing is a fundamental issue.

Traditionally

function foo($v)   called as
foo(&$myvar)

was regarded as safer coding than

function foo(&$v)   called as
foo($myvar)

as in the first case the user would automatically be aware that $myvar 
could be changed by the function, in the second not.

Worse is that in some functions it makes fine sense for the user to have a 
choice. These functions will be very hard to rewrite as the user will be 
forced to references in all cases.

Finally default parameters are not supported for reference-parameters in 
the function header.

Anyway - it seems that I have to choose between either starting to rewrite 
quite a lot of code right away or risk being forced to rewrite more later 
if I use the quick fix with setting allow_call_time_pass_reference to true.

Any thoughts?

Frank



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




[PHP] TEST-mail to list - no content - pls. ignore.

2002-02-25 Thread Frank


Just testing :-)



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




Re: [PHP] Re: ? re phpwebhosting.com - still in business??

2002-02-25 Thread Frank


Anything in effect saying "any transfer without extra cost" (or "unlimited 
diskspace") is not for users expecting quality. Bandwidth and diskspace 
costs money.

What they mean is "It's unlimited unless off course you use too much", in 
other words unserious advertising and so it's a business you would be 
careful to trust with anything important.

For PHP hosting I'd recommend Pair anytime.

/SFM

At 17:55 24/2/2002 -0500, you wrote:
>They are very questionable.  Have had heard many complaints from clients and
>associates about these guys shutting down sites without warning, anything
>that starts to get a few hits seems to be an issue with them...
>
>Again, you get what you pay for people :)
>
>Jeff
>- Original Message -
>From: "jtjohnston" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Sunday, February 24, 2002 5:44 PM
>Subject: [PHP] Re: ? re phpwebhosting.com - still in business??
>
>
> > What's their deal? How do they offer all that and be so cheap?
> > Using my site like Geocities to advertise?
> > http://www.phpwebhosting.com/host_details.html
> > J
>
>
>
>
>--
>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] case insenstive

2002-03-04 Thread Frank


if ($author[0]=='a' || $author[0]=='A')
{
...
}

or (much slower)

if (strtolower($author[0])=='a')
{
...
}


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




Re: [PHP] OOP .. I just don't get it.

2002-03-05 Thread Frank


Many years ago I wrote something for newcomers into OOP. I have cut a 
snippet out of it and added some comments. Sorry, it became rather long.

Hope it helps somebody.

Frank

"
OOP is the art of designing "objects", then creating and killing them. An 
object is a box with handles. We can operate it without disturbing anything 
else. We can make them and kill them as needed.

When the first radios were designed they were very spaghetty. Though the 
designer had a idea of what modules he needed he'd freely with a lot of 
wires interlink all over the place, simply because it was the easiest and 
fastest thing to do. And the radio was made and worked fine.

The drawbacks: Not a single piece of work could be used in another radio 
unless the engineer would enjoy sorting out all the possible wires and what 
could happen in any part of the radio. And getting help was hard unless the 
helper was interested in understanding the entire construction. He could 
not disconnect any particular part of the radio and test it alone.

Independent modules were the answer. The engineer had always had these in 
mind conceptually - but in his work they just happened to get mixed up with 
wires and as complexity grew the benefit of soldering the little extra wire 
from A to B were later outweighted by the costs above. So increasingly the 
development grew towards small units with well-defined input and output 
which dramatically changed the entire industry. Suddenly high complexity 
could be made in a module which could then be sold to many different 
manufacturers of radios.

Programming had exactly the same problems.  Though programmers were well 
aware - and did it well - of the importance of making modules something 
were missing. The ability of creating modules that could be designed so 
their state, data and functions existed isolated from everything else.

Another problem: a customer once ordered a little program where he on the 
screen could build up a page for printing. I made it, it worked fine - and 
then he said "It would be great if I could have two pages at the same time 
and swap between them." Hmm. Instead of just using nLines to hold the 
numbers of lines of the printed page I now had to use nLines1 and nLines2. 
I was smart enough to make the nLines and other variable into an array 
nLines[1..nPages] if he should get ideas of more pages. I proudly went back 
to him and say "Now you can decide on your own maximum of pages needed!"

Great, but would I always in the future have to use arrays instead of 
simple variables if somebody had the need for more "something" at the same 
time? I tried that. The cost was more clumsy code, slower to write and 
execute - and most often only one instance was ever needed.

OOP had answer to all of this. Modules that can't be touched, which exist 
by themselves. You could really get a module from somebody else and put it 
right into your program. The module could be full of variables that had the 
same names as yours. "i, pageLength, sum". While earlier we'd have to 
carefully prefix variables with something to make sure they didn't clash 
this problem was gone as the variables only existed inside the module.

The printer-page application of above - now I wouldn't have to sit and 
decide whether to use arrays or simple variables. I'd simply write the 
description of how this printer-page worked (called a "class") and then I 
could make and kill as many of them as I needed.

class MyPrintpage
   {
   variables...
   functions...
   }

This class didn't "make a page" like the old code would have done. It just 
described _how_ to make it. And it didn't take one bit more time to write 
than in the old style. To actually "create" a page we could use we wrote

MyPrintpage p1;

If we one day needed two we'd write

MyPrintpage p1, p2;

And when we didn't need it anymore we would write

delete p2;

and the memory was freed. An amazing difference!
"

(End of snippet of old article.)


OOP seems to me to be in everyday programming to be a little less natural 
to use in PHP because of the short lifetime of the script.

Imagining Windows applications programming without ability to create and 
destroy objects is flatly impossible in praxis.

But PHP-scripts for web-pages tends to deal with one-shot functionality 
from a single input. Rarely much is build (though that wouldn't necessarily 
have to be so.) Accessing a MySQL database and fetching rows does not call 
for objects. Etc.

In other words - OOP is not immediately pressing its way in as a necessary 
concept. When I did C++ I only did OOP - in PHP rarely.

That is not to say that OOP is not of value in PHP. It very much is and 
many valuable classes have been designed where old-style design would have 
been senseless.

It's just, well, maybe not something that the ordinary web-prog

Re: [PHP] Broadcasting

2002-03-10 Thread Frank



>I noticed in the logs once where people were trying to get in by FTP on
>occasion, or adding weird things to a url, when it was running just as
>an IP.

...like e.g. Code Red or Nimda do.


>My question is: does my Apache server broadcast itself or its IP
>for when script kiddies come check out my machine to see if they can
>crash it? What does it broadcast? How did the script kiddies find me?

No need to broadcast anything. Crackers run systematic scanning of 
IP-addresses. We reject in average 65 visitors pr. day, typically trying 
FTP, Samba, SSH or portmap.


>Can I reverse process this and see if my stolen machine still exists
>anywhere? What would I look for?

But... is it physically stolen? Sorry - I'd have no suggestion of how to 
look for it, unless of course you have set it up to send mail to somebody 
and can check the IP-address it is sending from if it is SMTP. Or you 
search for one of your pages in Google and find them served! Not likely, 
though.

- - -

Sorry for your bad luck. Hacking is a serious problem, also I have lost a 
server once.

I have taken these precautions, which I think are pretty standard.

1. Make sure no more services are running than needed. Carefully edit 
start-up files - don't trust the suppliers default installation. (That was 
my mistake - RH 6.2)  Enable only things you know you need.
2. Restrict (pr. IP) who has access. It is unlikely that all the world need 
access to all your services. Do you e.g. need global access to your mysql 
or is it just serving requests from Apache? If so start mysql with 
--skip-networking. Look into hosts.allow and firewalls (ipchains or ipfw 
depending on what server OS you are using). Look well into 
inetd/hosts.allow. Also SSH will limit access.
3. Subscribe to security newsletters. Install fixes and patches.
4. Look into COPS and other tools that checks suspicious changes (like e.g. 
new files running suid)
5. User proper passwords
6. Always connect securely
7. Be very careful who you let in as user. Do they need FTP only? Then 
don't allow them shell-access.
8. Don't ever let anyone in as root, even for a second, if you do not have 
100% trust.
9. Monitor logs
10. You may still get cracked. Make regular backups in a safe place.

All this costs, of course. Lots of time. :-(  But having lost one server 
makes you realize that taking out the time is probably the cheapest after all.

Then say your prayers every night and of course the good old golden rule:

Don't trust software you didn't write
Don't trust hardware you didn't build
Don't trust people you aren't.

Best

Frank


At 21:47 10/3/2002 -0500, you wrote:
>Not really a php thing, more a loss of php :) !
>
>My PHP-MySQL server has been stolen from my office (last night).
>Security has not been doing their job!
>
>I noticed in the logs once where people were trying to get in by FTP on
>occasion, or adding weird things to a url, when it was running just as
>an IP. My question is: does my Apache server broadcast itself or its IP
>for when script kiddies come check out my machine to see if they can
>crash it? What does it broadcast? How did the script kiddies find me?
>Can I reverse process this and see if my stolen machine still exists
>anywhere? What would I look for?
>
>I have a ghost backup going back around four week ago, but ...
>
>Sigh :(
>John
>
>
>--
>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] PHP group in spanish

2002-03-11 Thread Frank

How know a PHP group that is in spanish?.

Thanks beforehand...
Frank.-



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




Re: [PHP] Can't display PNG images

2002-03-11 Thread Frank


 >OUTPUT from phpinfo()
>---
>GD Supportenabled
>GD Version1.6.2 or higher
>WBMP Support  enabled

but does it say

GD Support enabled
GD Version 1.6.2 or higher
. . .
PNG Support enabled
. . .
?

If the line with "PNG Support enabled" is not there then something went wrong.

I had the same problem once. Don't rely on the compiler complaining - _you_ 
carefully have to make sure the PNG libs are in the right place (easier 
said than done). Remember to run "gmake clean" between compilations of PHP

Good luck.

Frank







At 20:16 11/3/2002 -0500, you wrote:
>Hello,
>Background info:
>
>I'm running
> o PHP 4.1.1 on a linux server kernel(2.2.16).
> o Using Netscape Communicator 4.75
> o Compiled and installed the gd(1.8.4) library
>
>Problem(2 problems):
>
>1.- The following code won't display an image(I get an icon of some type of
>piece of paper).
>header ("Content-type: image/png");
>$im = @ImageCreate (50, 100)
>   or die ("Cannot Initialize new GD image stream");
>$background_color = ImageColorAllocate ($im, 255, 255, 255);
>$text_color = ImageColorAllocate ($im, 233, 14, 91);
>ImageString ($im, 1, 5, 5,  "A Simple Text String", $text_color);
>ImagePng ($im);
>?>
>
>2.- The configure Command from phpinfo() is different than what I actually
>typed at the
> command line.  Also, phpinfo() area for GD does not show PNG or JPEG
>support.  why?
>from phpinfo()
>--
>  './configure' '--with-mysql' '--with-apxs=/var/apache/bin/apxs'
>  '--with-gd=/home/builder/downloads/untarred/gd-1.8.4'
>'--enable-sockets'
>  '--enable-calendar' '--enable-ftp' '--enable-trans-sid'
>What I typed at the command line:
>-
>  ./configure --with-mysql --with-apxs=/var/apache/bin/apxs
>   --with-gd=/home/builder/downloads/untarred/gd-1.8.4
>   --with-png-dir=/usr/lib --enable-gd-native-ttf --with-ttf
>   --with-jpeg-dir=/home/builder/downloads/untarred/jpeg-6b
>   --with-t1lib=/home/builder/downloads/untarred/t1lib-1.3.1
>   --enable-sockets --with-zlib-dir --with-xpm-dir --enable-calendar
>   --enable-ftp --enable-trans-sid
>
>OUTPUT from phpinfo()
>---
>GD Supportenabled
>GD Version1.6.2 or higher
>WBMP Support  enabled
>
>I would really appretiate any ideas you could give me.
>Thanks in advance! -Teresa


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




[PHP] PHP / cgiwrap - weird problem

2002-03-31 Thread Frank


Dear List,

I have been using cgiwrap for many years, always with the .php extension 
added like an AddType like this.

httpd.conf:
 Action application/php-script   /cgi-bin/php.cgi
 AddHandler application/php-script  .php4 .php3 .php

Works perfectly.

But in this case I don't want to serve the .php-extension in general. I 
have also moved the executable binary php out of the web tree, compiled it 
with "--enable-discard-path" and added #!/usr/local/bin/php in the scripts.

So instead of above, httpd.conf has

  ScriptAlias /cgi-bin/ "/usr/home/httpd/bin/"

and scripts can be invoked in the browser like:

http://www.myname.com/myscript1.cgi

E.g. "myscript1.cgi" could be

#/usr/local/bin/php


This works fine.

And cgiwrap works fine. I can call other scripts as intended - e.g. I can 
call this script

#!/bin/sh
echo "Content-type: text/html\n\n"
ls /

or Perl

#!/usr/bin/perl
print("Content-type: text/html\n\n");
print("Hello, World!");

as http://www.myname.com/cgi-bin/cgiwrapd/frank/myscript2.cgi

So everything as expected.

But with PHP something very strange happen: The above script 
"myscript1.php" seems to output the cgi-wrap's code when I load it in the 
browser as

http://www.myname.com/cgi-bin/cgiwrapd/frank/myscript1.cgi

and not info about PHP.

Why is that?  Since scripts with #!/bin/sh worked I have even tried to call 
php from such a script and output the result to a file:

#/bin/sh
/usr/local/bin/php /somepath/testphp.php > /somepath/testphp.htm
ls /

Same result.  testphp.htm contains nice phpinfo when the script is called 
from the command line - and lots of binary code when the script called by 
cgiwrap. But the result of "ls /" reaches the browser correctly!

What is special about PHP in combination with cgiwrap here? What can 
cgiwrap "do" to php to make it output unintended code where sh and Perl 
behaves normally? Is something missing in the environment when called from 
cgiwrap? If so what?

I am completely clueless, despite spending 10 hours on the problem.

Oh. and one more thing: When PHP is compiled wrongly for this purpose - 
like with "--enable-force-cgi-redirect" - then there's suddenly nothing 
strange - the script correctly outputs an error-message from PHP, also when 
called over cgiwrap!

If anyone can point me in the right direction or suggest some good things 
to try I'd me more than grateful - I'd be impressed! :-)

Best regards

Frank


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




[PHP] Re: scheduler algorithm

2007-02-02 Thread frank
hmmm, a month period has 4*7 days e.g. then i can schedule on 31.3.07 a
month  period which will repeat itself on 30.4.07 and again on 30.5.07 even
though may has 31 days. i dont see no other logic if you take a week period
it same a week has always 7 days. how else would it make sense. the start
date += the period

fra*



""bruce"" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> hi...
>
> i'm creating a quick/dirty app for scheduling a function, based on the
user
> entering a start time/date, as well as a potential periodic timeframe.
>
> ie:
>  the user enters-
>   start time/date: 10:00am 01/10/07
> periodic monthly
>
> the idea is to be able to have a process start running on the start
> time/date, and then to repeat on a monthly basis on the same time/date. i
> can easily accomplish this for dates that are '1-28', but i'm looking for
> suggestions as to how to handle situations where the number of the start
> date, might be greater than the end date of the 'current" month.
>
> in searching google, i haven't come up with many apps that handle this...
>
> thoughts/comments/etc...
>
> thanks.
>
> -bruce

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



Re: [PHP] Graphs

2007-02-02 Thread frank
yes it does a great job, almost every parameter even for the legend can be
influenced by its methods and properties. i say jp graph is the best

fra*

>
> JP Graph is always mentioned in this list.
>
> I generally just do GD directly, to get things laid out the way I
> want, instead of sort of kind of not really the way I want.
>
> YMMV
>
> -- 
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some starving 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] Re: Help with matching numbers 0-100

2007-02-03 Thread frank
better make a switch statement: with case such as
switch($x):
case ($x >= 16 && $x <= 30):

break;
case 

set*


""Chilling Lounge Admin"" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> Hi.
>
> I need help with matching a variable. The variable would be e.g. 0-15
> , 16-30 etc. and when the variable is equal to a certain range, it
> would echo an image.
>
> Does anyone know what function I should use? preg_match?
>
> The code would be something like
>
> if(preg_match("[16-30]",$variable))
> {
> echo "image";
> }
>
> but the above code doesn't work. How do I fix it?
>
> Thanx

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



[PHP] displaying directory last modify

2004-03-29 Thread frank
Hello there, I have been trying to mke a simple script to basically out 
the last date the dir was modified. Like when you do ls -l next to the 
folder you can see the date of last modfied.

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


[PHP] logs(querystring) in php4 or apache?

2002-11-23 Thread Frank Wang
Hi,

In a html i use a form to post data to a php file in a Apache server. I'd
like to take a look at the raw data submitted from the web browser to the
php, where can i find this info? the access.log in Apache does not contain
this info. thanks.

Frank



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




[PHP] Help with the PHP

2002-11-28 Thread Ted Frank
Hello,

I am trying to make my free home page and my friend told me to download the 
php because it is for the web and i want to make a web page. so i downloaded 
the php with the flash plugin and i put it on my desktop and nothing showed 
up - i just want to make the free home page but the php does not work - i 
double click and noting happens

i have the windows 95 with internet exploerer with a pentium 100 drive

what do i do?

Ted

_
Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail


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



[PHP] Question about $_GET

2003-01-15 Thread Frank Keessen
Hi All,

Can you please help me with the following problem? I've had code wich was running fine 
with php till i've upgraded to PHP version 4.2.3.

The original code line was:

$query = "SELECT Newsheadline, News, Contact FROM news WHERE Newsid = '$id'";

but it's not working when you have register_globals=Off
So i've read everywhere to use the $_Get:

So the code looks like this:

$query = "SELECT Newsheadline, News, Contact FROM news WHERE Newsid = $_GET['id']";

But all i'm getting in my browser is:

parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' 


Can someone please help?

Thanks and regards,

Frank



Re: [PHP] Question about $_GET

2003-01-15 Thread Frank Keessen
Thanks, but not working:

The error message:
Error in query: SELECT Newsheadline, News, Contact FROM news WHERE Newsid =
. You have an error in your SQL syntax near '' at line 1

Here are both lines:

$query = "SELECT Newsheadline, News, Contact FROM news WHERE Newsid =
{$_GET['id']}";


 $result = mysql_query($query) or die ("Error in query: $query. " .
mysql_error());

Regards,

Frank
- Original Message -
From: "Danny Shepherd" <[EMAIL PROTECTED]>
To: "Frank Keessen" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, January 15, 2003 11:54 AM
Subject: Re: [PHP] Question about $_GET


> Try
>
> $query = "SELECT Newsheadline, News, Contact FROM news WHERE Newsid =
> {$_GET['id']}";
>
> HTH
>
> Danny.
> - Original Message -
> From: "Frank Keessen" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, January 15, 2003 10:50 AM
> Subject: [PHP] Question about $_GET
>
>
> Hi All,
>
> Can you please help me with the following problem? I've had code wich was
> running fine with php till i've upgraded to PHP version 4.2.3.
>
> The original code line was:
>
> $query = "SELECT Newsheadline, News, Contact FROM news WHERE Newsid =
> '$id'";
>
> but it's not working when you have register_globals=Off
> So i've read everywhere to use the $_Get:
>
> So the code looks like this:
>
> $query = "SELECT Newsheadline, News, Contact FROM news WHERE Newsid =
> $_GET['id']";
>
> But all i'm getting in my browser is:
>
> parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING'
>
>
> Can someone please help?
>
> Thanks and regards,
>
> Frank
>
>
> --
> 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] Question about $_GET

2003-01-15 Thread Frank Keessen
Hi,

Thanks for the great help! It's working now!

The solution:

$query = "SELECT Newsheadline, News, Contact FROM news WHERE Newsid =
{$_GET['id']}";


Regards,

Frank
- Original Message -
From: "Rick Emery" <[EMAIL PROTECTED]>
To: "Frank Keessen" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, January 15, 2003 1:22 PM
Subject: Re: [PHP] Question about $_GET


> Make life easy for yourself:
>
> $query = "SELECT Newsheadline, News, Contact FROM news WHERE Newsid =
".$_GET['id'];
> - Original Message -
> From: "Frank Keessen" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, January 15, 2003 4:50 AM
> Subject: [PHP] Question about $_GET
>
>
> Hi All,
>
> Can you please help me with the following problem? I've had code wich was
running fine with php till
> i've upgraded to PHP version 4.2.3.
>
> The original code line was:
>
> $query = "SELECT Newsheadline, News, Contact FROM news WHERE Newsid =
'$id'";
>
> but it's not working when you have register_globals=Off
> So i've read everywhere to use the $_Get:
>
> So the code looks like this:
>
> $query = "SELECT Newsheadline, News, Contact FROM news WHERE Newsid =
$_GET['id']";
>
> But all i'm getting in my browser is:
>
> parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING'
>
>
> Can someone please help?
>
> Thanks and regards,
>
> Frank
>
>
>
> --
> 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] If... Else.. I'm not getting it!

2003-01-25 Thread Frank Keessen
Hi all,

Please can you help me with the following:

If got a little sample code:

This one is working (!):




Input yourname





But when i'm using IF Else.. Nothing is happening. I'm only seeing the form but when i 
submit that form: The $vname doen't display..

Here is the code that doesn't work:




Input yourname





What am I doing wrong???

Thanks,

Frank




Re: [PHP] If... Else.. I'm not getting it!

2003-01-25 Thread Frank Keessen
Hi,

The register_globals = Off. Dit the basic echo ($submit) but it displays
nothing..

Any thoughts somebody??

Thanks for helping me out on this cloudy saturday (in Amsterdam!)

Regards,

Frank

- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, January 25, 2003 11:36 AM
Subject: Re: [PHP] If... Else.. I'm not getting it!


> On Saturday 25 January 2003 18:27, Frank Keessen wrote:
>
> > But when i'm using IF Else.. Nothing is happening. I'm only seeing the
form
> > but when i submit that form: The $vname doen't display..
> >
> > Here is the code that doesn't work:
> >
> >  > $vname=$_POST['vname'];
> > if($submit) {
>
> Try some basic debugging techniques like echo ($submit). You'll see
nothing,
> hence that IF clause fails.
>
> If register_globals is not enabled then you need to use $_POST['submit']
(just
> as you had to use $_POST['vname']).
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Confidence is simply that quiet, assured feeling you have before you
> fall flat on your face.
> -- Dr. L. Binder
> */
>
>
> --
> 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] If... Else.. I'm not getting it!

2003-01-25 Thread Frank Keessen
Hi,

Thanks, but i'm a kind of a newbie in PHP and what i've read it's better to
have the register_globals = Off!!! If you look at my code you see that i'm
using the $_GET variable.. This works fine!! It's the IF.. ELSE what gives
me a lot of trouble!

Frank

- Original Message -
From: "Johannes Schlueter" <[EMAIL PROTECTED]>
To: "Frank Keessen" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, January 25, 2003 12:25 PM
Subject: Re: [PHP] If... Else.. I'm not getting it!


Hi,

On Saturday 25 January 2003 12:18, Frank Keessen wrote:
> The register_globals = Off. Dit the basic echo ($submit) but it displays
> nothing..
>
> Any thoughts somebody??

Switch on register_globals or (better!) use $_GET['submit'],
$_POST['submit']
or $_REQUEST['submit'].

> Thanks for helping me out on this cloudy saturday (in Amsterdam!)

johannes

--
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] If... Else.. I'm not getting it!

2003-01-25 Thread Frank Keessen
Wow!! It worked... Sorry for the confusion about the get!!

Thanks guys, i can go further!!! Have a nice weekend!

Regards,

Frank
- Original Message -
From: "Rich Gray" <[EMAIL PROTECTED]>
To: "Frank Keessen" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, January 25, 2003 12:42 PM
Subject: RE: [PHP] If... Else.. I'm not getting it!


> You are using the post method not get so $_GET[] should be empty.
>
> Does this version of your code work?
>
>  if(isset($_POST['submit'])) {
> $vname=$_POST['vname'];
> echo "hello $vname";
> } else {
> ?>
> 
> 
> Input yourname
> 
> 
> 
>  }
> ?>
>
> Rich
> -Original Message-
> From: Frank Keessen [mailto:[EMAIL PROTECTED]]
> Sent: 25 January 2003 11:33
> To: Johannes Schlueter; [EMAIL PROTECTED]
> Subject: Re: [PHP] If... Else.. I'm not getting it!
>
>
> Hi,
>
> Thanks, but i'm a kind of a newbie in PHP and what i've read it's better
to
> have the register_globals = Off!!! If you look at my code you see that i'm
> using the $_GET variable.. This works fine!! It's the IF.. ELSE what gives
> me a lot of trouble!
>
> Frank
>
>
> --
> 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] Dynamic input fields in Form

2003-02-07 Thread Frank Keessen
Hi,

Thanks for the answer; but there is nobody who can show me an example in
code???

Regards,

Frank
- Original Message -
From: "Jon Haworth" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, February 07, 2003 1:45 PM
Subject: RE: [PHP] Dynamic input fields in Form


> Hi Frank,
>
> > I have a form where the user selects for example; how many cars
> > you have:  4. Then it most dynamicly create 4 input fields
> [...]
>
> Using only PHP, you'll have to make this a two-step process where page 1
> collects the number of cars and posts to page 2, which generates the form
> accordingly.
>
> If is has to be done on the same page, you'll need to call a Javascript
> function every time the number of cars changes. That function will have to
> add or remove s from the form depending on the number  of cars
> entered, and of course the whole page will break completely for anyone
> without Javascript.
>
> I'd make it a two-step process myself, it's considerably more robust and
> offers considerably less room for problems (what happens if I claim I have
> five cars, fill out their details, and then change it to three cars? which
> details do you get rid of?)
>
> Cheers
> Jon
>
> --
> 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] Dynamic input fields in Form

2003-02-08 Thread Frank Keessen
Hi,

Thanks guys for helping me out!

Regards,

Frank
 Original Message -
From: "1LT John W. Holmes" <[EMAIL PROTECTED]>
To: "Frank Keessen" <[EMAIL PROTECTED]>; "Jon Haworth"
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, February 07, 2003 9:23 PM
Subject: Re: [PHP] Dynamic input fields in Form


> > Thanks for the answer; but there is nobody who can show me an example in
> > code???
>
> You mean do the work for you? Do you want the PHP or Javascript solution?
> Only one can be posted on this list...
>
No you don't have to do the coding for me

> The PHP one is simple. Assuming $_POST['num'] is the number from your drop
> down...
>
> for($x=0;$x<$_POST['num'];$x++)
> { echo ''; }
>
> That's it.
>
> ---John Holmes...
>
> > > > I have a form where the user selects for example; how many cars
> > > > you have:  4. Then it most dynamicly create 4 input fields
> > > [...]
> > >
> > > Using only PHP, you'll have to make this a two-step process where page
1
> > > collects the number of cars and posts to page 2, which generates the
> form
> > > accordingly.
> > >
> > > If is has to be done on the same page, you'll need to call a
Javascript
> > > function every time the number of cars changes. That function will
have
> to
> > > add or remove s from the form depending on the number  of cars
> > > entered, and of course the whole page will break completely for anyone
> > > without Javascript.
> > >
> > > I'd make it a two-step process myself, it's considerably more robust
and
> > > offers considerably less room for problems (what happens if I claim I
> have
> > > five cars, fill out their details, and then change it to three cars?
> which
> > > details do you get rid of?)
> > >
> > > Cheers
> > > Jon
> > >
> > > --
> > > 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] $_SESSIONS and printing off..

2003-02-18 Thread Frank Keessen
Hi All,

I'm a little bit confused and it's maybe a newbie question but maybe you can help me 
out;

A user is login in and after username password check it will redirects to this page



Question is; is this the way to print of his username?

$username = $_SESSION['username'];
Echo $username

Or has anyone some alternatives..

This is working o.k. but in my opinion it's a little bit quick and dirty?

Thanks for the comments and suggestions!

Frank


Re: [PHP] $_SESSIONS and printing off..

2003-02-18 Thread Frank Keessen
Thanks,

But then another question;

 if (isset($_SESSION['username']) && !empty($_SESSION['username'])) {
> echo 'Welcome '.$_SESSION['username'].', you are still logged in.';


I want also checked if the level of authentication = 2; for example
User Frank = level 1
User Rich = level 2

I've set $_SESSION['level'] to 2 but how can i check that with the above
line?

Thanks for your help,

Frank

- Original Message -
From: "Rich Gray" <[EMAIL PROTECTED]>
To: "Frank Keessen" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, February 18, 2003 11:53 AM
Subject: RE: [PHP] $_SESSIONS and printing off..


> Er... well I've seen a lot worse code than that but maybe you could use
...
>
> if (isset($_SESSION['username']) && !empty($_SESSION['username'])) {
> echo 'Welcome '.$_SESSION['username'].', you are still logged in.';
> }
> else {
> header... etc etc
> }
>
> Rich
> > -Original Message-
> > From: Frank Keessen [mailto:[EMAIL PROTECTED]]
> > Sent: 18 February 2003 09:00
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] $_SESSIONS and printing off..
> >
> >
> > Hi All,
> >
> > I'm a little bit confused and it's maybe a newbie question but
> > maybe you can help me out;
> >
> > A user is login in and after username password check it will
> > redirects to this page
> >
> >  > session_start();
> > if (isset($_SESSION['username'])){
> > $username = $_SESSION['username'];
> > echo 'Welcome, you are still loged in.';
> > echo $username;
> > }
> > else{
> > header ( "Location: login.htm" );
> > }
> > ?>
> >
> > Question is; is this the way to print of his username?
> >
> > $username = $_SESSION['username'];
> > Echo $username
> >
> > Or has anyone some alternatives..
> >
> > This is working o.k. but in my opinion it's a little bit quick and
dirty?
> >
> > Thanks for the comments and suggestions!
> >
> > Frank
>
> --
> 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] $_SESSIONS and printing off..

2003-02-18 Thread Frank Keessen
Uh, sorry for the bad explanation Rich.. Again;



This is working fine. But i've set $_SESSION['level'] to value 2 (that's
done in the php file that calls this one). Now i want the above code to
check for the level and if is not equal to two than go to the else (back to
login.htm) statement..

better explained??? ;>

Thanks,

Frank

- Original Message -
From: "Rich Gray" <[EMAIL PROTECTED]>
To: "Frank Keessen" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, February 18, 2003 1:25 PM
Subject: RE: [PHP] $_SESSIONS and printing off..


> Um... how about...
>
> echo 'Welcome '.$_SESSION['username'].', you are still logged in and your
> authentication level is '.(isset($_SESSION['level']) ? $_SESSION['level']
:
> 'unknown');
>
> Or am I missing something here?
>
> Rich
>
> > -Original Message-
> > From: Frank Keessen [mailto:[EMAIL PROTECTED]]
> > Sent: 18 February 2003 12:15
> > To: Rich Gray; [EMAIL PROTECTED]
> > Subject: Re: [PHP] $_SESSIONS and printing off..
> >
> >
> > Thanks,
> >
> > But then another question;
> >
> >  if (isset($_SESSION['username']) && !empty($_SESSION['username'])) {
> > > echo 'Welcome '.$_SESSION['username'].', you are still logged in.';
> >
> >
> > I want also checked if the level of authentication = 2; for example
> > User Frank = level 1
> > User Rich = level 2
> >
> > I've set $_SESSION['level'] to 2 but how can i check that with the above
> > line?
> >
> > Thanks for your help,
> >
> > Frank
>
>
> --
> 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] Forms and MySql date

2003-02-20 Thread Frank Keessen
Hi,

You can let the users enter a date as 20-02-2003 into a textfield with the
name $userdate

Then you can use this function to convert it;

$date_array = split("-", $userdate);
$mysqldate = $date_array[2]."-".$date_array[1]."-".$date_array[0];

Store $mysqldate into the database!

Regards,

Frank



- Original Message -
From: "Philip Hallstrom" <[EMAIL PROTECTED]>
To: "Mike Tuller" <[EMAIL PROTECTED]>
Cc: "php mailing list list" <[EMAIL PROTECTED]>
Sent: Thursday, February 20, 2003 11:48 PM
Subject: [PHP] Re: Forms and MySql date


> You could use the TO_DATE function to convert that text string into a
> date, or reformat it in PHP to -mm-dd which mysql will take
> automatically (at least I think so)
>
> On Thu, 20 Feb 2003, Mike Tuller wrote:
>
> > I have a form that I want to enter a date into a MySql database. I
> > currently have the column in the database set as Date, and can't seem
> > to get the date I enter into the text field to go into the database
> > using the format yymmdd. I could change the column to varchar, and then
> > it would enter, but this will be a database that I want to keep track
> > of purchases, and if it is entered in as text, I wouldn't be able to do
> > calculations such as showing how old something is.
> >
> > How can I have a text field where a person enters the date and have
> > that information entered into the database?
> >
> > Mike
> >
> >
> > --
> > 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Random not working?

2003-03-01 Thread Frank Keessen
Hi All,

I'm trying to get a random record each time this script runs; Only it's giving me 
everytime the first record back.. No random at all..

// generate and execute query
$query = "SELECT stedenid, naamstad, stadomschrijvk FROM steden ORDER BY RAND() LIMIT 
1";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
$row = mysql_fetch_object($result);
echo $row->naamstad;


Version info;

PHP 4.3.1
Mysql 3.23.54 

When i'm trying to excute the SELECT statement in phpmyadmin; i'm only getting the 
first record back and when i'm taking off the LIMIT 1 it will display all the records 
in ascending order so also not in random..


Regards,

Frank







[PHP] Re: [PHP-DB] RE: [PHP] Random not working?

2003-03-01 Thread Frank Keessen
Thanks guys for the info; I will speak to my ISP!

Have a nice weekend!

Regards,

Frank
- Original Message -
From: "Rich Gray" <[EMAIL PROTECTED]>
To: "Frank Keessen" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Sunday, March 02, 2003 2:36 AM
Subject: [PHP-DB] RE: [PHP] Random not working?


> > Hi All,
> >
> > I'm trying to get a random record each time this script runs;
> > Only it's giving me everytime the first record back.. No random at all..
> >
> > // generate and execute query
> > $query = "SELECT stedenid, naamstad, stadomschrijvk FROM steden
> > ORDER BY RAND() LIMIT 1";
> > $result = mysql_query($query) or die ("Error in query: $query. "
> > . mysql_error());
> > $row = mysql_fetch_object($result);
> > echo $row->naamstad;
> >
> >
> > Version info;
> >
> > PHP 4.3.1
> > Mysql 3.23.54
> >
> > When i'm trying to excute the SELECT statement in phpmyadmin; i'm
> > only getting the first record back and when i'm taking off the
> > LIMIT 1 it will display all the records in ascending order so
> > also not in random..
> >
> >
> > Regards,
> >
> > Frank
>
>
> Frank
>
> This really belongs on the MySQL list but there was a known issue with
> RAND() on 3.23.54 - can you upgrade? If your table has an auto_increment
ID
> column then a workaround would be to use rand() in PHP to generate a
random
> ID then use that with a 'where id = '.$id in your query...
>
> HTH
> Rich
>
>
> --
> PHP Database 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] Configure with register_globals on

2003-03-08 Thread Frank Keessen
Hi Mike,

I've googled something for you!

http://www.entropy.ch/software/macosx/php/#install

Everything about PHP and running it on the MAC OS X..

Regards,

Frank
- Original Message - 
From: "Mike Tuller" <[EMAIL PROTECTED]>
To: "php mailing list list" <[EMAIL PROTECTED]>
Sent: Friday, March 07, 2003 5:49 PM
Subject: [PHP] Configure with register_globals on


> I am running OS X 10.2 and am trying to work with PHP and Adobe GoLive. 
> GoLive tells me that I don't have PHP running, which I do, and on 
> Adobe's site someone said that register_globals needs to be on. I know 
> that this is not something that should be done, but I want to see if 
> this is the problem with GoLive saying PHP is not installed. I don't 
> have a php.ini file to change the values for register_globals to be on, 
> so what do I need to add when I run configure to have register_globals 
> turned on?
> 
> Thanks,
> Mike
> 
> 
> -- 
> 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] html mail

2003-03-10 Thread Frank Keessen
Hi,

I found this one and it's quite handy;

http://phpmailer.sourceforge.net/

Regards,

Frank
- Original Message -
From: "Ian A. Gray" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 10, 2003 2:47 PM
Subject: [PHP] html mail


> Hi,
> I am quite new to php and I am trying to find a way of
> sending details of a web form over e-mail in both text
> and html format.  There are numerous sites on the web
> that try and explain how to do this but they are
> worded very complicated and to be honest I haven't
> found one that is particularly good.
>
> I want to send an e-mail that contains html code, with
> the option of attatching images and other files as
> well as a text version of the email so that the viewer
> can read the same e-mail whether or not he can view
> html email or not.
>
> Any ideas?
>
> Ian Gray.
>
> =
>
> -
> Ian A. Gray
> Manchester, UK
> Telephone: +44 (0) 161 224 1635 - Fax: +44 (0) 870 135 0061 - Mobile: +44
(0) 7900 996 328
> US Fax no.:  707-885-3582
> E-mail: [EMAIL PROTECTED] - Websites: www.baritone.uk.com
(performance) & www.vocalstudio.co.uk (Tuition)
> -
>
>
> __
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
> http://uk.my.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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



Re: [PHP] Mailing list server with PHP frontend

2003-07-11 Thread Frank Keessen
Hi,

Maybe is this what you want;

http://www.eternalmart.com/

Regards,

Frank
- Original Message - 
From: "Juan Nin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, July 12, 2003 1:47 AM
Subject: [PHP] Mailing list server with PHP frontend


> Hi!
> I want to know if anyone knows about a good mailing list manager that has
> got a PHP administration frontend
>
> I've found many PHP scripts for sending newsletters and announcementes,
but
> that's it's not what I want
> I want a system like Mailman, Sympa or Majordomo (the mailing list server
> may be programmed in Perl or whatever), but it must provide a PHP frontend
> for administration, subscription, etc
>
> It would be great if messages are stored in a database like MySQL and it
> must be free software
> Does this exist??
>
> Thanks in advanced,
>
> Juan
>
>
> -- 
> 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] Array transform date and put in a session

2003-07-29 Thread Frank Keessen
Hi All,

Can you please help me with the following:

I've got a form with a field called datebirth[];

After submitting the form; it must put the datebirth field (or fields) into the mysql 
format -mm-dd and after that put it in a session:

$date_array = split("-", $_POST['datebirth']);
$mysqldate = $date_array[2]."-".$date_array[1]."-".$date_array[0];
$_SESSION['datebirth'] = array();
$_SESSION['datebirth'] = $mysqldate;

This is my code till now but i'm stuck (when proccesing it i'm only getting Array... 
as output).. Can someone help me?

Regards,

Frank


Re: [PHP] Array transform date and put in a session

2003-07-29 Thread Frank Keessen
Hi David,

Thanks for your reply... This makes no sense;

According to the rest of your code, it should be called datebirth,
not datebirth[].

Let me put in the whole code








>

 




  


People number 
Date of birth
"; ?>








Regards,

Frank


From: "David Nicholson" <[EMAIL PROTECTED]>
To: "Frank Keessen" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, July 29, 2003 11:02 PM
Subject: Re: [PHP] Array transform date and put in a session


Hello,

This is a reply to an e-mail that you wrote on Tue, 29 Jul 2003 at
21:42, lines prefixed by '>' were originally written by you.
> Hi All,
> Can you please help me with the following:
> I've got a form with a field called datebirth[];

According to the rest of your code, it should be called datebirth,
not datebirth[].

> After submitting the form; it must put the datebirth field (or
fields)
> into the mysql format -mm-dd and after that put it in a
session:
> $date_array = split("-", $_POST['datebirth']);
> $mysqldate =
$date_array[2]."-".$date_array[1]."-".$date_array[0];
> $_SESSION['datebirth'] = array();
> $_SESSION['datebirth'] = $mysqldate;
> This is my code till now but i'm stuck (when proccesing it i'm
only
> getting Array... as output).. Can someone help me?


-- 
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

  Professional Web Development by David Nicholson
http://www.djnicholson.com/

QuizSender.com - How well do your friends actually know you?
 http://www.quizsender.com/
(developed entirely in PHP)

-- 
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] Problems with post data

2003-04-01 Thread Frank Westerbeke
John,

Thanks for your patience.

I've been trying to get a grip on PHP/MySQL with a book written by Jay
Bulger and Jay Geenspan.
Obviously a wrong choice since your solution is not mentioned in their book.

I will check the manual more often.

Frank
"John W. Holmes" <[EMAIL PROTECTED]> schreef in bericht
news:[EMAIL PROTECTED]
> > Does this bug also applies to passing variables in an URL.
> >
> > I'v noticed  that when the directive register_globals is set to off as
> it
> > is
> > recommended in the php.ini file no variables are passed on to other
> pages.
> > Switching it to on would be the simplest solution, but scripts like
> > phpMyAdmin do not seem to have these problems.
>
> The variables are passed, you just have to reference them as
> $_GET['variable'] or $_POST['variable'], which is also mentioned many
> times in the manual.
>
> ---John W. Holmes...
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
>
>



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



[PHP] Multi Selection

2003-06-04 Thread Frank Keessen
Hi Guys,

I'm trying to do the following:

I've got a multiple selection box build out of a query of table


   0)
 {
  while($row2 = mysql_fetch_object($result2))
  {
?>

Somewhere ; ?>




The outcome is stored in the VALUE[]..

Now i want to have an INSERT query that insert each value seperatly..

So if there are 3 selections it must be repeat the INSERT query three times...


Thanks for the help!


Frank


Re: [PHP] Multi Selection

2003-06-04 Thread Frank Keessen
Jim,

Why does the data have to be reindexed??? I don't understand, can you give
me an explenation?

Thanks,

Frank
- Original Message - 
From: "Jim Lucas" <[EMAIL PROTECTED]>
To: "Frank Keessen" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, June 03, 2003 10:30 PM
Subject: Re: [PHP] Multi Selection


> I would look into doing something like this.
>
> The HTML code that Wouter will work just fine.  My ideas are for the
process
> page.
>
> When you insert data into a table, it has to re-index the table if you
make
> your statement insert all the data at one time it will only re-index the
> table one time.
>
> It goes a little something like this.
>
>  if(isset($_POST['somename'])) {
>   print_r($_POST['somename']);
>
>   echo "";
>
>   foreach($_POST['somename'] AS $k => $v) {
> $values[] = " (NOW(), '{$v}') ";
>   }
>   if(count($values)) {
> $insert_sql = "INSERT INTO table_name (date, myValue) VALUES " .
join("
> VALUES ", $values);
> echo $insert_sql;
>   } else {
> echo "Nothing to insert";
>   }
> }
> ?>
> 
> 
> First Thingie
> Second Thingie
> Third Thingie
> Fourth Thingie
> Fifth Thingie
> 
> 
> 
>
> Give the above script a shot and see if it does what you want it to do.
>
> Jim Lucas
>
> - Original Message -
> From: "Frank Keessen" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, June 03, 2003 11:55 AM
> Subject: [PHP] Multi Selection
>
>
> > Hi Guys,
> >
> > I'm trying to do the following:
> >
> > I've got a multiple selection box build out of a query of table
> >
> > 
> >> $query2 = "SELECT SomethingID, Somewhere FROM Someplace WHERE publiceer
=
> 'yes' ORDER BY somewhere";
> > $result2 = mysql_query($query2) or die ("Error in query: $query2. " .
> mysql_error());
> >
> > if (mysql_num_rows($result2) > 0)
> >  {
> >   while($row2 = mysql_fetch_object($result2))
> >   {
> > ?>
> >
> > Somewhere
> ; ?>
> >  >  }
> > }
> > ?>
> > 
> > 
> >
> > The outcome is stored in the VALUE[]..
> >
> > Now i want to have an INSERT query that insert each value seperatly..
> >
> > So if there are 3 selections it must be repeat the INSERT query three
> times...
> >
> >
> > Thanks for the help!
> >
> >
> > Frank
> >
>
>
> -- 
> 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] Multi Selection

2003-06-04 Thread Frank Keessen
Guys

Just another challenge; i've taken the code of Wouter and as you can see i'm
first passing data to the reis table.. Then i retrieve the ID... But when
you have multiple selection's the trouble starts... The first record is o.k.
but then the second record Get's the ID of the first.. How to avoid this?

Frank

 $Value) {
$query = 'INSERT INTO ra(reisid, accid) VALUES (LAST_INSERT_ID(),
'.$Value.')';
$result = mysql_query($query) or die ("Error in query: $query. " .
mysql_error());
};
} else {
$query = 'INSERT INTO ra(reisid, accid) VALUES (LAST_INSERT_ID(),
'.$_POST['somename'].')';
$result = mysql_query($query) or die ("Error in query: $query. " .
mysql_error());}
}
?>
>


First Thingie
Second Thingie
Third Thingie
Fourth Thingie
Fifth Thingie



- Original Message - 
From: "Frank Keessen" <[EMAIL PROTECTED]>
To: "Jim Lucas" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, June 03, 2003 10:37 PM
Subject: Re: [PHP] Multi Selection


> Jim,
>
> Why does the data have to be reindexed??? I don't understand, can you give
> me an explenation?
>
> Thanks,
>
> Frank
> - Original Message - 
> From: "Jim Lucas" <[EMAIL PROTECTED]>
> To: "Frank Keessen" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Tuesday, June 03, 2003 10:30 PM
> Subject: Re: [PHP] Multi Selection
>
>
> > I would look into doing something like this.
> >
> > The HTML code that Wouter will work just fine.  My ideas are for the
> process
> > page.
> >
> > When you insert data into a table, it has to re-index the table if you
> make
> > your statement insert all the data at one time it will only re-index the
> > table one time.
> >
> > It goes a little something like this.
> >
> >  > if(isset($_POST['somename'])) {
> >   print_r($_POST['somename']);
> >
> >   echo "";
> >
> >   foreach($_POST['somename'] AS $k => $v) {
> > $values[] = " (NOW(), '{$v}') ";
> >   }
> >   if(count($values)) {
> > $insert_sql = "INSERT INTO table_name (date, myValue) VALUES " .
> join("
> > VALUES ", $values);
> > echo $insert_sql;
> >   } else {
> > echo "Nothing to insert";
> >   }
> > }
> > ?>
> > 
> > 
> > First Thingie
> > Second Thingie
> > Third Thingie
> > Fourth Thingie
> > Fifth Thingie
> > 
> > 
> > 
> >
> > Give the above script a shot and see if it does what you want it to do.
> >
> > Jim Lucas
> >
> > - Original Message -
> > From: "Frank Keessen" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Tuesday, June 03, 2003 11:55 AM
> > Subject: [PHP] Multi Selection
> >
> >
> > > Hi Guys,
> > >
> > > I'm trying to do the following:
> > >
> > > I've got a multiple selection box build out of a query of table
> > >
> > > 
> > >> > $query2 = "SELECT SomethingID, Somewhere FROM Someplace WHERE
publiceer
> =
> > 'yes' ORDER BY somewhere";
> > > $result2 = mysql_query($query2) or die ("Error in query: $query2. " .
> > mysql_error());
> > >
> > > if (mysql_num_rows($result2) > 0)
> > >  {
> > >   while($row2 = mysql_fetch_object($result2))
> > >   {
> > > ?>
> > >
> > >  $row2->Somewhere
> > ; ?>
> > >  > >  }
> > > }
> > > ?>
> > > 
> > > 
> > >
> > > The outcome is stored in the VALUE[]..
> > >
> > > Now i want to have an INSERT query that insert each value seperatly..
> > >
> > > So if there are 3 selections it must be repeat the INSERT query three
> > times...
> > >
> > >
> > > Thanks for the help!
> > >
> > >
> > > Frank
> > >
> >
> >
> > -- 
> > 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Multi Selection

2003-06-04 Thread Frank Keessen
Guys

Just another challenge; i've taken the code of Wouter and as you can see i'm
first passing data to the reis table.. Then i retrieve the ID... But when
you have multiple selection's the trouble starts... The first record is o.k.
but then the second record Get's the ID of the first.. How to avoid this?

Frank

 $Value) {
$query = 'INSERT INTO ra(reisid, accid) VALUES (LAST_INSERT_ID(),
'.$Value.')';
$result = mysql_query($query) or die ("Error in query: $query. " .
mysql_error());
};
} else {
$query = 'INSERT INTO ra(reisid, accid) VALUES (LAST_INSERT_ID(),
'.$_POST['somename'].')';
$result = mysql_query($query) or die ("Error in query: $query. " .
mysql_error());}
}
?>
>


First Thingie
Second Thingie
Third Thingie
Fourth Thingie
Fifth Thingie



- Original Message - 
From: "Jim Lucas" <[EMAIL PROTECTED]>
To: "Frank Keessen" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, June 03, 2003 11:05 PM
Subject: Re: [PHP] Multi Selection


> if you are using a mysql data base setup and you have any indecies on the
> table that you are inserting the data into, then MySQL will automatically
> re-index the table each and every time the data in the table is modified.
>
> Jim Lucas
> - Original Message -
> From: "Frank Keessen" <[EMAIL PROTECTED]>
> To: "Jim Lucas" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Tuesday, June 03, 2003 1:37 PM
> Subject: Re: [PHP] Multi Selection
>
>
> > Jim,
> >
> > Why does the data have to be reindexed??? I don't understand, can you
give
> > me an explenation?
> >
> > Thanks,
> >
> > Frank
> > - Original Message -
> > From: "Jim Lucas" <[EMAIL PROTECTED]>
> > To: "Frank Keessen" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> > Sent: Tuesday, June 03, 2003 10:30 PM
> > Subject: Re: [PHP] Multi Selection
> >
> >
> > > I would look into doing something like this.
> > >
> > > The HTML code that Wouter will work just fine.  My ideas are for the
> > process
> > > page.
> > >
> > > When you insert data into a table, it has to re-index the table if you
> > make
> > > your statement insert all the data at one time it will only re-index
the
> > > table one time.
> > >
> > > It goes a little something like this.
> > >
> > >  > > if(isset($_POST['somename'])) {
> > >   print_r($_POST['somename']);
> > >
> > >   echo "";
> > >
> > >   foreach($_POST['somename'] AS $k => $v) {
> > > $values[] = " (NOW(), '{$v}') ";
> > >   }
> > >   if(count($values)) {
> > > $insert_sql = "INSERT INTO table_name (date, myValue) VALUES " .
> > join("
> > > VALUES ", $values);
> > > echo $insert_sql;
> > >   } else {
> > > echo "Nothing to insert";
> > >   }
> > > }
> > > ?>
> > > 
> > > 
> > > First Thingie
> > > Second Thingie
> > > Third Thingie
> > > Fourth Thingie
> > > Fifth Thingie
> > > 
> > > 
> > > 
> > >
> > > Give the above script a shot and see if it does what you want it to
do.
> > >
> > > Jim Lucas
> > >
> > > - Original Message -
> > > From: "Frank Keessen" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Tuesday, June 03, 2003 11:55 AM
> > > Subject: [PHP] Multi Selection
> > >
> > >
> > > > Hi Guys,
> > > >
> > > > I'm trying to do the following:
> > > >
> > > > I've got a multiple selection box build out of a query of table
> > > >
> > > > 
> > > >> > > $query2 = "SELECT SomethingID, Somewhere FROM Someplace WHERE
> publiceer
> > =
> > > 'yes' ORDER BY somewhere";
> > > > $result2 = mysql_query($query2) or die ("Error in query: $query2. "
.
> > > mysql_error());
> > > >
> > > > if (mysql_num_rows($result2) > 0)
> > > >  {
> > > >   while($row2 = mysql_fetch_object($result2))
> > > >   {
> > > > ?>
> > > >
> > > >  > $row2->Somewhere
> > > ; ?>
> > > >  > > >  }
> > > > }
> > > > ?>
> > > > 
> > > > 
> > > >
> > > > The outcome is stored in the VALUE[]..
> > > >
> > > > Now i want to have an INSERT query that insert each value
seperatly..
> > > >
> > > > So if there are 3 selections it must be repeat the INSERT query
three
> > > times...
> > > >
> > > >
> > > > Thanks for the help!
> > > >
> > > >
> > > > Frank
> > > >
> > >
> > >
> > > --
> > > 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 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] Checkboxes and put value in db

2003-06-08 Thread Frank Keessen
Hi,

Maybe you can help me with the following: I have a list of visitors that want some 
documentation.. I'm displaying a list with a checkbox so i can check the one's that 
received the documentation. So what is must do; it must update a table called 
prospects and set the value of a field called prbrochverst to 1 .
Only problem it doesn't work; can you have a look?


// includes
include("../../conf/config.php");
include("../../conf/functions.php");

// open database connection
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");

// select database
mysql_select_db($db) or die ("Unable to select database!");

// generate and execute query
$query = "SELECT prospectid, praanhef, prvoorletter, prtussenv, prnaam, pradres, 
prhuisnummer, prpostcode1, prpostcode2, prplaats, premail, printresse, prbrochure, 
prdatumaanv, prbrochverst FROM prospects WHERE prbrochverst = ' ' ORDER BY 
prdatumaanv";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());

$_REQUEST["submit"]=isset($_REQUEST["submit"])?$_REQUEST["submit"]:"";
if($_REQUEST['submit']!="")
{
$idlist=$_POST['idlist'];
$sep=$_POST['sep'];
echo $idlist;
$array_id = explode(",", "$idlist");
foreach($array_id as $id){
if(${"id" . $id} == 1){
$query2 = "UPDATE prospects SET prbrochverst = '1'";
  $result2 = mysql_query($query2) or die ("Error in query: $query. " . mysql_error());
}
}
// close connection
mysql_close($connection);
}
?>
>
 0)
{
 // iterate through resultset
 // print title with links to edit and delete scripts
 while($row = mysql_fetch_object($result))
 {
 ?>
 prdatumaanv); ?>
 
 praanhef . " " . $row->prtussenv . " " . $row->prnaam;  
?>
 pradres . " " . $row->prhuisnummer; ?>
 prpostcode1 . " " . $row->prpostcode2 . "  " . $row->prplaats; 
?>
 premail; ?>
 printresse; ?>
prospectid;
echo "prospectid . "\" value=\"1\">";
$idlist .= $sep . $row->prospectid;
$sep = ",";

 }
}
// if no records present
// display message
else
{
?>
 Geen Prospects aanwezig
";
?>



Thanks,

Frank


Re: [PHP] Good Hosting company

2003-06-09 Thread Frank Keessen
Hi,

you can go to www.3shost.com very cheap and very good! My collegue's have
their website running their.. Due to some specific settng's i'm hosting in
the Netherlands..

Regards,

Frank
- Original Message - 
From: "Awlad Hussain" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 09, 2003 11:10 AM
Subject: [PHP] Good Hosting company


anyone knows any good cheap hosting company in UK/US?? with good support.

Many thanks

awlad

___

Sheridan Phoenix Company
The Business Centre  Kimpton Road  Luton  Bedfordshire  LU2 0LB

Email:  [EMAIL PROTECTED]
Phone:  01582 522 330
Fax:01582 522 328
___

This electronic transmission is strictly confidential and intended
solely for the addressee.  If you are not the intended addressee, you
must not disclose, copy or take any action in reliance of this
transmission.  If you have received this transmission in error it would
be helpful if you could notify The Sheridan Phoenix Company Ltd as soon
as possible.

Any views expressed in this message are those of the individual sender,
except where the sender specifically states them to be the views of The
Sheridan Phoenix Company Ltd.




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



[PHP] Session not working?

2003-06-09 Thread Frank Keessen
Hi,

I'm I missing something? I'm trying to get data into a session (booking.php) and then 
print it off by a second page (test3.php).

booking.php:

$_REQUEST["submit"]=isset($_REQUEST["submit"])?$_REQUEST["submit"]:"";
if($_REQUEST['submit']!="")
{
$dater=$_POST['$dater'];
$aantalvol=$_POST['$aantalvol'];
$aantalkind=$_POST['$aantalkind'];
$aantalvol=addslashes($_POST['aantalvol']);

session_start();
$_SESSION['dater'] = $dater;
$_SESSION['aantalvol'] = $aantalvol;
$_SESSION['aantalkind'] = $aantalkind;
$_SESSION['1pk'] = $eenpk;
$_SESSION['2pk'] = $tweepk;

header( "Location: test3.php" );
}

test3.php



I get page not be displayed...

Even with the full URL in the HEADER section it doesn't work..

Some one can help me please?

Txs,

Frank


Re: [PHP] Session not working?

2003-06-09 Thread Frank Keessen
Hi,

It's pointing towards the booking.php

(which is the 'sender' page..)

Exact error message: The Page cannot be displayed..

So it's no 404.. I think..

Frank
- Original Message - 
From: "Emma Jane Hogbin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 09, 2003 8:10 PM
Subject: Re: [PHP] Session not working?


> On Mon, Jun 09, 2003 at 08:08:18PM +0200, Frank Keessen wrote:
> > I get page not be displayed...
> > Even with the full URL in the HEADER section it doesn't work..
>
> What's the URL of the page it's trying to find? i.e. what does the
> location bar on your browser say? Is it the right URL, or is it looking in
> the wrong directory for test3.php?
>
> emma
>
> -- 
> Emma Jane Hogbin
> [[ 416 417 2868 ][ www.xtrinsic.com ]]
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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



Re: [PHP] Session not working?

2003-06-09 Thread Frank Keessen
Hi,

The orignal code was in the first mail; again;

$_REQUEST["submit"]=isset($_REQUEST["submit"])?$_REQUEST["submit"]:"";
if($_REQUEST['submit']!="")
{
$dater=$_POST['$dater'];
$aantalvol=$_POST['$aantalvol'];
$aantalkind=$_POST['$aantalkind'];
$aantalvol=addslashes($_POST['aantalvol']);

session_start();
$_SESSION['dater'] = $dater;
$_SESSION['aantalvol'] = $aantalvol;
$_SESSION['aantalkind'] = $aantalkind;
$_SESSION['1pk'] = $eenpk;
$_SESSION['2pk'] = $tweepk;

header( "Location: test3.php" );
}



test3.php



Txs for the help,

Frank
- Original Message - 
From: "Emma Jane Hogbin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 09, 2003 8:49 PM
Subject: Re: [PHP] Session not working?


> On Mon, Jun 09, 2003 at 08:18:10PM +0200, Frank Keessen wrote:
> > It's pointing towards the booking.php
> > (which is the 'sender' page..)
> > Exact error message: The Page cannot be displayed..
> > So it's no 404.. I think..
> 
> Ah. So it's not even moving off the original page... I don't have your
> original script and it's not in the archives yet; however, are you using
> the right syntax for the header function?
> 
> header("Location: http://www.example.com/";);
> 
> Note that the Location must be uppercase L.
> 
> -- 
> Emma Jane Hogbin
> [[ 416 417 2868 ][ www.xtrinsic.com ]]
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

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



Re: [PHP] Session not working?

2003-06-09 Thread Frank Keessen
Hi,

The original code:

- Original Message - 
From: "Emma Jane Hogbin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 09, 2003 8:49 PM
Subject: Re: [PHP] Session not working?


> On Mon, Jun 09, 2003 at 08:18:10PM +0200, Frank Keessen wrote:
> > It's pointing towards the booking.php
> > (which is the 'sender' page..)
> > Exact error message: The Page cannot be displayed..
> > So it's no 404.. I think..
> 
> Ah. So it's not even moving off the original page... I don't have your
> original script and it's not in the archives yet; however, are you using
> the right syntax for the header function?
> 
> header("Location: http://www.example.com/";);
> 
> Note that the Location must be uppercase L.
> 
> -- 
> Emma Jane Hogbin
> [[ 416 417 2868 ][ www.xtrinsic.com ]]
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

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



Re: [PHP] Session not working?

2003-06-09 Thread Frank Keessen
Dear all,

Fixed it!

Typed again the Header syntax and it worked!

Also installed Mozilla!

Thanks for the help!

Frank
- Original Message - 
From: "Frank Keessen" <[EMAIL PROTECTED]>
To: "Emma Jane Hogbin" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, June 09, 2003 8:59 PM
Subject: Re: [PHP] Session not working?


> Hi,
>
> The original code:
>
> - Original Message - 
> From: "Emma Jane Hogbin" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, June 09, 2003 8:49 PM
> Subject: Re: [PHP] Session not working?
>
>
> > On Mon, Jun 09, 2003 at 08:18:10PM +0200, Frank Keessen wrote:
> > > It's pointing towards the booking.php
> > > (which is the 'sender' page..)
> > > Exact error message: The Page cannot be displayed..
> > > So it's no 404.. I think..
> >
> > Ah. So it's not even moving off the original page... I don't have your
> > original script and it's not in the archives yet; however, are you using
> > the right syntax for the header function?
> >
> > header("Location: http://www.example.com/";);
> >
> > Note that the Location must be uppercase L.
> >
> > -- 
> > Emma Jane Hogbin
> > [[ 416 417 2868 ][ www.xtrinsic.com ]]
> >
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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



[PHP] Array and $_POST value's HELP!

2003-06-10 Thread Frank Keessen
Hello everyone,

I've got the following problem: I've got two fields called test1[] and test2[]. The 
value's are stored in an array. For the test1 i can read the array and print the list 
of value's after the submit. But question is:

if(is_array($_POST['test1'])) {
foreach($_POST['test1'] as $Key => $Value) {
echo $Value;
};

How can I put $_POST['test2'] in this piece of code? So that it's both handling Test1 
and Test2!

Thanks for your help; Here is the full code:


 $Value) {
echo $Value;
};
} else {
echo $_POST[voorletters];
}
}
?>

";
echo "# $i";
  
}

?>



Thanks in advance for your time and help
Regards,

Frank


Re: [PHP] Classes and Objects

2003-06-10 Thread Frank Keessen
Don,

Are you using phpmailer of http://phpmailer.sourceforge.net/ ???

Looks like:

require("class.phpmailer.php");

this is not properly configured! Please check if the path is going alright..

Regards,

Frank
- Original Message - 
From: "Don" <[EMAIL PROTECTED]>
To: "php list" <[EMAIL PROTECTED]>
Sent: Tuesday, June 10, 2003 10:33 PM
Subject: [PHP] Classes and Objects


Are Classes and Objects supported in PHP 3.0.14?

I am getting an error: "Call to unsupported or undefined function
phpmailer()"
on a server running PHP 3.0.14 but it works in PHP 4.3.2

Thanks,
Don



  _


This email and any files transmitted with it are strictly confidential and
may be privileged information. It is intended solely for the individual or
company to whom it is addressed and may not be copied, forwarded,
transmitted or otherwise distributed in any manner or form to any other
party. If you are not the intended recipient or the person responsible for
delivering this e-mail to the intended recipient, please indicate so and
return this email to the sender, after which, kindly delete it from your
computer as well as your email server. Without limitation, LCL Navigation
accepts no liability whatsoever and howsoever caused in connection with the
use of this email.

Are you on our eBLISS yet?  It's simple yet amazing.
Just click here: http://www.lclnav.com/createaccount.html
to open a B2B account with us and do everything electronically 24/7.

Click  <http://www.lclnav.com/new.html> here to find out "What's new" at LCL
Navigation.




-- 
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] Math with php

2003-06-10 Thread Frank Keessen
Hi,

Hope you can help me:

How can i do the following in PHP:

When a variable is for example: 

$a = 7 

I must do the following 6 * X and 1 * Y, but when $a = 4 it must only do 4 * X.

So every when the value is odd i must do # * X and # * Y..

Some examples or hints are very welcome! Sory that this is maybe a little bit vague... 
Questions? e-mail!

Regards,

Frank


[PHP] Capturing the input of dynamic form fields

2003-06-15 Thread Frank Keessen
Dear all,

Can you help me with the following or point me to the right direction;

I'm receiving value's of two fields called test1 and test2. Both fields can have 
multivalue's. The first field called test1 is going o.k. with the following code;

if(is_array($_POST['test1'])) {
foreach($_POST['test1'] as $Key => $Value) {
$query = "INSERT INTO testx(name) values ('$Value')";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
} else {
$query = "INSERT INTO testx(name) values ('$test1')";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
 }
}


How can i put the test2 value's in the above construction so that the value's of test1 
and test2 are seamlessley written in the database?

Thanks in advance for helping me out!

Regards,

Frank


[PHP] Capturing the input of dynamic form fields (part II)

2003-06-15 Thread Frank Keessen
Dear all,

Refering to my first e-mail with the same subject; I've reworked the code to this:

But the only problem is; Nothing is written into the mysql database! And there are no 
error displayed..

Can someone have a look at my code?



";
  echo "# $i";
  
}

?>



Thanks very much,

Frank


Re: [PHP] Capturing the input of dynamic form fields (part II)

2003-06-15 Thread Frank Keessen
Hi James,

Sorry to say; I've put your code in it but there are no error message's
displaying and there is no value inserted in the database... Any clue???

Regards,

Frank
- Original Message - 
From: "James Hicks" <[EMAIL PROTECTED]>
To: "Frank Keessen" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, June 15, 2003 4:14 PM
Subject: Re: [PHP] Capturing the input of dynamic form fields (part II)


> Whenever I am having problems with SQL queries I always display the query
on
> the page with all the replaced variables so I can make sure that the query
> makes sense. If it passes the MySQL parser in my brain and still doesn't
> work, I will copy the displayed query into the command line mysql monitor
(or
> phpmyadmin) and try the command manually to see what happens.
>
> I also found it easier to solve my SQL problems by not using "or die " and
> just displaying some information about the problem query. This way I know
> something is wrong if the third line of the echo is not at least 1.
>
> $query="INSERT INTO test (test1, test2) VALUES
> ('$_POST['test1']','$_POST['test2']')";
> $result = mysql_query($query);
> echo(mysql_error()."$query".mysql_affected_rows($result));
>
>
> James
>
> On Sunday 15 June 2003 09:39 am, Frank Keessen wrote:
> > Dear all,
> >
> > Refering to my first e-mail with the same subject; I've reworked the
code
> > to this:
> >
> > But the only problem is; Nothing is written into the mysql database! And
> > there are no error displayed..
> >
> > Can someone have a look at my code?
> >
> >  > $_REQUEST["submit"]=isset($_REQUEST["submit"])?$_REQUEST["submit"]:"";
> > if($_REQUEST['submit']!="")
> > {
> > for($i=0;$i > $query="INSERT INTO test (test1, test2) VALUES
> > ('$_POST['test1']','$_POST['test2']')"; $result = mysql_query($query) or
> > die ("Error in query: $query. " . mysql_error()); }
> > }
> > ?>
> >  > action="">  >  for ($i=1; $i<=2; $i++)
> > {
> > echo "# $i";
> >   echo "# $i";
> >
> > }
> >
> > ?>
> > 
> > 
> >
> > Thanks very much,
> >
> > Frank
>
>
> -- 
> 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] Capturing the input of dynamic form fields (part II)

2003-06-15 Thread Frank Keessen
Hi,

Looks like the value's are not coming to the database.. Can you please all
have a close look at my code because it's driving me NUTS!

THANKS FOR YOUR HELP!

$query".mysql_affected_rows($result));
}

}
?>
>
";
  echo "# $i";

}

?>



Regards,

Frank


----- Original Message - 
From: "Frank Keessen" <[EMAIL PROTECTED]>
To: "James Hicks" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, June 15, 2003 8:59 PM
Subject: Re: [PHP] Capturing the input of dynamic form fields (part II)


> Hi James,
>
> Sorry to say; I've put your code in it but there are no error message's
> displaying and there is no value inserted in the database... Any clue???
>
> Regards,
>
> Frank
> - Original Message - 
> From: "James Hicks" <[EMAIL PROTECTED]>
> To: "Frank Keessen" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Sunday, June 15, 2003 4:14 PM
> Subject: Re: [PHP] Capturing the input of dynamic form fields (part II)
>
>
> > Whenever I am having problems with SQL queries I always display the
query
> on
> > the page with all the replaced variables so I can make sure that the
query
> > makes sense. If it passes the MySQL parser in my brain and still doesn't
> > work, I will copy the displayed query into the command line mysql
monitor
> (or
> > phpmyadmin) and try the command manually to see what happens.
> >
> > I also found it easier to solve my SQL problems by not using "or die "
and
> > just displaying some information about the problem query. This way I
know
> > something is wrong if the third line of the echo is not at least 1.
> >
> > $query="INSERT INTO test (test1, test2) VALUES
> > ('$_POST['test1']','$_POST['test2']')";
> > $result = mysql_query($query);
> > echo(mysql_error()."$query".mysql_affected_rows($result));
> >
> >
> > James
> >
> > On Sunday 15 June 2003 09:39 am, Frank Keessen wrote:
> > > Dear all,
> > >
> > > Refering to my first e-mail with the same subject; I've reworked the
> code
> > > to this:
> > >
> > > But the only problem is; Nothing is written into the mysql database!
And
> > > there are no error displayed..
> > >
> > > Can someone have a look at my code?
> > >
> > >  > > $_REQUEST["submit"]=isset($_REQUEST["submit"])?$_REQUEST["submit"]:"";
> > > if($_REQUEST['submit']!="")
> > > {
> > > for($i=0;$i > > $query="INSERT INTO test (test1, test2) VALUES
> > > ('$_POST['test1']','$_POST['test2']')"; $result = mysql_query($query)
or
> > > die ("Error in query: $query. " . mysql_error()); }
> > > }
> > > ?>
> > >  > > action="">  > >  for ($i=1; $i<=2; $i++)
> > > {
> > > echo "# $i";
> > >   echo "# $i";
> > >
> > > }
> > >
> > > ?>
> > > 
> > > 
> > >
> > > Thanks very much,
> > >
> > > Frank
> >
> >
> > -- 
> > 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Capturing the input of dynamic form fields (part II)

2003-06-15 Thread Frank Keessen
Hi,

Wow! Live = beautiful (or is it PHP??)..

Any way:

foreach($_POST['test1'] as $i => $Value) {
> $query = "INSERT INTO test (test1, test2) VALUES
> ('".$_POST['test1'][$i]."', '".$_POST['test2'][$i]."')";
> $result = mysql_query($query);

That one did the trick!

Thanks James and Wouter for helping me out!

Frank
----- Original Message - 
From: "esctoday.com | Wouter van Vliet" <[EMAIL PROTECTED]>
To: "Frank Keessen" <[EMAIL PROTECTED]>; "James Hicks"
<[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, June 15, 2003 10:08 PM
Subject: RE: [PHP] Capturing the input of dynamic form fields (part II)


> First thing I notice as being at least a bit odd is this part:
>
> $nArraySize = count($_POST['test1']);
> $test1=$_POST['test1[]'];
> $test2=$_POST['test2[]'];
>
> what are you trying to do with that? .. What I'd expect it to look like is
> smth like:
>
> $nArraySize = count($_POST['test1']);
> $test1 = $_POST['test1'];
> $test2 = $_POST['test1'];
>
> but probably this:
>
> foreach($_POST['test1'] as $i => $Value) {
> $query = "INSERT INTO test (test1, test2) VALUES
> ('".$_POST['test1'][$i]."', '".$_POST['test2'][$i]."')";
> $result = mysql_query($query);
>
> # and what else you'd want to do ...
> };
>
> would just make even a little more sense .. some discussion could be about
> using $_POST['test1'][$i] to get the value again, or just using the $Value
> variable created by the foreach calls...
>
> -Oorspronkelijk bericht-
> Van: Frank Keessen [mailto:[EMAIL PROTECTED]
> Verzonden: zondag 15 juni 2003 21:44
> Aan: Frank Keessen; James Hicks
> CC: [EMAIL PROTECTED]
> Onderwerp: Re: [PHP] Capturing the input of dynamic form fields (part
> II)
>
>
> Hi,
>
> Looks like the value's are not coming to the database.. Can you please all
> have a close look at my code because it's driving me NUTS!
>
> THANKS FOR YOUR HELP!
>
>  // open database connection
> $connection = mysql_connect($host, $user, $pass) or die ("Unable to
> connect!");
>
> // select database
> mysql_select_db($db) or die ("Unable to select database!");
>
> $_REQUEST["submit"]=isset($_REQUEST["submit"])?$_REQUEST["submit"]:"";
> if($_REQUEST['submit']!="")
> {
> $nArraySize = count($_POST['test1']);
> $test1=$_POST['test1[]'];
> $test2=$_POST['test2[]'];
>
> echo $nArraySize;
> for($i=0;$i<$nArraySize;$i++) {
> $query="INSERT INTO test (test1, test2) VALUES ('$test1[$i]',
> '$test2[$i]')";
> $result = mysql_query($query);
> echo(mysql_error()."$query".mysql_affected_rows($result));
> }
>
> }
> ?>
>  action=>
>   for ($i=1; $i<=2; $i++)
> {
> echo "# $i";
>   echo "# $i";
>
> }
>
> ?>
> 
> 
>
> Regards,
>
> Frank
>
>
> - Original Message -
> From: "Frank Keessen" <[EMAIL PROTECTED]>
> To: "James Hicks" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Sunday, June 15, 2003 8:59 PM
> Subject: Re: [PHP] Capturing the input of dynamic form fields (part II)
>
>
> > Hi James,
> >
> > Sorry to say; I've put your code in it but there are no error message's
> > displaying and there is no value inserted in the database... Any clue???
> >
> > Regards,
> >
> > Frank
> > - Original Message -
> > From: "James Hicks" <[EMAIL PROTECTED]>
> > To: "Frank Keessen" <[EMAIL PROTECTED]>
> > Cc: <[EMAIL PROTECTED]>
> > Sent: Sunday, June 15, 2003 4:14 PM
> > Subject: Re: [PHP] Capturing the input of dynamic form fields (part II)
> >
> >
> > > Whenever I am having problems with SQL queries I always display the
> query
> > on
> > > the page with all the replaced variables so I can make sure that the
> query
> > > makes sense. If it passes the MySQL parser in my brain and still
doesn't
> > > work, I will copy the displayed query into the command line mysql
> monitor
> > (or
> > > phpmyadmin) and try the command manually to see what happens.
> > >
> > > I also found it easier to solve my SQL problems by not using "or die "
> and
> > > just displaying some informat

[PHP] Array in a $_session

2003-06-16 Thread Frank Keessen
Hi,

Still strugling with array's ;>  : Can you help me with this??



How can i put that value into an $_SESSION??

Something like $_SESSION["test1"][$i]??

This is the way i put into a database

foreach($_POST['test1'] as $i => $Value) {
$query = "INSERT INTO test (test1, test2, test3, test4 , test5) VALUES 
('".$_POST['test1'][$i]."', '".$_POST['test2'][$i]."', '".$_POST['test3'][$i]."', 
'".$_POST['test4'][$i]."', '".$_POST['test5'][$i]."')";
$result = mysql_query($query); 
 

But i've got no clue how to put into a session and retrieve it..

Can you help?

Regards,

Frank


Re: [PHP] Array in a $_session

2003-06-16 Thread Frank Keessen
John,

Thanks but nothing is displayed on page 3 Any thoughts???

(page 2)

$_REQUEST["submit"]=isset($_REQUEST["submit"])?$_REQUEST["submit"]:"";
if($_REQUEST['submit']!="")
{
foreach($_POST['test1'] as $i => $Value) {
$_SESSION['test1'][$i] = $_POST['test1'][$i];
}
header("Location: step3.php");
}

(page 3)

session_start();
$test1 = $_SESSION['test1'][$i];
echo $test1;
for ($i=1; $i<=$_SESSION['test1'][$i]; $i++)
{
echo $test1;
}

Thanks for your time!

Frank

- Original Message - 
From: "John W. Holmes" <[EMAIL PROTECTED]>
To: "Frank Keessen" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, June 16, 2003 11:34 PM
Subject: Re: [PHP] Array in a $_session


> Frank Keessen wrote:
> > Still strugling with array's ;>  : Can you help me with this??
> >
> > 
> >
> > How can i put that value into an $_SESSION??
> >
> > Something like $_SESSION["test1"][$i]??
> >
> > This is the way i put into a database
> >
> > foreach($_POST['test1'] as $i => $Value) {
> > $query = "INSERT INTO test (test1, test2, test3, test4 , test5) VALUES
('".$_POST['test1'][$i]."', '".$_POST['test2'][$i]."',
'".$_POST['test3'][$i]."', '".$_POST['test4'][$i]."',
'".$_POST['test5'][$i]."')";
> > $result = mysql_query($query);
> >
> >
> > But i've got no clue how to put into a session and retrieve it..
>
> $_SESSION['test1'][$i] = $_POST['test1'][$i]
>
> Assuming you're setting $i to something in the processing script...
>
> -- 
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> PHP|Architect: A magazine for PHP Professionals – www.phparch.com
>
>
>
>


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



Re: [PHP] Array in a $_session

2003-06-16 Thread Frank Keessen
Hi jason & the rest,

Dit the session_write_close()! Nothing still displayed in step3, more
thoughts??

$_REQUEST["submit"]=isset($_REQUEST["submit"])?$_REQUEST["submit"]:"";
if($_REQUEST['submit']!="")
{
foreach($_POST['test1'] as $i => $Value) {
$_SESSION['test1'][$i] = $_POST['test1'][$i];
}
session_write_close();
header("Location: step3.php");

(step 3)

session_start();
$aantalpers=$_SESSION["aantalpers"];
$test1 = $_SESSION['test1'][$i];
echo $test1;
for ($i=1; $i<=$_SESSION['test1'][$i]; $i++)
{
echo $test1;
}

Frank

- Original Message - 
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 16, 2003 11:58 PM
Subject: Re: [PHP] Array in a $_session


> On Tuesday 17 June 2003 05:43, Frank Keessen wrote:
>
> > Thanks but nothing is displayed on page 3 Any thoughts???
> >
> > (page 2)
> >
> > $_REQUEST["submit"]=isset($_REQUEST["submit"])?$_REQUEST["submit"]:"";
> > if($_REQUEST['submit']!="")
> > {
> > foreach($_POST['test1'] as $i => $Value) {
> > $_SESSION['test1'][$i] = $_POST['test1'][$i];
> > }
>
> You need to session_write_close() before redirecting.
>
> > header("Location: step3.php");
>
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> We are not a loved organization, but we are a respected one.
> -- John Fisher
> */
>
>
> -- 
> 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] Array in a $_session

2003-06-16 Thread Frank Keessen
Hi John and maybe other that can look at the following,

See below; I've got a session_start() on page2 because i'm retrieving
($aantalpers) an session value of step1.php and that is properly displayed
on page2. Still nothing is displayed... Full code displayed below; any
thoughts!

Thanks for your time everyone to have a look at this!

Regards,

Frank

(step 2.php)

 $Value) {
$_SESSION['test1'][$i] = $_POST['test1'][$i];
}
session_write_close();
header("Location: step3.php");
}

?>
>

echo "";
 }
?>




(step 3.php)


- Original Message - 
From: "John W. Holmes" <[EMAIL PROTECTED]>
To: "Frank Keessen" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, June 17, 2003 4:06 AM
Subject: Re: [PHP] Array in a $_session


> Frank Keessen wrote:
>
> > Hi jason & the rest,
> >
> > Dit the session_write_close()! Nothing still displayed in step3, more
> > thoughts??
> >
> > $_REQUEST["submit"]=isset($_REQUEST["submit"])?$_REQUEST["submit"]:"";
> > if($_REQUEST['submit']!="")
> > {
> > foreach($_POST['test1'] as $i => $Value) {
> > $_SESSION['test1'][$i] = $_POST['test1'][$i];
> > }
> > session_write_close();
> > header("Location: step3.php");
>
> Do you have a session_start() on page 2?
>
> > (step 3)
> >
> > session_start();
> > $aantalpers=$_SESSION["aantalpers"];
> > $test1 = $_SESSION['test1'][$i];
> > echo $test1;
> > for ($i=1; $i<=$_SESSION['test1'][$i]; $i++)
> > {
> > echo $test1;
> > }
>
> Do a print_r($_SESSION); on page 3 to see what's in your session. What
> is $i on page 3? I don't see where you set it.
>
> -- 
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> PHP|Architect: A magazine for PHP Professionals – www.phparch.com
>
>
>
>


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



[PHP] cannot get php through apache to write to my home dir on shared server

2003-06-26 Thread frank reeves
Hi,

I have an account on shared server and am trying to
write a logfile (a dump of an email which i use mail()
to send) to a logfile in my home dir.  This logfile
will grow with all emails send by my app and will thus
give me an archive of sorts.

However, because php is executed through apache as
user nobody it does not have permission to write to my
linux home dir (fopen("log.file","a")) fails with
permission denied). I dont want to open my home dir to
the world to allow this operation but I also dont want
to write my log to /var/tmp as user nobody.

Does anyone know how I can get php to write as me to
my home dir ?

I suppose i could write a shell script and have my app
call this but that seems a bit convoluted.

Thanks in advance,
-- frank

=



Want to chat instantly with your online friends?  Get the FREE Yahoo!
Messenger http://uk.messenger.yahoo.com/

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



Re: [PHP] web site security: how to hide login info for mysql-connection

2003-06-29 Thread Avvio - Frank
basically you need to append to your include_path and you can probably
create a local .htaccess file and set an include path in there (look up
php_value syntax for .htaccess)

otherwise start your script with a customised version of the following:

ini_set("include_path",ini_get("include_path").":". "/your/path/here/");

then include/require as normal

-- frank

- Original Message - 
From: "anders thoresson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, June 29, 2003 4:33 PM
Subject: Re: [PHP] web site security: how to hide login info for
mysql-connection


> > Be aware that wherever you store the settings folder, your php.ini
should
> > have that path in it's include_directories setting, and the webserver
> > must
> > have read permissions for that file.
>
>  I don't have access to php.ini on my ISP's web server. Is there a way for
> a user to make their own set ow include_directories?
>
> -- 
> anders thoresson
>
> -- 
> 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] e-mail to mysql database?

2002-08-12 Thread Frank Schellenberg

In Short: What I need is a php script that reads an email file and split its
data to a mysql file.
A bit longer if you are still interested

For the following project:
http://www.crossing-africa.com, a journey I am going to make on a bike.
What are the plans:

I am taking a satilite phone and SMS my possition with GPS coordinates like:
N50.34.234 E006.45.34 on 23-feb-2003
I already have a script that translates that sms to an e-mail that looks the
same.
Then what:
This e-mail needs to be split up like this:
N50.34.234
E006.45.34
23-feb-2003
and then be insterted into a mysql database.
The result then is that my exact location is know everyday and will be
plotted on the web.

The website runs on a cobalt server

As my php knowledge is very limited and I searched the web for a script to
do so I havent found it, could any of you help, as it must be out there!
Thanks for any helpfull contribution.

Frank Schellenberg



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




[PHP] Variable Assignment

2002-09-09 Thread Kicenko, Frank


Hi,
I apologize for asking this question as it must have been asked many times
before but I can't find it in any of the archives.. 

What I would like to do is setup forms in javascript and then on a submit to
assign these variables to PHP variables. I know how to assign PHP to
javascript with the "" or "" but I don't know how
to do the reverse. Can anyone help?

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




Re: [PHP] Looking for an open source PHP editor on linux

2002-10-25 Thread Frank W.
the personal edition (2.0) from www.zend.com

well - its not open source but it has nice help and debug-features for PHP.

Tariq Murtaza wrote:


Dear All

I am wondering if anyone know, some good open source editor for PHP on
linux/Unix

Hopping for The Best :)

Tariq







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




Re: [PHP] Register Globals Off in .htacces

2002-10-25 Thread Frank W.
it works only if i put it in my httpd.conf - yes allowoveride is set to
all :/

i'm using apache 1.3.27 on win2k.

Jon Haworth wrote:

> Hi,
>
>
> >Thx for your reply It is working.
>
>
> No probs, glad to help.
>
>
> >I also found from php.net that it's possible
> >to set register_globals to "off" on a site-by-
> >site basis via Apache, thus overriding the "global"
> >setting of register_globals in php.ini:
> >
> >
> >ServerName localhost
> >DocumentRoot /var/www/html/mysite
> >php_value register_globals 0 (or 1 for "on")
> >
>
>
> Yup, or even in directories:
>
>
>   php_value register_globals 0
>
>
> Which might be handy if you're updating scripts on a live site.
>
> Cheers
> Jon
>




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




Re: [PHP] Register Globals Off in .htacces

2002-10-25 Thread Frank W.
well, i found my mistake ;)

on windows i forgot to change the name of the .htaccess-files because on 
win they couldnt have a extentsion without a name.

So i've named them now only "htaccess" without the dot and it works fine

Frank W. wrote:

it works only if i put it in my httpd.conf - yes allowoveride is set to
all :/

i'm using apache 1.3.27 on win2k.

Jon Haworth wrote:

 > Hi,
 >
 >
 > >Thx for your reply It is working.
 >
 >
 > No probs, glad to help.
 >
 >
 > >I also found from php.net that it's possible
 > >to set register_globals to "off" on a site-by-
 > >site basis via Apache, thus overriding the "global"
 > >setting of register_globals in php.ini:
 > >
 > >
 > >ServerName localhost
 > >DocumentRoot /var/www/html/mysite
 > >php_value register_globals 0 (or 1 for "on")
 > >
 >
 >
 > Yup, or even in directories:
 >
 >
 >   php_value register_globals 0
 >
 >
 > Which might be handy if you're updating scripts on a live site.
 >
 > Cheers
 > Jon
 >








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




Re: [PHP] Add picture in DB

2002-10-28 Thread Frank W.
Have you used a SQL-Statement like:

INSERT INTO `tablename` VALUES ('',LOAD_FILE('$file')

to insert it with load_file? I used it without problems that way.


Christian Ista wrote:


Hello,

I have a form, with 2 inputs ( a type "file" and a type "text") and a
submit.

When I submit I receive an error, like this :
':\\Inetpub\\wwwroot\\test\\small2158.jpg)' at line 3

Could you tell me what can I do ?

The better solution is save the picture in the database or save the link
to this picture un the database ?

Christian,






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




Re: [PHP] problem loading extension

2002-10-29 Thread Frank W.
there should be something like:
   extension_dir = "C:\PHP\extensions"
in your php.ini


Simon Taylor wrote:

> Hi All,
> I have just been trying to add some more extensions to my site, I have
> copied the dll's for the extensions I wish to add to my extensions 
dir and
> uncommented them in my php.ini.
> This worked fine for all of them which include ctype, gd etc. , 
except for
> the xslt extension which will just not work for me... I am getting this
> message.
> PHP Warning: Unable to load dynamic library 'C:\PHP\dll\./php_xslt.dll' -
> The specified module could not be found. in Unknown on line 0
> The file is most definitely there and if I move one of the other 
extension
> files I get the same message for them, not sure what I am doing wrong.
> Any ideas appreciated.
> Thanks
> _
> Simon Taylor
> AfriTol (Pty) Ltd.
>



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



[PHP] newbie's question

2002-11-15 Thread Frank Wang
Hi,
what is the correct way of testing if a string is empty or not?

fw



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




[PHP] mail and from line overriding

2002-11-15 Thread Frank Wang
Hi,

I have something like following:

$from = "[EMAIL PROTECTED]";
$email = "[EMAIL PROTECTED]";
$msg = "abcde";

 mail($email, $subj, $msg, $from);

the message sent always has the 'from' line taken from php.ini, not $from,
is there a way to override this ? Thanks.

Frank



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




Re: [PHP] newbie's question

2002-11-15 Thread Frank Wang
Hi,

That looks good to me, thanks.

"Steve Keller" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Err... sorry. The logic was there but my fingers got a bit ahead of my
> brain. The check works, but if you want to just check if it's empty turn
> the conditional to a negative, like so:
>
> if (!$testVar) {
> etc.
> }
>
> That makes it "If NOT $testVar"
>
>
>
>  > I may be crazy, but wouldn't if ($variable) work just as well? If the
> string is empty it'll return a negatory on that check.
>  >
>  > Lemme double check that.
>  >
>  > $testVar = "";
>  > if ($testVar) {
>  >   echo "Yes";
>  > }
>  > else {
>  >   echo "No";
>  > }
>  >
>  > Yeah, ok. That ran just fine under 4.2.3.
> --
> S. Keller
> UI Engineer
> The Health TV Channel, Inc.
> (a non - profit organization)
> 3820 Lake Otis Pkwy.
> Anchorage, AK 99508
> 907.770.6200 ext.220
> 907.336.6205 (fax)
> Email: [EMAIL PROTECTED]
> Web: www.healthtvchannel.org
>



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




[PHP] Sharing form information

2002-06-15 Thread Frank Kicenko

Hi,
Hopefully I didn't send this to the wrong list...:-)
 
I have a couple of questions if you don't mind... the PHP
help files seem to be very vague with respect to html issues.

Questions: How can I get the "selected" info from a selectbox that is in
another form on the same page... I've tried everything I know to be able to
get this. For instance, if a selectbox is part of $f1 and I'm submitting
using $f2, how can I get the selection from the $f1 selectbox and use it in
my $f2?

Also, how can I insert a "textbox" or other items into a cell? The
input_text belongs to $f2 and I need to insert it into a cell. for example
the following doesn't work properly as it inserts it, but on a submit..
again the values don't belong to $f2.

insert($t,$c = cell());
insert($c, input_text(array("name"=>"matrix",
"value"=>"$ohms",
"size"=>"15",
"maxlength"=>"15";


Thanks.






[PHP] Using $PHP_SELF in a form

2002-06-24 Thread Frank Miller








Hello All,

    I’m working on a project here
at our university and need a little.  We installed a wireless network and
bought 5 ipaq’s to use and experiment with.  I wrote a work order system
that we are still using. Basically the tech guys want to be able to check WO
from the ipaq’s and if they finish them fill in a check box and have it
be updated in the WO database and not be displayed on the open or uncompleted
work order page. I can do everything except when the completed box is filled I
can’t get it to fill in the database. Below is the code I’m using.
Keep in mind it is being displayed on a ipaq so the headings are brief. Also I’m
working on my local computer before it is put in production. Any help would be
appreciated. 

 

TIA – Frank

 



if(!$HTTP_POST_VARS['submit']) {

 

 

// initialize database connection

$connection = mysql_connect("localhost") or

die("Couldn't connect to the database!");

 // select database

mysql_select_db("techsupport", $connection);

//formulate and run query

$query = "SELECT * FROM techsupport where (Completed =
'N' or Completed = 'n') and TCompleted='N' ORDER by WONumber DESC";

$result = mysql_query($query,$connection) or die("Error
in Query");

 

$per_page = 10;

if(!$page) {

    $page = 1; 

}

$prev_page = $page - 1;

$next_page = $page + 1;

 

$page_start = ($per_page * $page ) - $per_page;

$num_rows = mysql_num_rows($result);

 

if ($num_rows <= $per_page) {

 $num_pages = 1;

}

else if (($num_rows % $per_page) == 0) {

 $num_pages = ($num_rows / $per_page);

}

else {

    $num_pages = ($num_rows / $per_page) +1;

}

$num_pages = (int)$num_pages;

 

if (($page > $num_pages) || ($page < 0)) {

  error("You have specified an invalid page
number");

}

$query = $query . " LIMIT $page_start, $per_page";

$result = mysql_query($query,$connection) or die("Error
in Query2");

 

echo "



TECH-DE Check Work Orders







 





T = Finished by Technician





#

T

Req.

Situation

";

while ($row = mysql_fetch_array($result)) {

  $WONumber = $row["WONumber"];

  $Completed = $row["Completed"];

  $Requestedby = $row["Requestedby"];

  $Situation = $row["Situation"];

  $Shortsit = substr($Situation, 0, 25);

  if ($color=="#CC") {

 $color="#00";

 } else {

 $color = "#CC";

  }

  echo "

  $WONumber

  

  

  

  $Requestedby

  

  $Shortsit";

  }

echo "";

if ($prev_page) {

echo "Prev"
";

}

else {

 echo "  ";

}

 

echo "";

for ($i = 1; $i <= $num_pages; $i++) {

 if ($i != $page ) {

    echo " $i"
";

} else {

  echo " $i ";

   }

}

echo "";

 

if ($page != $num_pages) {

   echo "Next";  "


}

else {

 echo "";

}

echo "";

mysql_free_result($result);

mysql_close($connection);

echo "



";

}

else {

// initialize database connection

print $WONumber;

$connection = mysql_connect("localhost") or

die("Couldn't connect to the database!");

 // select database

mysql_select_db("techsupport", $connection);

//formulate and run query

$query = "update techsupport set TCompleted='Y'where $WONumber=$Checkbox[0]";

$result = mysql_query($query,$connection) or die("Error
in Query2");

}

 

 

?>

 

Frank Miller

Computer Specialist and Webmaster

Texas A&M University-Texarkana

2600 N. Robison Rd

Texarkana, Texas 75501

 

Office  165

Phone (903)223-3156

Fax (903)223-3139

 








smime.p7s
Description: application/pkcs7-signature


[PHP] If empty don't display...

2003-08-27 Thread Frank Keessen
Hi there,

Can you please have a look at the following code:

I've got two questions;

1. I'm trying not to display the fields that are empty with: if 
(!empty($row9->prijs4pk)){
 But it's still display the line and there is no value in PRIJS4PK field.


2. How can i reduce the amount of Queries??

Thanks for your time and help,

Frank



The code:








" . $row4->naamreis . "";
?>

  

  
  
  

 0)
{

 while($row = mysql_fetch_object($result))
 {
 echo "". 
formatDateShort($row->date) . "";

  }
}
 
  
?>



prijs4pk)){
?>
 
  
 4 pk

 0)
 {

  while($row5= mysql_fetch_object($result5))
  {
 $pr6 = number_format($row5->prijs4pk,0); 
 echo "". $pr6 . 
"";

  }
 }
}

if (!empty($row99->prijs3pk)){
?>
 
  
 3 pk

 0)
{

 while($row5= mysql_fetch_object($result5))
 {
 $pr5 = number_format($row5->prijs3pk,0); 
 echo "". $pr5 . 
"";

  }
}
}
if (!empty($row9->prijs2pk)){
?>
  
  
 2 pk

   0)
{

 while($row2= mysql_fetch_object($result2))
 {
 $pr2 = number_format($row2->prijs2pk,0); 
 echo "". $pr2 . 
"";

  }
}
}
?>
prijs1pk)){
?>
 
  
 1 pk

   0)
{

 while($row3= mysql_fetch_object($result3))
 {
 $pr1 = number_format($row3->prijs1pk,0);
 echo "". $pr1 . 
"";

  }
}
} 


  
// start 123 next>> table 
echo " 
";if($numofpages>1){echo" ";}  

// display previous link if page is not 1 
if($page != 1){  
$pageprev = $page - 1;  
echo("<< Terug "); 
 
}  

// display page nos if not 1 
for($i = 1; $i <= $numofpages; $i++){  
if($numofpages>1){ 
if($i == $page)  
echo(" ".$i." ");  
else 
echo(" $i ");  
}} 

// display next page link if there is more than one 
if(($totalrows - ($limit * $page)) > 0){  
$pagenext = $page + 1;  
echo("Volgende >>");  
} 
// end 123 next>> table 
echo"";
?>
 


[PHP] Get the lowest value out of different fields

2003-09-03 Thread Frank Keessen
Hi All,

I hope you can help me with this:

I have a tabel in my database like this

TEST

fieldnameValue's

testid  1
testf1   3
testf2   4
testf3   0
testf4   2
testf5   0

(so this is one record!)

I want to display the lowest value, except 0.. So the SQL statement will be SELECT 
testf1, testf2, testf3, testf4, testf5 FROM test where testid='1' .

I can't figure out if i can do this into a SQL statement or put it in an Array and 
sort it..

Please help!

Frank


Re: [PHP] Get the lowest value out of different fields

2003-09-03 Thread Frank Keessen
Hi all,

Thanks for the quick response.. Did a little bit more investigation: (and
made additions to my table)

++++++
| testid | testf1 | testf2 | testf4 | testf5 | frankid
++++++
| 1  | 3  | 4  | 0  | 2  |10
++++++
| 2  |  8   |  7  | 0  | 6  |10
++++++
| 3  | 3  | 4  | 0  | 2  |8
++++++
 (The layout is from mr. Chris W. Parker!)

O.k. i dropped my lines below: As you can see, i'm selecting FRANKID 10 and
i want to display the lowest value (2 rows are selected)! As you can see a
stole a function from www.php.net/min, Now this is working fine for the
first record!!! BUT how can i make the function loop through the whole
result?

---
if (mysql_num_rows($result3) > 0)
{
$test = mysql_fetch_array($result3);
echo minnum($test);
}

--


Whole code:
 0)
{
$test = mysql_fetch_array($result3);
echo minnum($test);
}
?>


Regards,

Frank

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



[PHP] Help with Displaying RSS feed links

2003-09-09 Thread Frank Miller
Hello all,

I'm working on an entry page where I would like to show some of the
current headlines from technology websites. I've been following and
pretty much understand the article on devshed
http://www.devshed.com/Server_Side/PHP/PHPRDF/page1.html Plugging RDF
content into your Website. From what I gather from the article is that
he uses a foreach loop to display the Title, link and description which
could be anywhere from 5 to 15 links. I only have room on my page for 3
and then I plan on putting a more link taking visitors to a page where
I'll have more room.

I was reading in the Welling/Thomson book about converting a foreach
loop into another loop. Here is the original foreach loop and then what
I was trying to convert it to:

foreach ($items as $item)
{
echo "" . $item["title"] .
"" . $item["description"] .  ""; }

//**
*

for ($row=0; $row<2; $row++)
{
   while (list ( $key, $value) = each ($items[$row]))
{
echo "" . $item["title"] .
"" . $item["description"] .  ""; 
}
}

Can anyone point me in the right direction? Right now I don't get an
error but I also don't get any text or results.

Thanks - Frank

Here is the code from the original article:

//









New releases on freshmeat.net today:


http://www.freshmeat.net/backend/fm-releases.rdf";;

// set up some variables for use by the parser
$currentTag = "";
$flag = "";
$count = 0;

// this is an associative array of channel data with keys
("title","link","description")
$channel = array();

// this is an array of arrays, with each array element representing an

// each outer array element is itself an associative array 
// with keys ("title", "link", "description")
$items = array();

// opening tag handler
function elementBegin($parser, $name, $attributes)
{
global $currentTag, $flag;
$currentTag = $name;
// set flag if entering  or  block
if ($name == "ITEM")
{
$flag = 1;
}
else if ($name == "CHANNEL")
{
$flag = 2;
}
}

// closing tag handler   
function elementEnd($parser, $name)
{
global $currentTag, $flag, $count;
$currentTag = "";

// set flag if exiting  or  block
if ($name == "ITEM")
{
$count++;
$flag = 0;
}
else if ($name == "CHANNEL")
{
$flag = 0;
}
}

// character data handler
function characterData($parser, $data)
{
global $currentTag, $flag, $items, $count, $channel;
$data = trim(htmlspecialchars($data));
if ($currentTag == "TITLE" || $currentTag == "LINK" ||
$currentTag == "DESCRIPTION")
{
// add data to $channels[] or $items[] array
if ($flag == 1)
{
$items[$count][strtolower($currentTag)] .=
$data;
}
else if ($flag == 2)
{
$channel[strtolower($currentTag)] .= $data;
}
}

}

// create parser
$xp = xml_parser_create();

// set element handler
xml_set_element_handler($xp, "elementBegin", "elementEnd");
xml_set_character_data_handler($xp, "characterData");
xml_parser_set_option($xp, XML_OPTION_CASE_FOLDING, TRUE);
xml_parser_set_option($xp, XML_OPTION_SKIP_WHITE, TRUE);

// read XML file
if (!($fp = fopen($file, "r"))) 
{
  die("Could not read $file");
}

// parse data
while ($xml = fread($fp, 4096)) 
{
if (!xml_parse($xp, $xml, feof($fp))) 
{
die("XML parser error: " .
xml_error_string(xml_get_error_code($xp)));
}
}

// destroy parser
xml_parser_free($xp);

// now iterate through $items[] array
// and print each item as a table row

foreach ($items as $item)
{
echo "" . $item["title"] .
"" . $item["description"] .  ""; }
?>




//**





Frank Miller
Computer Specialist and Webmaster
Texas A&M University-Texarkana
2600 N. Robison Rd
Texarkana, Texas 75501
 
Office  165
Phone (903)223-3156 (2*2*61*37017349)
Fax (903)223-3139

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



[PHP] globals on globals off (help

2003-09-16 Thread Frank Tudor
This is more for a linux group post but I know someone can
provide enlightenment on this issue.

I have the latest version of apache and php I have created my
entire sie in a foxserv environment on windows but my production
environment is on mandrake linux 9.1

The globals are set to off but i'll be damned if I know where I
can set them to on.

I found a php.ini-dist and a php.ini-recommended file but
changing these files does nothing.

can someone give me some give me a hand with this?

Thanks,
Frank

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



[PHP] PHP Apache (GLOBALS) question

2003-09-19 Thread Frank Tudor
I'm forwarding this from the php-windows group. (I sent it to
both with the hopes someone with information would see this).

> I have installed Mandrake Linux and it comes standard with
> Apache PHP and MySQL.  You can install all these rpms through
> the server selectionAnyway.
> 
> In my test environment it is function city and of course
> register globals were on.
> 
> Now I have Taked my PHP.INI-DIST  set the globals to on and
> copied it to my /etc directory.
> 
> It worked like a charmbut guess what.  I can't create a
> connection string to my database.  Now I have to find a
> solution
> to get this website to work with globals on and mysql.
> 
> I have tried adding an .htacess with the php globals override
> thing
> 
> 
> php_value "register_globals" "1"
> 
> Ok this didn't work.
> 
> So I found the Mysql-PHP RPM on my mandrake cd (of course
> enabling my php.ini file) and it didn't work.
> 
> I'm getting closer to a solution but I am stuck.  Why won't
> the
> htaccess file work?  I would like to use my php.ini file but
> it
> is not configured for mysql, how could I fix this?  Is there
> anything I can do for either of these two questions to get my
> globals on?
> 
> I swear I will never use functions again if someone helps me.
> 
> :)
> 
> Frank

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



[PHP] PHP and MYSQL don't shake hands

2003-09-18 Thread Frank Tudor
Guys,

I have moved from a foxserv(apache, php, mysql, all in one
install tool) windows test environment to a Linux apache php
mysql setup specifically mandrake linux production server.

The problem I am having is that when I try to pass values to the
database the php fails.

I think I have singled it down to the connection string but I am
not sure.

basically, I have tested the sample code in the book 'beginning
php' by (wrox).

I have made no changes.

I think that the dbhost is the problem.

when I look at the phpinfo page it shows me not localhost but a
'name.com'

so I try $dbhost = 'name.com';

and then i also try $dbhost = 'localhost';

and neither seem to work.

Can anyone tell me what I'm doing wrong?

Here is my sample code:

My db connect include file::



My php sample code:::

";
?>

My error is a white screen

and this is simple code out of the book.

Could it be my dbhost is incorrect. I checked my services and
Mysql is running.

Apache running and parsing other php pages that don't do a db
connect so I'm pretty sure it's the db connect stuff.

Thanks,
Frank

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



[PHP] PHP Apache (GLOBALS) question

2003-09-19 Thread Frank Tudor
I have installed Mandrake Linux and it comes standard with
Apache PHP and MySQL.  You can install all these rpms through
the server selectionAnyway.

In my test environment it is function city and of course
register globals were on.

Now I have Taked my PHP.INI-DIST  set the globals to on and
copied it to my /etc directory.

It worked like a charmbut guess what.  I can't create a
connection string to my database.  Now I have to find a solution
to get this website to work with globals on and mysql.

I have tried adding an .htacess with the php globals override
thing


php_value "register_globals" "1"

Ok this didn't work.

So I found the Mysql-PHP RPM on my mandrake cd (of course
enabling my php.ini file) and it didn't work.

I'm getting closer to a solution but I am stuck.  Why won't the
htaccess file work?  I would like to use my php.ini file but it
is not configured for mysql, how could I fix this?  Is there
anything I can do for either of these two questions to get my
globals on?

I swear I will never use functions again if someone helps me.

:)

Frank

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



RE: [PHP] PHP Apache (GLOBALS) question

2003-09-19 Thread Frank Tudor
I can run mysql from a command line.

What I create a connection string using my php.ini file I get

failure. mysql_connect() errors

My connection string code is very simple:

";
$result2 = mysql_list_tables($db_data[0]);
$num_rows2 = mysql_num_rows($result2);
while($table_data = mysql_fetch_row($result2)) echo "--" .
$table_data[0]. "";
echo "==> $num_rows2 table(s) in " . $db_data[0] . "";
}
?>
 Using this as a test and all my other connection strings
residing on my include file or one the same page as my code
fails.




--- Jay Blanchard <[EMAIL PROTECTED]> wrote:
> [snip]
> I have installed Mandrake Linux and it comes standard with
> Apache PHP and MySQL.  You can install all these rpms through
> the server selectionAnyway.
> 
> In my test environment it is function city and of course
> register globals were on.
> 
> Now I have Taked my PHP.INI-DIST  set the globals to on and
> copied it to my /etc directory.
> 
> It worked like a charmbut guess what.  I can't create a
> connection string to my database.  Now I have to find a
> solution
> to get this website to work with globals on and mysql.
> 
> I have tried adding an .htacess with the php globals override
> thing
> 
> 
> php_value "register_globals" "1"
> 
> Ok this didn't work.
> 
> So I found the Mysql-PHP RPM on my mandrake cd (of course
> enabling my php.ini file) and it didn't work.
> 
> I'm getting closer to a solution but I am stuck.  Why won't
> the
> htaccess file work?  I would like to use my php.ini file but
> it
> is not configured for mysql, how could I fix this?  Is there
> anything I can do for either of these two questions to get my
> globals on?
> 
> I swear I will never use functions again if someone helps me.
> [/snip]
> 
> Actually this sounds like a bunch of mutually exclusive
> things.
> 
> 1. Can you run MySQL from the command line?
> 2. Register_globlas has nothing to do with the connection
> string to
> MySQL
> 3. Can you show us your connection string code?
> 


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



Re: [PHP] PHP Apache (GLOBALS) question

2003-09-19 Thread Frank Tudor
When I remane my php.ini file I get 

/var/lib/mysql/mysql.sock

When I take the .old of the the end of my php.ini.old and put in
my etc directory i don't see any mysql stuff listed.

Frank

--- Marek Kilimajer <[EMAIL PROTECTED]> wrote:
> check your mysql.default_socket setting in php.ini
> 
> Frank Tudor wrote:
> 
> > I can run mysql from a command line.
> > 
> > What I create a connection string using my php.ini file I
> get
> > 
> > failure. mysql_connect() errors
> > 
> > My connection string code is very simple:
> > 
> >  > //list_db.php
> > 
> > $link_id = mysql_connect("localhost", "username",
> "password");
> > $result = mysql_list_dbs($link_id);
> > $num_rows = mysql_num_rows($result);
> > 
> > while($db_data = mysql_fetch_row($result)) {
> > echo $db_data[0]. "";
> > $result2 = mysql_list_tables($db_data[0]);
> > $num_rows2 = mysql_num_rows($result2);
> > while($table_data = mysql_fetch_row($result2)) echo "--" .
> > $table_data[0]. "";
> > echo "==> $num_rows2 table(s) in " . $db_data[0] . "";
> > }
> > ?>
> >  Using this as a test and all my other connection strings
> > residing on my include file or one the same page as my code
> > fails.
> > 
> > 
> > 
> > 
> > --- Jay Blanchard <[EMAIL PROTECTED]>
> wrote:
> > 
> >>[snip]
> >>I have installed Mandrake Linux and it comes standard with
> >>Apache PHP and MySQL.  You can install all these rpms
> through
> >>the server selectionAnyway.
> >>
> >>In my test environment it is function city and of course
> >>register globals were on.
> >>
> >>Now I have Taked my PHP.INI-DIST  set the globals to on and
> >>copied it to my /etc directory.
> >>
> >>It worked like a charmbut guess what.  I can't create a
> >>connection string to my database.  Now I have to find a
> >>solution
> >>to get this website to work with globals on and mysql.
> >>
> >>I have tried adding an .htacess with the php globals
> override
> >>thing
> >>
> >>
> >>php_value "register_globals" "1"
> >>
> >>Ok this didn't work.
> >>
> >>So I found the Mysql-PHP RPM on my mandrake cd (of course
> >>enabling my php.ini file) and it didn't work.
> >>
> >>I'm getting closer to a solution but I am stuck.  Why won't
> >>the
> >>htaccess file work?  I would like to use my php.ini file but
> >>it
> >>is not configured for mysql, how could I fix this?  Is there
> >>anything I can do for either of these two questions to get
> my
> >>globals on?
> >>
> >>I swear I will never use functions again if someone helps
> me.
> >>[/snip]
> >>
> >>Actually this sounds like a bunch of mutually exclusive
> >>things.
> >>
> >>1. Can you run MySQL from the command line?
> >>2. Register_globlas has nothing to do with the connection
> >>string to
> >>MySQL
> >>3. Can you show us your connection string code?
> >>
> > 
> > 
> > 
> > __
> > Do you Yahoo!?
> > Yahoo! SiteBuilder - Free, easy-to-use web site design
> software
> > http://sitebuilder.yahoo.com
> > 
> 


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



Re: [PHP] PHP Apache (GLOBALS) question

2003-09-19 Thread Frank Tudor
I did set my php.ini file in the etc dir and it worked fine.

But there was no mysql listed when I did a phpinfo.php page.

So more specifically, when I ude my php.ini file i have globals
on but mysql_connect failures

When I don't use php.ini files I get globals set to off and
mysql access

in ref. to .htaccess when I put and .htaccess in a dir and make
and enable httpd.conf to use htaccess it errors in the
http_perl.conf and if I try to edit my vhost config file with
the 

php_value "register_globals" "1"

or

php_flag "register_globals" "on"

it failes when i restart my web seerver in the httpd-perl.conf
file

Frank


--- John Nichel <[EMAIL PROTECTED]> wrote:
> Frank Tudor wrote:
> 
> >>It worked like a charmbut guess what.  I can't create a
> >>connection string to my database.  Now I have to find a
> >>solution
> >>to get this website to work with globals on and mysql.
> 
> Register globals has nothing to do with making a connection to
> MySQL. 
> Post your code for the connection please.
> 
> >>I have tried adding an .htacess with the php globals
> override
> >>thing
> >>
> >>
> >>php_value "register_globals" "1"
> >>
> >>Ok this didn't work.
> >>
> >>So I found the Mysql-PHP RPM on my mandrake cd (of course
> >>enabling my php.ini file) and it didn't work.
> >>
> >>I'm getting closer to a solution but I am stuck.  Why won't
> >>the
> >>htaccess file work?  I would like to use my php.ini file but
> 
> What isn't working for .htaccess?  Is Apache configured to
> allow 
> .htaccess files the ability to override php variables?
> 
> >>it
> >>is not configured for mysql, how could I fix this?  Is there
> >>anything I can do for either of these two questions to get
> my
> >>globals on?
> 
> Not that you should turn globals on, but if this is really
> what you want 
> to do, enable it in your php.ini file, and restart your
> webserver.
> 
> >>I swear I will never use functions again if someone helps
> me.
> >>
> >>:)
> >>
> >>Frank
> -- 
> 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
> 


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



Re: [PHP] PHP Apache (GLOBALS) question

2003-09-19 Thread Frank Tudor
Thanks for the response.

Ok with php.ini in the ect directory I get a 

Call to undefined function: mysql_connect() 

Without the php.ini file all my functions fail, because Mandrake
linux has all the latest and greatest apache php and mysql
stuff.  so during that build (which doesn't use the php.ini and
frankly I'm not sure where the php stuff is defined in apache),
because before the php.ini files ended up in the etc directory I
had to modify it from the php.ini-dist from the common lib
directory.  

does this help?

Frank 
--- John Nichel <[EMAIL PROTECTED]> wrote:
> Frank Tudor wrote:
> > Yes to the php-mysql rpm,
> > 
> > But listen I think it was the way it built the initial
> appach
> > php mysql configurations  I don't think the php.ini refects
> an
> > accurate setup of my php mysql setup.
> > 
> > Frank
> 
> Let's get away from the php.ini for a moment.  Being that you
> did 
> everything from RPM, the ini file doesn't come into play here
> (you 
> basically have a default setup, with default settings).  The
> stock 
> php.ini file will do just fine.
> 
> What is the output of this code on your box.
> 
> if ([EMAIL PROTECTED]("your_host", "your_username",
> "your_password")){
>   echo ( mysql_error() );
> } else {
>   echo ( "Connection exists" );
> }
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



[PHP] Re: [PHP-WIN] Re: [PHP] PHP Apache (GLOBALS) question

2003-09-19 Thread Frank Tudor
Also,

On the phpinfo.php

MYSQL_SOCKET /var/lib/mysql/mysql.sock 
MYSQL_INCLUDE -I/usr/include/mysql 
MYSQL_LIBS -L/usr/lib/mysql -lmysqlclient 

ARE MISSING.  

When I run a phpinfo.php page I get all my config info

with my php.ini file put in the etc dir i get no mention of the
above mysql information

with the php.ini file removed or renamed and then running a
phpinfo page I get

MYSQL information in my config file.

So what can I do because the php.ini file just shows config info
I don't think I can modify it to see mysql can I?  doesn't that
have to reply on the rpm install?  or when the php libary was
built?

Frank

--- Frank Tudor <[EMAIL PROTECTED]> wrote:
> Thanks for the response.
> 
> Ok with php.ini in the ect directory I get a 
> 
> Call to undefined function: mysql_connect() 
> 
> Without the php.ini file all my functions fail, because
> Mandrake
> linux has all the latest and greatest apache php and mysql
> stuff.  so during that build (which doesn't use the php.ini
> and
> frankly I'm not sure where the php stuff is defined in
> apache),
> because before the php.ini files ended up in the etc directory
> I
> had to modify it from the php.ini-dist from the common lib
> directory.  
> 
> does this help?
> 
> Frank 
> --- John Nichel <[EMAIL PROTECTED]> wrote:
> > Frank Tudor wrote:
> > > Yes to the php-mysql rpm,
> > > 
> > > But listen I think it was the way it built the initial
> > appach
> > > php mysql configurations  I don't think the php.ini
> refects
> > an
> > > accurate setup of my php mysql setup.
> > > 
> > > Frank
> > 
> > Let's get away from the php.ini for a moment.  Being that
> you
> > did 
> > everything from RPM, the ini file doesn't come into play
> here
> > (you 
> > basically have a default setup, with default settings).  The
> > stock 
> > php.ini file will do just fine.
> > 
> > What is the output of this code on your box.
> > 
> > if ([EMAIL PROTECTED]("your_host", "your_username",
> > "your_password")){
> > echo ( mysql_error() );
> > } else {
> > echo ( "Connection exists" );
> > }
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> 
> 
> __
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design
> software
> http://sitebuilder.yahoo.com
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



  1   2   3   4   5   6   >