[isp-linux] denying access to folders/files

2003-01-08 Thread Darren Bentley
I'm hoping someone can give a little advise.

We have a customer that provides his software via a www address. We've
setup .htaccess on this folder with a single username/password. So he
supplies this user/pass to people that pay to get his software.

He now wants to have control over the username/passwords. He also wants
to have groups so that he can set which programs his customers can
download. He also wants it all logged.

I don't see this happening via .htaccess so I'm thinking of developing a
simple PHP/MYSQL interface.

So the customer comes to a login page, authenticates to a MYSQL
database, is assigned a cookie and is allowed access to which ever
programs his group allows.

This is fine and dandy, but how do I prevent that person from taking the
direct link to the file and giving it to someone else?

I'm sure there is a much better and simpler way. Idea's?

Thanks in advance.

-- 
Darren Bentley <[EMAIL PROTECTED]>


_  The ISP-LINUX Discussion List  _
To Join: mailto:[EMAIL PROTECTED]
To Remove: mailto:[EMAIL PROTECTED]
Archives: http://isp-lists.isp-planet.com/isp-linux/archives/



RE: [PHP-DB] payperiods

2002-11-12 Thread Darren Bentley
Ok, that makes sense. I have all the payperiods specified in a table to
begin with, then just query selecting all >= start && <= end.

Thanks,

- Darren

On Tue, 2002-11-12 at 11:29, Peter Beckman wrote:
> Put the dates for employees into one table.
> 
> In another, put the payperiods.
> 
> You could populate the payperiods table for the next 90 years if you wanted
> if it is always on a 2 week schedule.
> 
> To look at past payperiods:
> 
>   select start, end from payperiods where start = '$querydate';
> 
> Or just date, but you'll have to decide if the date in the payperiod table
> will be the start of the payperiod or end of the payperiod. IE:
> 
>   select date as start,date_add(date,interval 14 day) as end from
>   payperiods where start = '$querydate';
> 
> Then get the employees who put in time between those days, assuming $pp
> contains the row found:
> 
>   select * from timesheets where date>={$pp[start]} and date<{$pp[end]};
> 
> Then you'd have all of the hours employees put in.  Then just sort by
> employee name (add a group by) and/or sum their hours, etc.
> 
> Pretty easy.
> 
> Peter
> 
> 
> On 12 Nov 2002, Darren Bentley wrote:
> 
> > Our payperiods will always be 2 week increments.
> >
> > So if I specify a starting day in the database I need to have that
> > starting day always updated to the current starting day. (when we switch
> > to the new payperiod), so as Jerrad mentioned I could use a cron job.
> >
> > But how would I be able to look at past payperiods? Lets say I want to
> > view a payperiod from September, then this method won't work.
> >
> > I'm trying to automate this so employees don't have to specify dates.
> > They just click the date on the calendar and enter their hours worked
> > per task.
> >
> > Then the accountants can go to a "summaries" page where they can click
> > on the staff member and view any current and past pay periods.
> >
> > This sounded easy when I first started :)
> >
> > Thanks again for the help!
> >
> > --
> > Darren Bentley / Systems Administrator
> > Borealis Internet / 1-800-667-0307
> > Prince George, BC, Canada
> > http://www.pgweb.com
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> 
> -------
> Peter BeckmanSystems Engineer, Fairfax Cable Access Corporation
> [EMAIL PROTECTED] http://www.purplecow.com/
> ---
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
-- 
Darren Bentley / Systems Administrator
Borealis Internet / 1-800-667-0307
Prince George, BC, Canada
http://www.pgweb.com


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




RE: [PHP-DB] payperiods

2002-11-12 Thread Darren Bentley
Our payperiods will always be 2 week increments. 

So if I specify a starting day in the database I need to have that
starting day always updated to the current starting day. (when we switch
to the new payperiod), so as Jerrad mentioned I could use a cron job.

But how would I be able to look at past payperiods? Lets say I want to
view a payperiod from September, then this method won't work.

