Re: [PHP] Cookies - good or bad???

2002-07-19 Thread Philippe Saladin
If you want 100% accessability, forget cookies were ever invented :) While you're erasing stuff from your brain, throw out javascript too :D Some people don't have a fast access to internet. Very simple javascript to validate a form before submitting it can be IMHO still useful. But I agree

Re: [PHP] Password in script

2002-07-19 Thread Michael Hall
Actually, there is Banother way and you should consider it. Sensitive information like passwords should be kept in a file stored outside the live web content directory (ie, outside DocumentRoot on Apache). This file can then be included in your main file. This way, you can be sure that a

Re: [PHP] Password in script

2002-07-19 Thread Michael Hall
The GRANT USAGE statement creates a user with no priveleges ... the user exists but can't do anything. See MySQL Manual section 6.13 Michael On Fri, 19 Jul 2002, Sailom wrote: I just checked grant and it said something like... GRANT USAGE ON *.* TO 'X'@'%' IDENTIFIED BY .

[PHP] Why won't this work?

2002-07-19 Thread John Wulff
Any ideas on why this won't work? It will only include(inc/entrance.php) It never, no matter what the value of $mode, displays collection.php. ?php $mode = entrance; if ($mode = entrance) { include(inc/entrance.php); } else if ($mode = collection) {

Re: [PHP] Why won't this work?

2002-07-19 Thread Mantas Kriauciunas
Hello John, Friday, July 19, 2002, 12:25:12 AM, you wrote: JW Any ideas on why this won't work? It will only include(inc/entrance.php) JW It never, no matter what the value of $mode, displays collection.php. thinking logicaly: JW?php JW$mode = entrance; $mode is entrance JW

Re: [PHP] Why won't this work?

2002-07-19 Thread Rasmus Lerdorf
You need == instead of = there On Fri, 19 Jul 2002, John Wulff wrote: Any ideas on why this won't work? It will only include(inc/entrance.php) It never, no matter what the value of $mode, displays collection.php. ?php $mode = entrance; if ($mode = entrance) {

[PHP] Re: Why won't this work?

2002-07-19 Thread Monty
Well, first thing I see is that you need to change this: if ($mode == entrance) You need the double equal signs for string comparison. From: [EMAIL PROTECTED] (John Wulff) Newsgroups: php.general Date: Fri, 19 Jul 2002 00:25:12 -0700 To: [EMAIL PROTECTED] Subject: Why won't this

Re: [PHP] Why won't this work?

