php-windows Digest 9 Jul 2003 16:54:34 -0000 Issue 1817
Topics (messages 20740 through 20749):
PHP Authentication for Member Site
20740 by: Adam
Re: Forms-PHP-and-errors
20741 by: jh
20743 by: jh
20744 by: Sven Schnitzke
20745 by: Luis Moreira
Re: mysql question
20742 by: Cristian MARIN
Re: How to make a picture gallery ?
20746 by: Svensson, B.A.T. (HKG)
Problem IIS
20747 by: Jonas Ferreira
20749 by: Stephen March
php with .procmailrc
20748 by: Derrick Hermanson
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
I'm currently using WebQuota by Flicks Software at www.flicks.com for
authenticating members. The product protects against dictionary attacks, and
it throttles bandwidth used by members. Does PHP have any equivalent
software?
Adam
--- End Message ---
--- Begin Message ---
Hi,
Thanks for reply.
I have wrapped your code in <?php ?> like so:-
<?php
if !isset($title) {
// Title contains no valid data
$title = ""
}
if !isset($firstname) {
// Title contains no valid data
$firstname = ""
}
if !isset($lastname) {
// Title contains no valid data
$lastname = ""
}
>
?>
called it p-6-2.php and this is the error I get:-
Parse error: parse error, unexpected '!', expecting '(' in D:\web\myforms\p-6-2.php on
line 4
I have used my own form which uses javascript to validate the fname and surname
fields, but it still outputs the same error messages!
------------------------------------------------------------------------
Notice: Undefined variable: title in D:\web\myforms\p-6-2.php on line 11
Title is required.
Notice: Undefined variable: fname in D:\web\myforms\p-6-2.php on line 17
First name is required.
Notice: Undefined variable: surname in D:\web\myforms\p-6-2.php on line 23
Last name is required.
Please use your browser's back button to return to the form, correct the errors, and
re-submit the form.
-----------------------------------------------------
If I send the output of my form to phpinfo() , I get all my form fields listed in '
PHP Variables ' in ' get ' and ' post ' and the data entered into my form is there
also.
In php.ini, globles is set off, like so:- register_globals=Off
Like I say, I am new to php, so I haven't a clue what to do!
Thanks
jh
--- End Message ---
--- Begin Message ---
On 09/07/03 at 09:23 Henrik Hornemann wrote:
>Hi,
>
>You are probably running with REGISTER_GLOBALS off.
REGISTER_GLOBALS is set off in php.ini
>You can access your form variables like this:
>$title=$_POST['title']; $lastname=$_POST['lastname']; ... and so on.
>
>hth Henrik Hornemann
>
I have put your code at the start of my script and it now works.
Thanks a lot.
jh
--- End Message ---
--- Begin Message ---
Hi,
as to your new error message:
If goes:
if (condition) statement;
so add the round braces around the condition and PHP
will be happy.
In my reply I referred to vars coming from POST action
as $_POST['var_name_here']. This is an implication of
register_globals = off which in turn is a good idea as a
security precaution. "On" is for backward compatibility.
So
...
If (!IsSet($_POST['title'])) {
// relay the user to the form page. This page
// was not requested from there!
header('location: url_of_your_form_page');
}
else {
$title = $_POST['title'];
if (trim($title) == '') {
// handle error: title is mandatory
}
else {
// do whatever is needed with title
}
}
...
might do the job.
--
Sven
> -----Ursprüngliche Nachricht-----
> Von: jh [SMTP:[EMAIL PROTECTED]
> Gesendet am: Mittwoch, 9. Juli 2003 10:03
> An: [EMAIL PROTECTED]
> Betreff: [PHP-WIN] Re: Forms-PHP-and-errors
>
> Hi,
> Thanks for reply.
> I have wrapped your code in <?php ?> like so:-
> <?php
> if !isset($title) {
> // Title contains no valid data
> $title = ""
> }
>
> if !isset($firstname) {
> // Title contains no valid data
> $firstname = ""
> }
>
> if !isset($lastname) {
> // Title contains no valid data
> $lastname = ""
> }
> >
> ?>
>
> called it p-6-2.php and this is the error I get:-
> Parse error: parse error, unexpected '!', expecting '(' in
D:\web\myforms\p-6-2.php on line 4
>
> I have used my own form which uses javascript to validate the fname and
surname fields, but it still outputs the same error messages!
> ------------------------------------------------------------------------
> Notice: Undefined variable: title in D:\web\myforms\p-6-2.php on line 11
>
> Title is required.
> Notice: Undefined variable: fname in D:\web\myforms\p-6-2.php on line 17
>
> First name is required.
> Notice: Undefined variable: surname in D:\web\myforms\p-6-2.php on line
23
>
> Last name is required.
>
> Please use your browser's back button to return to the form, correct the
errors, and re-submit the form.
>
> -----------------------------------------------------
> If I send the output of my form to phpinfo() , I get all my form fields
listed in ' PHP Variables ' in ' get ' and ' post ' and the data entered
into my form is there also.
> In php.ini, globles is set off, like so:- register_globals=Off
> Like I say, I am new to php, so I haven't a clue what to do!
>
> Thanks
> jh
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
The error complains about an unexpected "!", right ?
What if you do
if (!isset($title)) {
That's the correct syntax, you know ?...
Luis
----- Original Message -----
From: "jh" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 09, 2003 9:03 AM
Subject: [PHP-WIN] Re: Forms-PHP-and-errors
Hi,
Thanks for reply.
I have wrapped your code in <?php ?> like so:-
<?php
if !isset($title) {
// Title contains no valid data
$title = ""
}
if !isset($firstname) {
// Title contains no valid data
$firstname = ""
}
if !isset($lastname) {
// Title contains no valid data
$lastname = ""
}
>
?>
called it p-6-2.php and this is the error I get:-
Parse error: parse error, unexpected '!', expecting '(' in
D:\web\myforms\p-6-2.php on line 4
I have used my own form which uses javascript to validate the fname and
surname fields, but it still outputs the same error messages!
------------------------------------------------------------------------
Notice: Undefined variable: title in D:\web\myforms\p-6-2.php on line 11
Title is required.
Notice: Undefined variable: fname in D:\web\myforms\p-6-2.php on line 17
First name is required.
Notice: Undefined variable: surname in D:\web\myforms\p-6-2.php on line 23
Last name is required.
Please use your browser's back button to return to the form, correct the
errors, and re-submit the form.
-----------------------------------------------------
If I send the output of my form to phpinfo() , I get all my form fields
listed in ' PHP Variables ' in ' get ' and ' post ' and the data entered
into my form is there also.
In php.ini, globles is set off, like so:- register_globals=Off
Like I say, I am new to php, so I haven't a clue what to do!
Thanks
jh
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Try to make a many-to-many design :
Create a table 'images_img' with id_img, name_img, accession_img ... for the
images
Create a table 'categories_ctg' for the categories with id_ctg, name_ctg,
description_ctg ...
Create a table for unifing this two imgtoctg_itc with id_itc, idimg_itc,
idctg_itc
In the image insert the image id_img=1, name_img="picture1.jpg",
accession_img="1031-LH0152"
Insert into categories the id_ctg=1, name_ctg="Military Posters" ...
id_ctg=3, name_ctg="Ontario Regiment"
Insert the links between the two in the imgtoctg_itc like this
id_itc=1 ;The id of the record
idimg_itc=1 ; The image id
idctg_itc=1 ; The category id
id_itc=1 ;The id of the record
idimg_itc=1 ; The image id
idctg_itc=2 ; The category id
id_itc=1 ;The id of the record
idimg_itc=1 ; The image id
idctg_itc=3 ; The category id
In this case the picture is fit in all three categories.
Now you have to read into the mysql manual how to use the left join, right
join, inner join to retrieve all the records you need from both tables
images_img and categories_ctg by passing throw the imgtoctg_itc
Hope this answer your question
--
-------------------------------------------------
Cristian MARIN - Developer
InterAKT Online (www.interakt.ro)
Tel: +4021 312.53.12
Tel/Fax: +4021 312.51.91
[EMAIL PROTECTED]
"H Marc Bower" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
I know this isn't the mysql area... but many of you seem very knowledgeable
in this area and I would appreciate your input...
What kind of field setup should I create if I want a field which will,
essentially hold several distinct items, but never a set number of them? I
am going to be selecting these items (or the relational pointers to them)
from a multi-select list (ie. this image belongs in the following
categories). After that, I will need to output the contents of this field to
an array. That part I know how to do using php as long as it's a big
string, but I am guessing there is a better way to do this. From the
manual, it seems that a SET field would work, but I'd need the SET to be the
contents of a field from another table.
For example, I have an image with an accession number of 1031-LH0152. It
will fit in the categories of "Military Posters", "McLaughlin - Colonel
Robert Samuel", and "Ontario Regiment". How do I get one field to hold all
of the categories, and then what is the most efficient way to then transport
that into an array with php?
Thank you for the more-elaborate-than-just-php assistance.
Marc
--- End Message ---
--- Begin Message ---
First thing would be to Read The Fine Manual at www.php.net,
after that the second thing would be to re-formulate your
question to something like: "how do I use the 'dir' funtion
to do this?".
-----Original Message-----
From: _GeS_
To: [EMAIL PROTECTED]
Sent: 2003-07-07 16:57
Subject: [PHP-WIN] How to make a picture gallery ?
How can I make my own picture gallery? I have one directory called
Pictures and then there are more directories like Pics1, Pics2, .... I
would like to have a php skript that would now i say something like
pictures.php?dir=Pics1 and then it would show all pics in that
directory.
please say my how to make it ?
--- End Message ---
--- Begin Message ---
My dear friends,
I use IIS 5.1, that comes with Windows XP (pro), and PHP 4.3.2,
everything installed usually, however when I execute an application
PHP, it works on primeiros instants and after not, the mistake appears
"is the folder name disable", how to solve this problem?
Thankful.
--- End Message ---
--- Begin Message ---
Can you get a screenshot (picture) of the error? Or provide a link
to your site :)
It would be a bit easier to troubleshoot.
Cheers,
~Steve
Jonas Ferreira wrote:
My dear friends,
I use IIS 5.1, that comes with Windows XP (pro), and PHP 4.3.2,
everything installed usually, however when I execute an application
PHP, it works on primeiros instants and after not, the mistake appears
"is the folder name disable", how to solve this problem?
Thankful.
--- End Message ---
--- Begin Message ---
I'm trying to set up .procmailrc to capture emails sent out. The .procmailrc
file should filter the emails to a php program if the email is not
deliverable. The php program works if I pass the variables directly to it
but the .procamilrc doesn't seem to pass the email to the php program.
.procmailrc ----->
:0 bc
* ^Subject:.*
| /home/httpd/capture/capture.php
Any help would be greatful.
Thanks.
Derrick
--- End Message ---