I'm trying to automate this so employees don't have to specify dates.
They just click the date on the calendar and enter their hours worked
per task.

Then the accountants can go to a "summaries" page where they can click
on the staff member and view any current and past pay periods.

This sounded easy when I first started :)

Thanks again for the help!

-- 
Darren Bentley / Systems Administrator
Borealis Internet / 1-800-667-0307
Prince George, BC, Canada
http://www.pgweb.com


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




[PHP-DB] payperiods

2002-11-12 Thread Darren Bentley
Hello,

I have build a php calendar and want to implement 2 week payperiods so
staff can enter their hours worked. Then I can summarize work done per
pay period.

Any idea what the easiest way to do this is? I could hard code a
starting date into a database, then go up 2 weeks at a time from there.
Is there a better way?

Thanks,

-- 
Darren Bentley / Systems Administrator
Borealis Internet / 1-800-667-0307
Prince George, BC, Canada
http://www.pgweb.com


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




[PHP-DB] Hostname

2002-07-09 Thread Darren Young

Is there a SQL hostname function that'll return the name of the host a db 
is running on? MySQL has the a SYSDATE() function, does anyone know of a 
HOSTNAME() function in SQL and/or MySQL? I know that I can find it either 
from the OS or in PHP, however the need right now is to have it in the SQL 
script itself.

Another one if anyone here is familiar with MySQL. When I do an INSERT 
that contains the SYSDATE() function, it's inserted in GMT. Is there 
possibly a way to have it INSERT in local time (CST)?

Thanks,

Darren Young
[EMAIL PROTECTED]


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




[PHP-DB] php mail problem.

2002-05-07 Thread Darren Stock

Hi, I cannot get the php mail function to work from a web browser, if I run
my script from the linux prompt, containing the mail function, it runs fine,
it sends the mail. But If I run it through my browser it doesn't come back
with any errors, it just doesn't send the mail.
my php.ini file is ok, as it sends the mail from the prompt. Is this a
browser or webserver problem?
I interrogated my mail server, and it doesn't even receive an email message.

im running apache with php on Mandrake 8.2

any help would be appreciated.



Re: [PHP-DB] Function Prolem parse error

2001-11-04 Thread Darren

Dl and everybody else,

Thank you all for your help and patience.


Dl Neil wrote:

 > Darren,
 >
 > We're not really set up to do line-by-line debugging. You may 
need to spend a bit (more) time learning PHP to
 > avoid these sorts of frustrations.

O.K.


Meanwhile ..




Dl Neil wrote:

> Darren,
> 

