[PHP-DB] file upload array problem

2002-12-20 Thread Seabird
Hi everyone,

every time I try to upload a picture I get the same problem in return. First
of all, it's not being uploaded (but this is for later concern I'm afraid).
Trying to display the info of the (not)uploaded file should be done with:

$_FILES['picture']['name']

but every time I run this the return is a error like this:

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
`T_NUM_STRING' in c:\apache\htdocs\seabird.jmtech.ca\otf.com\submit.php on
line 69

If I leave out the qoutes it runs fine but my output (echo) is Array['name']

Running a FILES list gives correct names and everything. Where did this go
wrong??

Here's my code aswell please help me, don't point me to another website
or manual (have read a dozen, and I'm still stuck).

if ($_POST[submit]) {

$link = mysql_pconnect("localhost","myuser","mypass");
$db = test;
mysql_select_db($db,$link);

$query = "INSERT INTO inventory
(registration,type,total_time,price,description,picture_name)
VALUES
('$_POST[registration]','$_POST[type]','$_POST[total_time]','$_POST[price]',
'$_POST[description]','$_FILES[picture]')";

exec("cp $_FILES[picture]
http://localhost/seabird.jmtech.ca/otf.com/images/$_FILES[picture][name]";);

mysql_query( $query, $link);
print 'Thank youYou have submitted the following information:';
echo "Registration: $_POST[registration]\n";
echo "Type: $_POST[type]\n";
echo "Total Time: $_POST[total_time]\n";
echo "Price: $_POST[price]\n";
echo "Description: $_POST[description]\n";
echo "temp file: $_FILES[picture]\n";
echo "file name: $_FILES[picture][name]\n";
echo "file size: $_FILES[picture][size]\n";
echo "file type: $_FILES[picture][type]\n";
echo "\n";
echo "\n";
}
else { ?>

  Registration


type


total time


price


Description


picture


  

";
print_r($_FILES);  // or use print_r($_POST) if you are using a POST instead
of a GET method for your form
echo "";
?>

--
http://seabird.jmtech.ca

Attitude is Everything!
But Remember, Attitudes are Contagious!
Is Yours worth Catching



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




Re: [PHP-DB] form validation

2002-12-20 Thread Manuel Lemos
Hello,

On 12/20/2002 12:25 PM, Mignon Hunter wrote:

I am developing a db form that gets passed to another form.  I need to
validate the fields in form(1), before passing on.  The form action
posts to form(2), so that upon hitting submit - form(2) shows up in
browser...(the only way I know how to do this). 

I am trying to use php to validate.  I have been googling and checking
books and archives for 2 days and all examples use the same file to post
to.  In other words, form1.php uses form action="form1.php".  But I need
it to be form(2), but I still need to validate.

Does anyone have any ideas, or does everyone just use javascript with
say...alert boxes.  This will be my last resort.  

You may want to use this class that does exactly what you need.

--

Regards,
Manuel Lemos


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




Re: [PHP-DB] Newbie PHP/MySQL question

2002-12-20 Thread Seabird
LOL, Jason, you actually had me go back to the first post to re-read it for
a link or some code...

good skills there Jason,

Jacco
--
http://seabird.jmtech.ca

Attitude is Everything!
But Remember, Attitudes are Contagious!
Is Yours worth Catching
"Jason Wong" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Saturday 21 December 2002 01:11, Matt Matijevich wrote:
> > I am just getting started with php an mysql.
> >
> > When I try to insert a record php get stuck in some kind of loop and
> > about 25 records are created.  Any help would be greatly appreciated.
> >
> > Windows 2000 server latest service pack.
> > PHP 4.2.3
> > MySql 3.23
> > IIS 5.0
>
> My mind reading skills aren't very good, but I think there's something
wrong
> with line 13 of your program.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
>
> /*
> The greatest disloyalty one can offer to great pioneers is to refuse to
> move an inch from where they stood.
> */
>



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




[PHP-DB] Aliasing and Grouping (multiple keyword search)

2002-12-20 Thread Kevin Stone
I followed an online tutorial (url below) to create a simple indexed keyword
search.  The sample as outlined in the tutorial was designed to work with
one keyword only.  I am an experienced PHP programmer with some SQL
experience but only simple queries.  This Aliasing and Grouping is brand new
to me.  What I would like to learn how to do is expand this SQL query to
search for multiple keywords.  The PHP side of things is already taken care
of.  Any help (code, other tutorials, book references, whatever) with the
SQL will be greatly appreciated.

Tutorial at:
http://www.onlamp.com/pub/a/php/2002/10/24/simplesearchengine.html





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




[PHP-DB] Threading

2002-12-20 Thread Chris Payne
Hi there everyone,

Thanks to everyone for their tips and advice on the threading issue.  I really don't 
want to use other software because I want to learn from doing it in my own software, 
so i'm going to take apart from i've done so far and play and see what I can do, if 
you see a guy crying on here later with no hair left you'll know i've gone insane from 
PHP and MySQL :-)

Chris



RE: [PHP-DB] Theory help needed

2002-12-20 Thread Matthew Moldvan
I would recommend phpBB ... very useful and best of all, FREE! :)

http://www.phpBB.com



-Original Message-
From: Boaz Yahav [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 20, 2002 12:02 PM
To: Chris Payne; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Theory help needed


why not use one of the existing forum software?

phorum?
FUDForum?


Sincerely

berber

Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.


-Original Message-
From: Chris Payne [mailto:[EMAIL PROTECTED]] 
Sent: Friday, December 20, 2002 6:24 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Theory help needed


Hi there everyone,

I have a messageboard which works, but what I need is some kind of
threading for it.  Right now I have EXTREMELY basic threading, where you
can reply to a message, reply to replies etc . and they'll appear in
the correct part of the messageboard.  What I need though is to be able
to do proper threading, where each reply appears under the original
message and not all over the place, but i'm confused as hell.

Anyway have any experience with this kind of thing and can give me a
push in the right direction?  I know I need to store the original ID,
the forum ID, the message ID of the current message and the ID it
relates to, but it's getting confusing :-)

Thanks.

Chris

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

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




RE: [PHP-DB] Newbie PHP/MySQL question

2002-12-20 Thread Matthew Moldvan
lol ... sorry but that was just funny

:-D

Regards,
Matthew Moldvan

---
 System Administrator
 Trilogy International, Inc
 http://www.trilogyintl.com/ecommerce/
---

-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 20, 2002 12:24 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Newbie PHP/MySQL question


On Saturday 21 December 2002 01:11, Matt Matijevich wrote:
> I am just getting started with php an mysql.
>
> When I try to insert a record php get stuck in some kind of loop and
> about 25 records are created.  Any help would be greatly appreciated.
>
> Windows 2000 server latest service pack.
> PHP 4.2.3
> MySql 3.23
> IIS 5.0

My mind reading skills aren't very good, but I think there's something wrong

with line 13 of your program.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *


/*
The greatest disloyalty one can offer to great pioneers is to refuse to
move an inch from where they stood.
*/


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



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


RE: [PHP-DB] Newbie PHP/MySQL question

2002-12-20 Thread NIPP, SCOTT V (SBCSI)
I would say his problem is the IIS 5.0.  Switch to some non-MS
operating system running Apache as a web server and that should clear up
your problems.  :)

-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 20, 2002 11:24 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Newbie PHP/MySQL question


On Saturday 21 December 2002 01:11, Matt Matijevich wrote:
> I am just getting started with php an mysql.
>
> When I try to insert a record php get stuck in some kind of loop and
> about 25 records are created.  Any help would be greatly appreciated.
>
> Windows 2000 server latest service pack.
> PHP 4.2.3
> MySql 3.23
> IIS 5.0

My mind reading skills aren't very good, but I think there's something wrong

with line 13 of your program.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *


/*
The greatest disloyalty one can offer to great pioneers is to refuse to
move an inch from where they stood.
*/


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

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




Re: [PHP-DB] Newbie PHP/MySQL question

2002-12-20 Thread Jason Wong
On Saturday 21 December 2002 01:11, Matt Matijevich wrote:
> I am just getting started with php an mysql.
>
> When I try to insert a record php get stuck in some kind of loop and
> about 25 records are created.  Any help would be greatly appreciated.
>
> Windows 2000 server latest service pack.
> PHP 4.2.3
> MySql 3.23
> IIS 5.0

My mind reading skills aren't very good, but I think there's something wrong 
with line 13 of your program.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *


/*
The greatest disloyalty one can offer to great pioneers is to refuse to
move an inch from where they stood.
*/


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




[PHP-DB] Newbie PHP/MySQL question

2002-12-20 Thread Matt Matijevich
I am just getting started with php an mysql.

When I try to insert a record php get stuck in some kind of loop and
about 25 records are created.  Any help would be greatly appreciated.

Windows 2000 server latest service pack.
PHP 4.2.3
MySql 3.23
IIS 5.0

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




Re: [PHP-DB] Theory help needed

2002-12-20 Thread Chris Barnes
i'm not experienced so this is just a theory.

if you have a parent id field in your tables then each reply would have
the parent id of the original message they replied to, so when your
program gets the data it will get the original message, and then get any
other messages with the same parent id, then it would move on and get
the next original message...etc.

e.g.
to get original message:

select message_body,message_id from message_table

then to get the threads of the original message:

select message_body,message_id from message_table where
parent_id=[message_id of original message]

i know thats a vague description but its an idea...i guess..


On Fri, 2002-12-20 at 15:23, Chris Payne wrote:
> Hi there everyone,
> 
> I have a messageboard which works, but what I need is some kind of threading for it. 
> Right now I have EXTREMELY basic threading, where you can reply to a message, reply 
>to replies etc . and they'll appear in the correct part of the messageboard.  
>What I need though is to be able to do proper threading, where each reply appears 
>under the original message and not all over the place, but i'm confused as hell.
> 
> Anyway have any experience with this kind of thing and can give me a push in the 
>right direction?  I know I need to store the original ID, the forum ID, the message 
>ID of the current message and the ID it relates to, but it's getting confusing :-)
> 
> Thanks.
> 
> Chris




signature.asc
Description: This is a digitally signed message part


RE: [PHP-DB] Theory help needed

2002-12-20 Thread Boaz Yahav
why not use one of the existing forum software?

phorum?
FUDForum?


Sincerely

berber

Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.


-Original Message-
From: Chris Payne [mailto:[EMAIL PROTECTED]] 
Sent: Friday, December 20, 2002 6:24 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Theory help needed


Hi there everyone,

I have a messageboard which works, but what I need is some kind of
threading for it.  Right now I have EXTREMELY basic threading, where you
can reply to a message, reply to replies etc . and they'll appear in
the correct part of the messageboard.  What I need though is to be able
to do proper threading, where each reply appears under the original
message and not all over the place, but i'm confused as hell.

Anyway have any experience with this kind of thing and can give me a
push in the right direction?  I know I need to store the original ID,
the forum ID, the message ID of the current message and the ID it
relates to, but it's getting confusing :-)

Thanks.

Chris

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




[PHP-DB] net cafe software

2002-12-20 Thread Chris Barnes
Hi,
I'm looking for some net cafe style software written in PHP, which would
preferably use MySQL if it must use a database, which can track the data
each client downloads instead of tracking the amout of time the client
is online. Ideally the software would distinguish one client from
another by each machines unique MAC address...this way people cant
easily reconfigure their machine to get around the billing system. And
it would be good if the system had a way to alter the firewall to
dissallow specific clients mac address who havn't paid their bill or if
they account limit is reached.

I know i'm asking for a bit but if there's something close to that
written in PHP i should be able to alter it to do what i need, but i
haven't found anything on the net searching google.com, freshmeat.net,
nor sourceforge.net so i'm hoping one of you have seen/used something
similar.

Thanks very much :)





signature.asc
Description: This is a digitally signed message part


RE: [PHP-DB] Theory help needed

2002-12-20 Thread José Moreira









-Mensagem original-
De: Cal Evans [mailto:[EMAIL PROTECTED]]
Enviada: sexta-feira, 20 de Dezembro de 2002 5:07
Para: Chris Payne; [EMAIL PROTECTED]
Assunto: RE: [PHP-DB] Theory help needed


Read today's thread about trees.  It contains the info you need.


=C=

*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*


-Original Message-
From: Chris Payne [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 19, 2002 10:24 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Theory help needed


Hi there everyone,

I have a messageboard which works, but what I need is some kind of threading
for it.  Right now I have EXTREMELY basic threading, where you can reply to
a message, reply to replies etc . and they'll appear in the correct part
of the messageboard.  What I need though is to be able to do proper
threading, where each reply appears under the original message and not all
over the place, but i'm confused as hell.

Anyway have any experience with this kind of thing and can give me a push in
the right direction?  I know I need to store the original ID, the forum ID,
the message ID of the current message and the ID it relates to, but it's
getting confusing :-)

Thanks.

Chris


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




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




RE: [PHP-DB] Next/Prev 10 lines

2002-12-20 Thread Hynek Semecký ME
First you have to find how many rows would make your SELECT query in
case you would not use "LIMIT from, num".
Then you have to divide this by number of rows per page and use it
in the SELECT query.
Then to your number of pages displayed on your page you add links to
the first number of the LIMIT part in your query.
Maybe something like this:



YOUR rows displayed ...

 1) {
echo "GO TO PAGE NUMBER: ";
for($i = 1; $i <= ($num_pages); $i++) {
if($set_page_start == $page_start) {
echo "$i ";
} else {
echo "$i ";
}
$set_page_start = $set_page_start + $page_limit;
}
?>

If you want to use PREV, NEXT instead of page numbers,
just modify a little the second code paragraph.

Merry Christmas to all !

Hynek


Hynek Semecký
www.semecky.com
www.perlickovekoupele.cz
Profi Web Hosting: http://www.web4u.cz/index.php?page=Programy&rid=2837



-Original Message-
From: Steve Dodkins [mailto:[EMAIL PROTECTED]]
Sent: 20. prosince 2002 16:16
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Next/Prev 10 lines


Has anyone got some code that will correctly display the next 10 line of a
table with prev and next working?
Or point me in the right direction for help?

Regards

Steve Dodkins

IMPORTANT NOTICE The information in this e-mail is confidential and should
only be read by those persons to whom it is addressed and is not intended to
be relied upon by any person without subsequent written confirmation of its
contents. ebm-ZIEHL (UK) Ltd. cannot accept any responsibility for the
accuracy or completeness of this message as it has been transmitted over a
public network.   Furthermore, the content of this e-mail is the personal
view of the sender and does not represent the advice, views or opinion of
our company. Accordingly, our company disclaim all responsibility and accept
no liability (including in negligence) for the consequences of any person
acting, or refraining from acting, on such information prior to the receipt
by those persons of subsequent written confirmation. In particular (but not
by way of limitation) our company disclaims all responsibility and accepts
no liability for any e-mails which are defamatory, offensive, racist or in
any other way are in breach of any third party's rights, including breach of
confidence, privacy or other rights. If you have received this e-mail
message in error, please notify me immediately by telephone. Please also
destroy and delete the message from your computer. Any form of reproduction,
dissemination, copying, disclosure, modification, distribution and/or
publication of this e-mail message is strictly prohibited.  If you have
received this E-mail in error, or suspect that the message may have been
intercepted or amended, please notify ebm-ZIEHL (UK) Ltd on +44(0)1245
468555.
ebm-ZIEHL (UK) Ltd Chelmsford Business Park, Chelmsford, Essex CM2 5EZ




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



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




[PHP-DB] Feliz Natal .:. Happy Christmas

2002-12-20 Thread José Moreira


José Moreira

TEGOPI S.A.

http://www.tegopi.pt
<*>---
Feliz natal e excelente Ano Novo
Merry Christmas and a joly New Year



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




RE: [PHP-DB] Next/Prev 10 lines

2002-12-20 Thread Cal Evans
check out php.weblogs.com

ADODB does this for you.

=C=

*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*


-Original Message-
From: Steve Dodkins [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 20, 2002 9:16 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Next/Prev 10 lines


Has anyone got some code that will correctly display the next 10 line of a
table with prev and next working?
Or point me in the right direction for help?

Regards

Steve Dodkins

IMPORTANT NOTICE The information in this e-mail is confidential and should
only be read by those persons to whom it is addressed and is not intended to
be relied upon by any person without subsequent written confirmation of its
contents. ebm-ZIEHL (UK) Ltd. cannot accept any responsibility for the
accuracy or completeness of this message as it has been transmitted over a
public network.   Furthermore, the content of this e-mail is the personal
view of the sender and does not represent the advice, views or opinion of
our company. Accordingly, our company disclaim all responsibility and accept
no liability (including in negligence) for the consequences of any person
acting, or refraining from acting, on such information prior to the receipt
by those persons of subsequent written confirmation. In particular (but not
by way of limitation) our company disclaims all responsibility and accepts
no liability for any e-mails which are defamatory, offensive, racist or in
any other way are in breach of any third party's rights, including breach of
confidence, privacy or other rights. If you have received this e-mail
message in error, please notify me immediately by telephone. Please also
destroy and delete the message from your computer. Any form of reproduction,
dissemination, copying, disclosure, modification, distribution and/or
publication of this e-mail message is strictly prohibited.  If you have
received this E-mail in error, or suspect that the message may have been
intercepted or amended, please notify ebm-ZIEHL (UK) Ltd on +44(0)1245
468555.
ebm-ZIEHL (UK) Ltd Chelmsford Business Park, Chelmsford, Essex CM2 5EZ




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



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




Re: [PHP-DB] Next/Prev 10 lines

2002-12-20 Thread Jason Wong
On Friday 20 December 2002 23:16, Steve Dodkins wrote:
> Has anyone got some code that will correctly display the next 10 line of a
> table with prev and next working?
> Or point me in the right direction for help?

Search the archives. This kind of question gets asked (and sometimes answered) 
every other day (or so it seems).

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *


/*
Nihilism should commence with oneself.
*/


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




[PHP-DB] Next/Prev 10 lines

2002-12-20 Thread Steve Dodkins
Has anyone got some code that will correctly display the next 10 line of a
table with prev and next working?
Or point me in the right direction for help?

Regards

Steve Dodkins

IMPORTANT NOTICE The information in this e-mail is confidential and should
only be read by those persons to whom it is addressed and is not intended to
be relied upon by any person without subsequent written confirmation of its
contents. ebm-ZIEHL (UK) Ltd. cannot accept any responsibility for the
accuracy or completeness of this message as it has been transmitted over a
public network.   Furthermore, the content of this e-mail is the personal
view of the sender and does not represent the advice, views or opinion of
our company. Accordingly, our company disclaim all responsibility and accept
no liability (including in negligence) for the consequences of any person
acting, or refraining from acting, on such information prior to the receipt
by those persons of subsequent written confirmation. In particular (but not
by way of limitation) our company disclaims all responsibility and accepts
no liability for any e-mails which are defamatory, offensive, racist or in
any other way are in breach of any third party's rights, including breach of
confidence, privacy or other rights. If you have received this e-mail
message in error, please notify me immediately by telephone. Please also
destroy and delete the message from your computer. Any form of reproduction,
dissemination, copying, disclosure, modification, distribution and/or
publication of this e-mail message is strictly prohibited.  If you have
received this E-mail in error, or suspect that the message may have been
intercepted or amended, please notify ebm-ZIEHL (UK) Ltd on +44(0)1245
468555.
ebm-ZIEHL (UK) Ltd Chelmsford Business Park, Chelmsford, Essex CM2 5EZ




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




Re: [PHP-DB] form validation

2002-12-20 Thread Mignon Hunter
Thanks for your suggestions.  I can see the pros and cons of each.  I
will give each some thought and decide the best way to go.  

Thx
Mignon

On Fri, 2002-12-20 at 08:41, Jason Wong wrote:
> On Friday 20 December 2002 22:25, Mignon Hunter wrote:
> > Hello list,
> >
> > I am developing a db form that gets passed to another form.  I need to
> > validate the fields in form(1), before passing on.  The form action
> > posts to form(2), so that upon hitting submit - form(2) shows up in
> > browser...(the only way I know how to do this).
> >
> > I am trying to use php to validate.  I have been googling and checking
> > books and archives for 2 days and all examples use the same file to post
> > to.  In other words, form1.php uses form action="form1.php".  But I need
> > it to be form(2), but I still need to validate.
> >
> > Does anyone have any ideas, or does everyone just use javascript with
> > say...alert boxes.  This will be my last resort.
> 
> > Here's the code for form1.php
> 
> [snip]
> 
> > 
> 
> OK when some submits the form the contents are sent to form2.php ...
> 
> >  > function check_form($comp_name, $city, $state, $contact) {
> > if (!$comp_name || !$city || !$state || !$contact):
> > print ("Please fill in all Fields");
> > if (!$comp_name) {
> > print ("Please fill in your company name");
> > }
> > if (!$city) {
> > print ("Please fill in your city");
> > }
> > if (!$contact) {
> > print ("Please fill in your contact name");
> > }
> > endif;
> > }
> > ?>
> 
> ..., which means this validation doesn't run (it's run when form1.php is first 
> displayed, but that's not what you want).
> 
> IOW your validation code must be at wherever you set the form action as.
> 
> There are at least a couple of ways you can do this:
> 
> 1) If your forms are related, have a single page which deals your two (or more 
> forms). You have to keep track of which stage the user is at (ie if they've 
> filled in form1 then you should display form2).
> 
> 2) Or have it as two pages (like you have now) but in form1.php have the 
> action="form1.php" (so it processes its form). After you've processed it, 
> stick the values into some session variables then use header() to redirect to 
> form2.php.
> 
> Or you can have a look at www.phpclasses.org for some classes which can build 
> and validate forms for you.
> 
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> 
> 
> /*
> Qvid me anxivs svm?
> */
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 



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




Re: [PHP-DB] form validation

2002-12-20 Thread Ignatius Reilly
Hi Mignon,

it is really quite simple:

you can pack several screens (each containing for instance a form) in a same script.

each form contains a hidden field, say "selector"

now, the script begins by a switch:

if ( isset( $_POST['submit'] ) ) {

switch ( $selector ) { 

// Switch 1: process the screen 1
// -
case "1" :

 // process form 1 : data validation, ...

// ...
// 

break ;

// Switch 2: process the screen 2
// -
case "2" :

// etc.
} else {

// show the blank form
}


Javascript validation is not even a last resort. Use it only for usability purposes, 
but validate everything server-side.

HTH
Ignatius

  - Original Message - 
  From: Mignon Hunter 
  To: [EMAIL PROTECTED] 
  Sent: Friday, December 20, 2002 3:25 PM
  Subject: [PHP-DB] form validation




  Hello list,

  I am developing a db form that gets passed to another form.  I need to
  validate the fields in form(1), before passing on.  The form action
  posts to form(2), so that upon hitting submit - form(2) shows up in
  browser...(the only way I know how to do this). 

  I am trying to use php to validate.  I have been googling and checking
  books and archives for 2 days and all examples use the same file to post
  to.  In other words, form1.php uses form action="form1.php".  But I need
  it to be form(2), but I still need to validate.

  Does anyone have any ideas, or does everyone just use javascript with
  say...alert boxes.  This will be my last resort.  

  Thanks
  Mignon

  Here's the code for form1.php

  
  
  
  
  
  
  

  

  
  
  Please Enter the Information Below and Press the
  'Submit' Button When Finished.(All Fields Required)
   
  
  
  

  Company Name:  
  
  
  
  

  
  
  City:
  
  
  
  

  
  
  Contact Name:  
  
  
  
  
  
  
  
  

  

  
  

  
  


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





Re: [PHP-DB] form validation

2002-12-20 Thread Jason Wong
On Friday 20 December 2002 22:25, Mignon Hunter wrote:
> Hello list,
>
> I am developing a db form that gets passed to another form.  I need to
> validate the fields in form(1), before passing on.  The form action
> posts to form(2), so that upon hitting submit - form(2) shows up in
> browser...(the only way I know how to do this).
>
> I am trying to use php to validate.  I have been googling and checking
> books and archives for 2 days and all examples use the same file to post
> to.  In other words, form1.php uses form action="form1.php".  But I need
> it to be form(2), but I still need to validate.
>
> Does anyone have any ideas, or does everyone just use javascript with
> say...alert boxes.  This will be my last resort.

> Here's the code for form1.php

[snip]

> 

OK when some submits the form the contents are sent to form2.php ...

>  function check_form($comp_name, $city, $state, $contact) {
> if (!$comp_name || !$city || !$state || !$contact):
> print ("Please fill in all Fields");
> if (!$comp_name) {
> print ("Please fill in your company name");
> }
> if (!$city) {
> print ("Please fill in your city");
> }
> if (!$contact) {
> print ("Please fill in your contact name");
> }
> endif;
> }
> ?>

..., which means this validation doesn't run (it's run when form1.php is first 
displayed, but that's not what you want).

IOW your validation code must be at wherever you set the form action as.

There are at least a couple of ways you can do this:

1) If your forms are related, have a single page which deals your two (or more 
forms). You have to keep track of which stage the user is at (ie if they've 
filled in form1 then you should display form2).

2) Or have it as two pages (like you have now) but in form1.php have the 
action="form1.php" (so it processes its form). After you've processed it, 
stick the values into some session variables then use header() to redirect to 
form2.php.

Or you can have a look at www.phpclasses.org for some classes which can build 
and validate forms for you.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *


/*
Qvid me anxivs svm?
*/


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




RE: [PHP-DB] extracting data

2002-12-20 Thread SELPH,JASON (HP-Richardson,ex1)
Andrew is correct about iodbc.  As soon as they write an allbase connector I
will be all over it.


Here is a function I use to facilitate working with odbc

function odbc_fetch_into_array($rs) {
   $result = array();
   if (!odbc_fetch_row($rs)) return false;
   $numfields = odbc_num_fields($rs);
   for($lpLoop=1; $lpLoop<=$numfields; $lpLoop++) {
 $fieldname = odbc_field_name($rs,$lpLoop);
 $fieldval  = odbc_result($rs,$lpLoop);
 $result[$fieldname] = $fieldval;
   }
   return $result;
}

It simulates mysql_fetch_array.  Usage is similar to mysql.

while( odbc_fetch_into_array($eddie))
{
$myvar1= odbc_result( $eddit, "fieldname1"
);
$myvar5= odbc_result( $eddit, "fieldname5"
);

}

As for how to move the data somewhere else?  To another odbc? to mysql?
where?  And do you want to manipulate the data before moving it?

Cheers
Jason


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 20, 2002 8:17 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] extracting data


Ok,

I am lost now, I am just trying to read the documentation on odbc...here is
what I have so far. This seems to work...or at least not give any errors.
How do I know get to the result set in the select statement to move this
data somewhere else? I just want to get the entire result set so I can load
it into another db.

Thanks,
Eddie



-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 19, 2002 9:55 PM
To: SELPH,JASON (HP-Richardson,ex1)
Cc: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] extracting data



You can actually do this from any machine, although you will need an ODBC
driver on the Linux/Mac OS X/Unix side.
Another alternative is to dump the .mdb to mysql format and move it over.

But ODBC is the way to go.  Beginning PHP Databases from Wrox cover this a
lot, but you can get started with just a DSN and a basic odbc_connect.
Create it as a System DSN - it will cause less problems.

If you are on a *nix or Mac OS X, then you will want to tell the PHP script
where the files are that contain the DSN (odbc.ini) and the ODBC Driver
Manager (libiodbc.so).  There are basic examples and explanations in the
HOWTO at www.iodbc.org.   It's *nix geared, but just remove the putenv()'s
at the beninning of the examples and they will work fine.

Best regards,
Andrew Hill
Director of Technology Evangelism
OpenLink Software   http://www.openlinksw.com
Virtuoso Universal Server   http://www.openlinksw.com/virtuoso/


At 02:27 PM 12/19/2002, SELPH,JASON (HP-Richardson,ex1) wrote:
>If you are on a windows machine, you can create a DSN to the access file
and
>use odbc from php to connect to it.
>
>-Original Message-
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, December 19, 2002 12:59 PM
>To: [EMAIL PROTECTED]
>Subject: [PHP-DB] extracting data
>
>
>I posted this to the php general list also so forgive me if you are seeing
>this twice.  Can I use php to extract data from an access db?  The php
>script and access db will be local.  I will then upload the file to my
>server.
>
>Thanks,
>Eddie
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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

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




[PHP-DB] form validation

2002-12-20 Thread Mignon Hunter


Hello list,

I am developing a db form that gets passed to another form.  I need to
validate the fields in form(1), before passing on.  The form action
posts to form(2), so that upon hitting submit - form(2) shows up in
browser...(the only way I know how to do this). 

I am trying to use php to validate.  I have been googling and checking
books and archives for 2 days and all examples use the same file to post
to.  In other words, form1.php uses form action="form1.php".  But I need
it to be form(2), but I still need to validate.

Does anyone have any ideas, or does everyone just use javascript with
say...alert boxes.  This will be my last resort.  

Thanks
Mignon

Here's the code for form1.php













Please Enter the Information Below and Press the
'Submit' Button When Finished.(All Fields Required)
 




Company Name:  







City:







Contact Name:  


















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




RE: [PHP-DB] extracting data

2002-12-20 Thread Edward Peloke
Ok,

I am lost now, I am just trying to read the documentation on odbc...here is
what I have so far. This seems to work...or at least not give any errors.
How do I know get to the result set in the select statement to move this
data somewhere else? I just want to get the entire result set so I can load
it into another db.

Thanks,
Eddie



-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 19, 2002 9:55 PM
To: SELPH,JASON (HP-Richardson,ex1)
Cc: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] extracting data



You can actually do this from any machine, although you will need an ODBC
driver on the Linux/Mac OS X/Unix side.
Another alternative is to dump the .mdb to mysql format and move it over.

But ODBC is the way to go.  Beginning PHP Databases from Wrox cover this a
lot, but you can get started with just a DSN and a basic odbc_connect.
Create it as a System DSN - it will cause less problems.

If you are on a *nix or Mac OS X, then you will want to tell the PHP script
where the files are that contain the DSN (odbc.ini) and the ODBC Driver
Manager (libiodbc.so).  There are basic examples and explanations in the
HOWTO at www.iodbc.org.   It's *nix geared, but just remove the putenv()'s
at the beninning of the examples and they will work fine.

Best regards,
Andrew Hill
Director of Technology Evangelism
OpenLink Software   http://www.openlinksw.com
Virtuoso Universal Server   http://www.openlinksw.com/virtuoso/


At 02:27 PM 12/19/2002, SELPH,JASON (HP-Richardson,ex1) wrote:
>If you are on a windows machine, you can create a DSN to the access file
and
>use odbc from php to connect to it.
>
>-Original Message-
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, December 19, 2002 12:59 PM
>To: [EMAIL PROTECTED]
>Subject: [PHP-DB] extracting data
>
>
>I posted this to the php general list also so forgive me if you are seeing
>this twice.  Can I use php to extract data from an access db?  The php
>script and access db will be local.  I will then upload the file to my
>server.
>
>Thanks,
>Eddie
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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




Re: [PHP-DB] Set Logout Time for No Activity

2002-12-20 Thread Ignatius Reilly
Another possibility is after each page call to rewrite the client's cookie's validity 
to, say, current time + 1800s:

session_start() ;
setcookie( session_name(), session_id(), time()+1800, "/" ) ;
ob_start() ;
// etc.

If the user does not call a page for more than 30', the cookie will be destroyed, in 
effect destroying the session.

Ignatius

  - Original Message - 
  From: John W. Holmes 
  To: 'Allens' ; [EMAIL PROTECTED] 
  Sent: Friday, December 20, 2002 1:57 PM
  Subject: RE: [PHP-DB] Set Logout Time for No Activity


  >Is there a variable in php.ini that will allow you to log someone
  out
  > if there is no activity of 30 minutes or greater from the logged in
  > user? Thanks in advance. :)

  No, not really. You can use sessions, for something like this, though.
  You start a session and look for a variable within it before you proceed
  with the page. If the user is inactive for a while, the session will be
  cleaned up and not exist when you go to check it, so you make them log
  in again. You can control the session garbage collection time in
  php.ini.

  ---John Holmes...



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





RE: [PHP-DB] Set Logout Time for No Activity

2002-12-20 Thread John W. Holmes
>Is there a variable in php.ini that will allow you to log someone
out
> if there is no activity of 30 minutes or greater from the logged in
> user? Thanks in advance. :)

No, not really. You can use sessions, for something like this, though.
You start a session and look for a variable within it before you proceed
with the page. If the user is inactive for a while, the session will be
cleaned up and not exist when you go to check it, so you make them log
in again. You can control the session garbage collection time in
php.ini.

---John Holmes...



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