2002-07-19 Thread René Moonen
You probably do not have a background of C / C++ programming ;-) assignments:single equal sign comparison:dual equal sign The *assignments* in your if statements are always TRUE, so it will always execute the statements after the first *if* So use if ($mode == entrance) { and

Re[2]: [PHP] Why won't this work?

2002-07-19 Thread Mantas Kriauciunas
Hello Rasmus, Friday, July 19, 2002, 12:26:45 AM, you wrote: RL You need == instead of = there RL On Fri, 19 Jul 2002, John Wulff wrote: Any ideas on why this won't work? It will only include(inc/entrance.php) It never, no matter what the value of $mode, displays collection.php. ?php

[PHP] Sablotron confusion

2002-07-19 Thread Michael Hall
I've just downloaded a bunch of stuff from www.gingerall.org, which I hope will set up Sablotron on my RH7.2/Apache1.3.24/PHP4.2.1 box. Can I just use the rpms?: sablotron-0.95-1.i386.rpm sablotron-devel-0.95-1.i386.rpm There is also a Sablot-0.95-PHP.patch in there, plus a Sablot-0.95.tar.gz

[PHP] Re: get line from file

2002-07-19 Thread Peter
You can try this. ?PHP $datafile = file(...); // Here comes your filename for ($k=0; $k=count($datafile)-1; $k++) { echo $datafile[$k]br; // Display each line read from datafile } ? Yamin Prabudy [EMAIL PROTECTED] schreef in bericht [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I got a

[PHP] Getting name of referenced variable into string

2002-07-19 Thread Monty
Is there a way to get and store the name of a referenced variable into another variable? Example... $varname = blah; checkit($varname); function checkit($name) { ...code... } In the function above, I'd like to find out the name of the referenced variable (pointed to by $name) which should

Re: [PHP] Re: get line from file

2002-07-19 Thread Michael Hall
I think more info is probably needed here. Is it always the literal string line3 that you want to catch, or always the second last line? Some kind of regular expression solution is probably what you need. Michael On Fri, 19 Jul 2002, Peter wrote: You can try this. ?PHP $datafile =

Re: [PHP] Re: get line from file

2002-07-19 Thread Jason Wong
On Friday 19 July 2002 15:43, Peter wrote: You can try this. ?PHP $datafile = file(...); // Here comes your filename for ($k=0; $k=count($datafile)-1; $k++) { echo $datafile[$k]br; // Display each line read from datafile } ? foreach ($datafile as $line) { echo $linebr; }

Re: [PHP] Re: Searching...

2002-07-19 Thread Jason Wong
On Friday 19 July 2002 14:08, David Robley wrote: You might consider running the first query just to get a COUNT(), rather than extracting all the resulting rows and using mysql_numrows to determine how many were returned Am I missing something? If you do a COUNT() in the query then, in

Re: [PHP] Why won't this work?

2002-07-19 Thread jusob
En réponse à Mantas Kriauciunas [EMAIL PROTECTED]: Hi You use = instead of == So, the first condition is always true Regards Julien Hello John, Friday, July 19, 2002, 12:25:12 AM, you wrote: JW Any ideas on why this won't work? It will only include(inc/entrance.php) JW It never, no

RE: [PHP] best way to delete char# 4-7 from a string?

2002-07-19 Thread joakim . andersson
From: Justin French [mailto:[EMAIL PROTECTED]] Sent: Friday, July 19, 2002 7:39 AM To: php Subject: [PHP] best way to delete char# 4-7 from a string? Hi, Let's say I have the following string: $str = 'abcdefghijklmnop'; ...and I want to strip out char #'s 4 through to 7

Re: [PHP] Why won't this work?

2002-07-19 Thread René Moonen
snip $mode = entrance; if ($mode == entrance) { /snip I suppose you added the first line ($mode = entrance; ) for testing purposes during debugging, but in order for the script to work you should now remove it, because now $mode will always have

[PHP] pdflib

2002-07-19 Thread Joey
Hello, can you tell me what i have to do to generate more than one pdf document with pdflib. At the moment i am not able to do this. the only thing i can do is actually to make one pdf. It is really important for me to bring more sites in one document. the problem is not solved if i just make

Re: [PHP] Why won't this work?

2002-07-19 Thread René Moonen
hmm... seems a MySQL topic. I suppose that your table is filled with correct data at some other point. So what you need is a count query that returns *one* result and not all records in that table. You do not want a *while* loop in your PHP script, because that would show a list of unique ips.

[PHP] How to Detect File in a Specifc Directory on Window Env?

2002-07-19 Thread Jack
Dear all I had a folder which contains a lot of pdf file, the name format of the pdf files are : x.dateformat.pdf (eg : abcdefg.20020718.pdf). Now i want to use the php script to detect what files it got in a specific folder. i want to make a user input form which will let user to input the

RE: [PHP] How to Detect File in a Specifc Directory on Window Env?

2002-07-19 Thread Wouter van Vliet
I'd use something like: ?php $handle=opendir('.'); while (false!==($file = readdir($handle))) { if ($file != . $file != ..) { echo $file\n; } } closedir($handle); ? to retrieve dir listing. If you make a function from it, which you'll give a path for argument you can make the

[PHP] Re: How to Detect File in a Specifc Directory on Window Env?

2002-07-19 Thread Johan Holst Nielsen
?php //DATEFORMAT MMDD if($dir=@opendir(/yourdirwithpdf)) { echo Found following files: while(($file=readdir($dir))!==false) { if(ereg(^[a-zA-Z0-9]+\.$INPUTDATE\.pdf)) { echo 'a href='.$file.''.$file.'\n'; } } } ? UPS if(ereg(^[a-zA-Z0-9]+\.$INPUTDATE\.pdf,

RE: [PHP] Why won't this work?

2002-07-19 Thread joakim . andersson
From: René Moonen [mailto:[EMAIL PROTECTED]] Sent: Friday, July 19, 2002 11:01 AM $result = mysql_query(SELECT COUNT(DISTINCT IP) AS ips FROM ma_counter); You _might_ need to add GROUP BY ip (without quotes) to the end of that query. Disclaimer: code not tested. You might want to check

[PHP] Re: How to Detect File in a Specifc Directory on Window Env?

2002-07-19 Thread Johan Holst Nielsen
Johan Holst Nielsen wrote: ?php //DATEFORMAT MMDD if($dir=@opendir(/yourdirwithpdf)) { echo Found following files: while(($file=readdir($dir))!==false) { if(ereg(^[a-zA-Z0-9]+\.$INPUTDATE\.pdf)) { echo 'a href='.$file.''.$file.'\n'; } } } ? UPS

[PHP] Re: How to Detect File in a Specifc Directory on Window Env?

2002-07-19 Thread Johan Holst Nielsen
Jack wrote: Dear all I had a folder which contains a lot of pdf file, the name format of the pdf files are : x.dateformat.pdf (eg : abcdefg.20020718.pdf). Now i want to use the php script to detect what files it got in a specific folder. i want to make a user input form which will let

Re: [PHP] Why won't this work?

2002-07-19 Thread René Moonen
Well if you *know* your query only returns one row or you are just interessed in the first row, just forget about the while construction $result = mysql_query(SELECT id FROM ma_users WHERE user='$PHP_AUTH_USER'); $id=mysql_fetch_row($result) print $id; Good luck René John Wulff wrote:

Re: [PHP] Why won't this work?

2002-07-19 Thread René Moonen
Eh.. probably should be: $result = mysql_query(SELECT id FROM ma_users WHERE user='$PHP_AUTH_USER'); $row=mysql_fetch_row($result) print $row['id']; René René Moonen wrote: Well if you *know* your query only returns one row or you are just interessed in the first row, just forget about

Re: [PHP] ErrorDocument 404 Form

2002-07-19 Thread Fabien Penso
Peter a écrit : If you removed the ErrorDocument 404 /phpinfo.php from the apache conf (or reset it to original value), what happens? Do you get a standard 404 not found error page? Sure. But it's an apache problem, it drops the body as soon as you do have a 404 error. Sux :p --

[PHP] Re: Help with sockets

2002-07-19 Thread Stephen Brewster
1) you use whats called an Itterative Server Model. That is to say you create an list of all the sockets you are using and pass them to socket_select (http://www.php.net/manual/en/function.socket-select.php) and it will tell you which ones are ready to be read from, which can be written to and

[PHP] Speed Question

2002-07-19 Thread JJ Harrison
if I do this: if(validate($_POST['password'], $_POST['username']) != 0) echo validate($_POST['password'], $_POST['username']); will it execute the function twice or use the same result twice? would it be (slightly) faster to do this: $uid = validate($_POST['password'], $_POST['username'])

Re: [PHP] Speed Question

2002-07-19 Thread Jason Wong
On Thursday 18 July 2002 19:32, JJ Harrison wrote: if I do this: if(validate($_POST['password'], $_POST['username']) != 0) echo validate($_POST['password'], $_POST['username']); will it execute the function twice or use the same result twice? Function executes twice. would it be

Re: [PHP] Re: Searching...

2002-07-19 Thread David Robley
In article [EMAIL PROTECTED], php- [EMAIL PROTECTED] says... On Friday 19 July 2002 14:08, David Robley wrote: You might consider running the first query just to get a COUNT(), rather than extracting all the resulting rows and using mysql_numrows to determine how many were returned Am

[PHP] systematic glitch in pages due to cache?

2002-07-19 Thread Simon De Deyne
hello everybody, I have a real problem, and a vague description to it (can you guess?: newbie). I've created a site which retrieves a word from a database and displays it. The user enters another word (a translation) which is checked against the solution and feedback is given. These words are

[PHP] Re: Arrays and Regs

2002-07-19 Thread Martin Clifford
Firstly, many thanks to Richard and Dan... A quick test script in PHP would have been faster than asking... :-) It was just one of those questions that I had burning in my mind at the time, and since I don't have access to PHP at work (As if the Government would allow that!), I had to ask :o)

[PHP] Translatting php to binary...

2002-07-19 Thread Kondwani Spike Mkandawire
PHP is a scripting language I am pretty much aware of that... But is there a way to translate php into binary/machine code or would one have to write a translator program? Kondwani... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Speed Question

2002-07-19 Thread JJ Harrison
thx Jason Wong [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Thursday 18 July 2002 19:32, JJ Harrison wrote: if I do this: if(validate($_POST['password'], $_POST['username']) != 0) echo validate($_POST['password'], $_POST['username']); will it

RE: [PHP] Translatting php to binary...

2002-07-19 Thread Jay Blanchard
[snip] PHP is a scripting language I am pretty much aware of that... But is there a way to translate php into binary/machine code or would one have to write a translator program? [/snip] PHP has an underlying binary translator, but I don't think that the source code is available from Zend. Are

[PHP] Please help with Array..

2002-07-19 Thread Wee Keat
Hi all how are yas? I have one question for which I could not find the answer: How do I remove an element of an array with a specific key or index? To be clearer: Lets say I have an array $shoppingCart[] (quite a lot of them) I want to delete $shoppingCart[345]