> When the code is executed it gives a parse error on the line containing 
>value=\"$value">". It would have been
> helpful to have pointed us at that line and told us the error msg (cf "now the next 
>line gets an error").
> 


I'll do my best to inform everybody of the error.  In this case it 
was the same parse error as the other.


> The problem is that the last set of (internal) double-quotes are not 'escaped' and 
>consequently PHP thinks they
> terminate the string to be printed. Otherwise everything seems to be fine.


I was comparing a similar line earlier in the code and it looked 
fine to me. But I'm still learning


I tryed it and I got the same error

The code I used

$output = print("");

return $output;


Thanks

Darren



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




Re: [PHP-DB] Function Prolem parse error

2001-11-04 Thread Darren

Jason,

Thanks alot! now the next line gets an error.

The original code was as follows

$output = <<
EOQ;
return $output;

Then I changed it to

$output = print("");

return $output;

I did this so the code would be compatible with php3 instead of php4 
(what the code was originaly written for.

Thanks for the help, Jason, Dl, and Paul, and anybody else that is 
keeping up with the thread.

Darren

Jason Wong wrote:

> On Monday 05 November 2001 04:45, Darren wrote:
> 
> [snip]
> 
> 
>>// string hidden_field ([string name [, string value]])
>>
>>// This function returns an HTML hidden field. A value may be
>>supplied.
>>
>>function hidden_field ($name="", $value="")
>>{
>>  $output = print(">value=\"$value">");
>>
>>  return $output;
>>}
>>
>>I still don't understand what the fix should be or what is wrong.
>>
> 
> You can just define that function as:
> 
>   function hidden_field($name, $value) {
> blah...
> blah...
>   }
> 
> hth
> 


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




Re: [PHP-DB] Function Prolem parse error

2001-11-04 Thread Darren

Dl,

Thanks for the input an the link to the manuels, there are very 
helpful.  I have looked at them but I don't understand what default 
variables has to do with the listed code.  To give you a better idea 
(if you need it you may not) I'll put a little more of code in for 
context purposes.

// string hidden_field ([string name [, string value]])

// This function returns an HTML hidden field. A value may be supplied.

function hidden_field ($name="", $value="")
{
$output = print("");

return $output;
}

I still don't understand what the fix should be or what is wrong.

Thanks for the help

Darren

Dl Neil wrote:

>>Paul if your there I have another issue similar to the past.  It is 
>>probably a PHP3 to PHP4 problem.
>>
>>Here tis
>>
>>function hidden_field ($name="", $value="")
>>
>>*
>>I have no clue what could be wrong.
>>
> 
> 
> Darren,
> 
> Check out http://uk.php.net/manual/en/functions.php and from there look up "Default 
>Argument Values".
> 
> =dn
> 
> 


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




[PHP-DB] Function Prolem parse error

2001-11-03 Thread Darren

Howdy all

Paul if your there I have another issue similar to the past.  It is 
probably a PHP3 to PHP4 problem.

Here tis

function hidden_field ($name="", $value="")

*
I have no clue what could be wrong.

Thanks

Oh I think I got the rest fixed.  Thanks for the help.  I think I 
have a few left that are after this error, so I'll know for sure 
after I get this taken care of.

I am doing the sight on a Mac (I know its against the grain 
somewhat, but not on purpose)

Thanks

Darren


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




Re: [PHP-DB] "EOQ" what does it mean??

2001-11-03 Thread Darren

Paul,

You are exactly right from what I can tell.  I did you you suggested 
and it worked!  There are several of those in the document.  Looked 
it up in the book and have a limited idea on what it is, and also 
learning from your example I have a better Idea.  But I did a search 
for here docs, on the PHP site and couldn't find anything.  I think 
I can probably figure out the other 6 or 7 in the document but I 
can't figure this on out.


here tis

// This function returns an HTML  tag.

function end_form ()
{
$output = <<
EOQ;

return $output;
}

***
I know this must be simple but I just can't get it yet.  I tried 
experimenting and putting other code in there to replace it but 
nothing has worked... yet.

Thanks again for the help

Darren

PS here is the next one in case you felt like looking at it

// This function returns an HTML text input field. The default size
// of the field is 10. A value and maximum data length for the field
// may be supplied.

function text_field ($name="", $value="", $size=10, $maxlen="")
{
$maxatt = empty($maxlen) ? "" : "maxlength=\"$maxlen\"";
$output = <<
EOQ;
return $output;
}

P.Whiter wrote:

> If you look up 'here doc' in the manual you will see that the reference to
> EOQ below is part of that, you can use whatever you like in place of EOQ, I
> think your problem is that 'here doc' is not supported in php 3
> 
> Try replacing the lines
> 
> $output = << 
> EOQ;
> 
> with
> 
> $output = print("");
> 
> HTH
> Paul
> 
> 
> - Original Message -
> From: "Darren" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> 
> : I bought the bookMySQL/PHP Database Applications by Jay Greenspan
> : and Brad Bulger, and in I discovered some code that I don't
> : understand and I can't find reference to it anywhere. (in the php
> : manuel, book, php website etc.) does anyone know what it means and
> : if it php3 compatible.  It is used in the following code:
> :
> : Here tis
> :
> : // string start_form ([string action [, array attributes]])
> :
> : // This function returns an HTML  tag. If the first argument
> : // is empty, the value of the global Apache variable SCRIPT_NAME
> : // is used for the 'action' attribute of the  tag. Other
> : // attributes for the form can be specified in the optional second
> : // argument; the default method of the form is "post".
> :
> : // The behavior of this function on servers other than Apache is
> : // not known. It's likely that it will work, as SCRIPT_NAME is
> : // part of the CGI 1.1 specification.
> :
> : function start_form ($action="", $atts="")
> : {
> : global $SCRIPT_NAME;
> :
> : if (empty($action)) { $action = $SCRIPT_NAME; }
> :
> : $attlist = get_attlist($atts,array("method"=>"post"));
> : $output = << : 
> : EOQ;
> : return $output;
> : }
> 
> 


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




[PHP-DB] "EOQ" what does it mean??

2001-11-03 Thread Darren

Greetings,

I bought the bookMySQL/PHP Database Applications by Jay Greenspan 
and Brad Bulger, and in I discovered some code that I don't 
understand and I can't find reference to it anywhere. (in the php 
manuel, book, php website etc.) does anyone know what it means and 
if it php3 compatible.  It is used in the following code:

Here tis

// string start_form ([string action [, array attributes]])

// This function returns an HTML  tag. If the first argument
// is empty, the value of the global Apache variable SCRIPT_NAME
// is used for the 'action' attribute of the  tag. Other
// attributes for the form can be specified in the optional second
// argument; the default method of the form is "post".

// The behavior of this function on servers other than Apache is
// not known. It's likely that it will work, as SCRIPT_NAME is
// part of the CGI 1.1 specification.

function start_form ($action="", $atts="")
{
global $SCRIPT_NAME;

if (empty($action)) { $action = $SCRIPT_NAME; }

$attlist = get_attlist($atts,array("method"=>"post"));
$output = <<
EOQ;
    return $output;
}




Thanks for your comments and help in advance


Darren


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




Re: [PHP-DB] Forms error in a catalog by Greenspan & Bulger (sorry line 33)

2001-11-03 Thread Darren


Sorry for the last post it is line 33

As follows

// string start_form ([string action [, array attributes]])

// This function returns an HTML  tag. If the first argument
// is empty, the value of the global Apache variable SCRIPT_NAME
// is used for the 'action' attribute of the  tag. Other
// attributes for the form can be specified in the optional second
// argument; the default method of the form is "post".

// The behavior of this function on servers other than Apache is
// not known. It's likely that it will work, as SCRIPT_NAME is
// part of the CGI 1.1 specification.

function start_form ($action="", $atts="")
{
global $SCRIPT_NAME;

if (empty($action)) { $action = $SCRIPT_NAME; }

$attlist = get_attlist($atts,array("method"=>"post"));
$output = <<
EOQ;
return $output;
}


*

Remember I'm running php3 I'm going to look at the manuel from 
switching  php3 to 4 and see if it mentions anything.

I'm still very new to php

Thanks

Darren



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




Re: [PHP-DB] Forms error in a catalog by Greenspan & Bulger

2001-11-03 Thread Darren

Thanks for the help on the free editors.

Line 31 is blank

The section is as follows:

// string start_form ([string action [, array attributes]])

// This function returns an HTML  tag. If the first argument
// is empty, the value of the global Apache variable SCRIPT_NAME
// is used for the 'action' attribute of the  tag. Other
// attributes for the form can be specified in the optional second
// argument; the default method of the form is "post".

// The behavior of this function on servers other than Apache is
// not known. It's likely that it will work, as SCRIPT_NAME is
// part of the CGI 1.1 specification.

function start_form ($action="", $atts="")
{
global $SCRIPT_NAME;

if (empty($action)) { $action = $SCRIPT_NAME; }

$attlist = get_attlist($atts,array("method"=>"post"));
$output = <<
EOQ;
return $output;
}


What do you think?

Thanks Darren


P.Whiter wrote:

> Hi
> 
> If you get yourself any decent text editor, it will have an option to show
> line numbers.
> 
> Plenty of free editors here:
> 
> http://download.cnet.com/downloads/0,10151,0-4003619-106-0-1-0,00.html?tag=d
> ir
> 
> Personally I use and would recommend 'Ultra-edit'
> 
> It would probably be a good idea to just post the line in question, due to
> line wrapping in mail it is difficult to figure out without going through
> the entire script where your error is.
> 
> HTH
> Paul
> 
>


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




Re: [PHP-DB] Forms error in a catalog by Greenspan & Bulger

2001-11-03 Thread Darren

Excellent!! I'll do it!  I didn't know about the editors.  I'll let 
you know.

Thank you very much!

Darren

P.Whiter wrote:

> Hi
> 
> If you get yourself any decent text editor, it will have an option to show
> line numbers.
> 
> Plenty of free editors here:
> 
> http://download.cnet.com/downloads/0,10151,0-4003619-106-0-1-0,00.html?tag=d
> ir
> 
> Personally I use and would recommend 'Ultra-edit'
> 
> It would probably be a good idea to just post the line in question, due to
> line wrapping in mail it is difficult to figure out without going through
> the entire script where your error is.
> 
> HTH
> Paul
> 
> - Original Message -
> From: "Darren" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, November 03, 2001 8:49 AM
> Subject: [PHP-DB] Forms error in a catalog by Greenspan & Bulger
> 
> 
> : Greetings All!
> :
> : I am working on making a catalog from the example used in "MySQL/PHP
> : Databases Applications" by Jay Greenspan andBrad Bulger.  I am using
> : php3 on the remote unix server.  I had to remain all the php files
> : and there references in the documents from .php to .php3.  I am
> : editing the code in a "simple text"editor.
> :
> : Here is the problem.  I keep getting a Parse error on line 33.
> : Question 1) How are you suposed count the lines? What is the exact
> : definition of a line?
> : Question 2) Can anybody tell me where the error is and or how to fix
> : it?  Enclosed is the code.
> :
> : Thanks very much in advance for any help or comments.
> :
> : Darren
> :
> : Here Tis...
> :
> :  : /*
> : 
> : *** This script from MySQL/PHP Database Applications ***
> : *** by Jay Greenspan and Brad Bulger ***
> : ***  ***
> : ***   You are free to resuse the material in this***
> : ***   script in any manner you see fit. There is ***
> : ***   no need to ask for permission or provide   ***
> : ***   credit.***
> : 
> : */
> :
> : // string start_form ([string action [, array attributes]])
> :
> : // This function returns an HTML  tag. If the first argument
> : // is empty, the value of the global Apache variable SCRIPT_NAME
> : // is used for the 'action' attribute of the  tag. Other
> : // attributes for the form can be specified in the optional second
> : // argument; the default method of the form is "post".
> :
> : // The behavior of this function on servers other than Apache is
> : // not known. It's likely that it will work, as SCRIPT_NAME is
> : // part of the CGI 1.1 specification.
> :
> : function start_form ($action="", $atts="")
> : {
> : global $SCRIPT_NAME;
> :
> : if (empty($action)) { $action = $SCRIPT_NAME; }
> :
> : $attlist = get_attlist($atts,array("method"=>"post"));
> : $output = << : 
> : EOQ;
> : return $output;
> : }
> :
> : // string end_form(void)
> :
> : // This function returns an HTML  tag.
> :
> : function end_form ()
> : {
> : $output = << : 
> : EOQ;
> : return $output;
> : }
> :
> : // string text_field ([string name [, string value [, int size [,
> : int maximum length)
> :
> : // This function returns an HTML text input field. The default size
> : // of the field is 10. A value and maximum data length for the field
> : // may be supplied.
> :
> : function text_field ($name="", $value="", $size=10, $maxlen="")
> : {
> : $maxatt = empty($maxlen) ? "" : "maxlength=\"$maxlen\"";
> : $output = << : 
> : EOQ;
> : return $output;
> : }
> :
> : // string textarea_field([string name [, string value [, int cols [,
> : int rows [, string wrap mode])
> :
> : // This function returns an HTML textarea field. The default size is
> : // 50 columns and 10 rows, and the default wrap mode is 'soft',
> : which means
> : // no hard newline characters will be inserted after line breaks in what
> : // the user types into the field. The alternative wrap mode is 'hard',
> : // which means that hard newlines will be inserted.
> :
> : function textarea_field ($name="", $value="", $cols=50, $rows=10,
> : $wrap="soft")
> : {
> : $output = << :  : wrap="$wrap">$value
> : EOQ;
> : return $output;
> : }
> :
> : // string password_field ([string name [, string value [, in

[PHP-DB] Forms error in a catalog by Greenspan & Bulger

2001-11-02 Thread Darren

Greetings All!

I am working on making a catalog from the example used in "MySQL/PHP 
Databases Applications" by Jay Greenspan andBrad Bulger.  I am using 
php3 on the remote unix server.  I had to remain all the php files 
and there references in the documents from .php to .php3.  I am 
editing the code in a "simple text"editor.

Here is the problem.  I keep getting a Parse error on line 33.
Question 1) How are you suposed count the lines? What is the exact 
definition of a line?
Question 2) Can anybody tell me where the error is and or how to fix 
it?  Enclosed is the code.

Thanks very much in advance for any help or comments.

Darren

Here Tis...

 tag. If the first argument
// is empty, the value of the global Apache variable SCRIPT_NAME
// is used for the 'action' attribute of the  tag. Other
// attributes for the form can be specified in the optional second
// argument; the default method of the form is "post".

// The behavior of this function on servers other than Apache is
// not known. It's likely that it will work, as SCRIPT_NAME is
// part of the CGI 1.1 specification.

function start_form ($action="", $atts="")
{
global $SCRIPT_NAME;

if (empty($action)) { $action = $SCRIPT_NAME; }

$attlist = get_attlist($atts,array("method"=>"post"));
$output = <<
EOQ;
return $output;
}

// string end_form(void)

// This function returns an HTML  tag.

function end_form ()
{
$output = <<
EOQ;
return $output;
}

// string text_field ([string name [, string value [, int size [, 
int maximum length)

// This function returns an HTML text input field. The default size
// of the field is 10. A value and maximum data length for the field
// may be supplied.

function text_field ($name="", $value="", $size=10, $maxlen="")
{
$maxatt = empty($maxlen) ? "" : "maxlength=\"$maxlen\"";
$output = <<
EOQ;
return $output;
}

// string textarea_field([string name [, string value [, int cols [, 
int rows [, string wrap mode])

// This function returns an HTML textarea field. The default size is
// 50 columns and 10 rows, and the default wrap mode is 'soft', 
which means
// no hard newline characters will be inserted after line breaks in what
// the user types into the field. The alternative wrap mode is 'hard',
// which means that hard newlines will be inserted.

function textarea_field ($name="", $value="", $cols=50, $rows=10, 
$wrap="soft")
{
$output = <<$value
EOQ;
return $output;
}

// string password_field ([string name [, string value [, int size 
[, int maximum length)

// This function returns an HTML password field. This is like a text 
field,
// but the value of the field is obscured (only stars or bullets are 
visible
// for each character).  The default size of the field is 10.  A 
starting
// value and maximum data length may be supplied.

function password_field ($name="", $value="", $size=10, $maxlen="")
{
$output = <<
EOQ;
return $output;
}

// string hidden_field ([string name [, string value]])

// This function returns an HTML hidden field. A value may be supplied.

function hidden_field ($name="", $value="")
{
$output = <<
EOQ;
return $output;
}

// string file_field ([string name])

// This function returns an HTML file field. These are used to specify
// files on the user's local hard drive, typically for uploading as
// part of the form. (See 
http://www.zend.com/manual/features.file-upload.php
// for more information about this subject.)

function file_field ($name="")
{
$output = <<
EOQ;
return $output;
}

// string submit_field ([string name [, string value]])

// This function returns an HTML submit field. The value of the field
// will be the string displayed by the button displayed by the user's
// browser. The default value is "Submit".

function submit_field ($name="", $value="")
{
if (empty($value)) { $value = "Submit"; }

$output = <<
EOQ;
return $output;
}

// string image_field ([string name [, string src [, string value]]])

// This function returns an HTML image field. An image field works
// likes a submit field, except that the image specified by the URL
// given in the second argument is displayed instead of a button.

function image_field ($name="", $src="", $value="")
{
if (empty($value)) { $value = $name; }

$output = <<
EOQ;
return $output;
}

// string reset_field ([string name [, string value]])

// This function returns an HTML reset field. A reset field returns
// the c

[PHP-DB] newbie - correct use of Grant in mysql

2001-08-28 Thread Darren Smith

Hello

I know this is off topic but I have tried  at the mysql newsgroup/mailing
list but the just ignored me and you all seem like such nice people :)

I am setting up a kind of PHP guestbook that will allow the user to log in
and update their details.

Should I create a new user using grant for ever (unique) person in the
guestbook so that way they only have the rights to alter certain specified
fields of their own data or do I create one user for everyone with the right
to alter particular fields in the table.

I suspect the former but this may give me thousands (Or even more) mysql
users - it is a very popular guestbook.  Is this normal?  Is their a limit
on the
amount of users?

Please let me know if I have got this all wrong :)

Thanks in advance for your time

Darren Smith
[EMAIL PROTECTED]




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




RE: [PHP-DB] upload problem ...

2001-07-13 Thread Darren Casey

> -Original Message-
> From: Steve Brett [mailto:[EMAIL PROTECTED]]
> Sent: 13 July 2001 11:05
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] upload problem ...
>
>
> many thanks i'll try that asap.

The directorys will still need the permissions set so anyone can read/write
to the directorys (Using chmod if using linux)

Darren


>
> Steve
>
> "Xsarus Internetdiensten" <[EMAIL PROTECTED]> wrote in message
> 002901c0fe68$48613d40$0201a8c0@xsarusxsarus2">news:002901c0fe68$48613d40$0201a8c0@xsarusxsarus2...
> > He!
> >
> > Don't use the function 'copy', but 'move_uploaded_file'.
> >
> > Ready...
> > Daniel Kieviet
> > Xsarus Internetdiensten
> > Holland
> > [EMAIL PROTECTED]
> >
> >
> > - Original Message -
> > From: "Andre P." <[EMAIL PROTECTED]>
> > To: "Steve Brett" <[EMAIL PROTECTED]>
> > Cc: "php-db@lists. php. net (E-mail)" <[EMAIL PROTECTED]>
> > Sent: Monday, June 25, 2001 6:17 AM
> > Subject: Re: [PHP-DB] upload problem ...
> >
> >
> > > Steve,
> > >
> > > When you use input type=file the web server uploads the file to a
> > > temporary directory which it must have write access to, i.e. the user
> > > that the httpd process is run as must have write access to /php/tmp.
> > >
> > > To my knowledge there is no way of allowing the httpd process to write
> > > to that directory using your ftp users/password. Bear in mind that you
> > > could change the temporary upload directory from /php/tmp to /tmp.
> > >
> > > do you have full access to you box or only an account?
> > >
> > > hope this helps
> > >
> > > ciao
> > > Andre.
> > >
> > > Steve Brett wrote:
> > >
> > > >hi,
> > > >
> > > >i have a site and need to write a script to upload /
> download files so
> > the
> > > >database can be updated / backed up.
> > > >
> > > >i've tried setting up an  fine on my
> > > >machine but php gives an eror onthe server saying that the
> /php/tmp dir
> > > >cannot be written to by, i assume, the nobody account within
> whihc the
> > web
> > > >server runs.
> > > >
> > > >i need  to be bale to write to the httpd dir using php and then i can
> get
> > > >the db to import the files.
> > > >
> > > >i have an ftp username and password but don't know how to get php to
> pass
> > > >the authorisation the server. the site is already password protected
> just
> > > >using a table of username / passowrds.
> > > >
> > > >many thanks in advance
> > > >
> > > >Steve
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> > > --
> > > PHP Database Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> > >
> >
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


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




RE: [PHP-DB] PHP Mysql apache economy hosting

2001-07-13 Thread Darren Casey

> Hello,
> can anyone recommend a good
> PHP4/ Mysql/ apache/Unix-Linux economy web hosting co.?
> what should I look for?
> how do I verify uptime?

http://www.php4hosting.com (Root access to MySQL on most accounts, latest
versions of PHP/MySQL)

Free hosts listed at http://www.alt-php-faq.org/links.htm

Regards
Darren


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




Re: [PHP-DB] Am I missing something important here ?

2001-05-24 Thread Darren


"annabelle.imray" <[EMAIL PROTECTED]> wrote in message
9ehff1$jda$[EMAIL PROTECTED]">news:9ehff1$jda$[EMAIL PROTECTED]...
> I have been given an example of how to use php & mysql from a hosting
> company.  They have the following function:
>
> #
> function ExecuteQuery ($linkdb, &$queryresult, $querytext) {
>
>  $queryresult = mysql_query($querytext, $linkdb);
>
>   if (($queryresult != false) and (mysql_errno() == 0)) {
>   return true;
>  } else {
>   return false;
>  }
> }
> #
>
> And an example of it's usage:
>
>
> $query = "SELECT * FROM test";
>
>  if ($mysql_result = mysql_query($query, $linkdb)) {
>   if (ExecuteQuery($linkdb, $result, $query)) {
>while ($row = NextRow($result)) {
> print('"'.$row[1].'" : "'.$row[2].'"');
>}
>   }
>   }
>
> Can anyone tell me why the first "if" exists in their usage example, e.g.
if
> ($mysql_result = mysql_query($query, $linkdb)) {
>
> As the $mysql_result variable is not used after this statement and the
query
> is performed again in the ExecuteQuery() function;
>
> As I have said, am I missing something important here?
>
> Thanks


What wasteful code. It seems to execute the same query twice

It would be more practical to return the result of the query in the function
then you can remove the first 'if' then

good luck




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




Re: [PHP-DB] PHP accessing MySQL

2001-05-18 Thread Darren

I think the 0 is referring to your $db_num
"Jonathan Duncan" <[EMAIL PROTECTED]> wrote in message
9e3suq$17r$[EMAIL PROTECTED]">news:9e3suq$17r$[EMAIL PROTECTED]...
> I am making a script to access MySQL and when I run it I get this:
>
> Warning: 0 is not a MySQL link index in
/sites/htdocs/php/db_listtables.php
> on line 10
>
> Following is the first 10 lines of my script:
>
>$connection = mysql_connect("localhost", "user", "password") or
> die("Couldn't connect.");
>   $dbs = mysql_list_dbs($connection) or die("Couldn't list databases.");
>   $db_list = "";
>   $db_num = 0;
>   while ($db_num < mysql_num_rows($dbs)) {
> $db_names[$db_num] = mysql_tablename($dbs, $db_num);
>  $db_list .= "$db_names[$db_num]";
>  if (($db_names[$db_num] != "mysql") && ($db_names[$db_num] !=
"tempdata"))
> {
>$tables = mysql_list_dbs($db_names[$db_num]) or die("Couldn't list
> databases.");
>
> Any Ideas?  Thank you in advance!!
>
> Jonathan
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



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




[PHP-DB] PHP, ADO/ODBC and MS Access 97 Queries

2001-03-19 Thread Christie, Darren

Can anyone give me any pointers on how I can execute queries in MS Access97
from PHP and get the results back using either ADO or ODBC?
 
Thanks in advance
 
Darren

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