[PHP] writing to mysql using php

2002-12-03 Thread Shams
Hi,

I'm relatively new to PHP and mySQL.

I currently have a simple table created within a MySQL database.  And I have
a php script that connects to the database, presents a form for the user to
fill in, and then writes that record to the table.

Instead... is it possible, to write to multiple records at once using a
tabular view rather than one record at a time with a columnar view ?

Many Thanks,

Shams



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




[PHP] Refresing a PHP page! which is called from a

2002-12-11 Thread Shams
Hi,

I have a index.html file, which creates a HTML  login page - which is a
simple  allowing a user to enter their username and password
into 2 seperate fields.

The action is to call another php script for processing, i.e. .

Now, I can understand why it brings up a pop-up-box with the message :

"The page cannot be refreshed without resending the information.  Click
retry to send the information again, or click Cancel to return to the page
that you were trying to view."

while the browser is on the index.php script (with the form).

But why does it bring up the same message when the page is refreshed after
login.php has been processed ??

If I run login.php independantly (wihout calling it from the  in
index.php) then it displays some the text, and refreshes without popping up
the message box above.

All login.php does is display some text, at the moment it doesn't do any
checking on the user input.

Thanks for any help!

Shams



index.html
--



Login











login.php
-





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




[PHP] checking status of a HTML checkbox

2003-01-10 Thread Shams
Hi,

If I pass a  (using POST) from one php script to another, which
contains the following HTML checkbox:



I know that the input will only be passed if the checkbox is ticked... but
how do I check if the checkbox was ticked and the value has actually been
passed ?

At the moment I am doing this:

if ( $_POST["insurance"] == "yes" )
{
}

But is there a more "accurate" way of checking the exsistence of "insurance"
?

Many Thanks,
Shams



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




Re: [PHP] checking status of a HTML checkbox

2003-01-10 Thread Shams
thanks a lot, thats what I was looking for

:o)

Shams

"- Edwin" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> "Shams" <[EMAIL PROTECTED]> wrote:
>
> [snip]
> > At the moment I am doing this:
> >
> > if ( $_POST["insurance"] == "yes" )
> > {
> > }
> >
> > But is there a more "accurate" way of checking the exsistence of
> > "insurance"?
> [/snip]
>
> I think you're looking for isset():
>
>   http://www.php.net/manual/en/function.isset.php
>
> - E
>
> __
> Do You Yahoo!?
> Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/
>



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




[PHP] $header = "Location:........" being ignored!

2003-01-21 Thread Shams
Hi Group,

I basically have some simple code such as:

==

if ( $_POST['passwd'] != $db['password']
{header("Location: loginfailed.html");
}

//else

$header = "Location: success.html";

==

however, when I run this code, using a  to submit password, username,
etc.. if the passwords do not match, the page is forwarded to
success.html !

Is there anything obvious that I am doing wrong?

Thanks,
Shams

p.s. I don't want to use else{} because I have lots of if() checks!



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




[PHP] restricting acces to files

2003-02-04 Thread Shams
Hi,

i've written a secure PHP login script which will allow users to login to a
directory such as this:

smezone.com/members/index.php

however, how do I restrict people from accessing HTML files in that
directory (which they can easily do so by typing the URL into their
browser), such as:

smezone.com/members/document1.html

?

Since its a regular HTML files (and we have lots), I can't check whether the
user has a valid session as I would do in a PHP file.

Thanks for any help!

Shams



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




[PHP] restricting acces to files

2003-02-05 Thread Shams
Hi,

i've written a secure PHP login script which will allow users to login to a
directory such as this:

smezone.com/members/index.php

however, how do I restrict people from accessing HTML files in that
directory (which they can easily do so by typing the URL into their
browser), such as:

smezone.com/members/document1.html

?

Since its a regular HTML files (and we have lots), I can't check whether the
user has a valid session as I would do in a PHP file.

Thanks for any help!

Shams





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




[PHP] restricting acces to files

2003-02-06 Thread Shams
Hi,

i've written a secure PHP login script which will allow users to login to a
directory such as this:

smezone.com/members/index.php

however, how do I restrict people from accessing HTML files in that
directory (which they can easily do so by typing the URL into their
browser), such as:

smezone.com/members/document1.html

?

Since its a regular HTML files (and we have lots), I can't check whether the
user has a valid session as I would do in a PHP file.

Thanks for any help!

Shams



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




[PHP] restricting access to files using PHP

2003-02-12 Thread Shams
Hi,

i've written a secure PHP login script which will allow users to login to a
directory such as this:

smezone.com/members/index.php

however, how do I restrict people from accessing HTML files in that
directory (which they can easily do so by typing the URL into their
browser), such as:

smezone.com/members/document1.html

?

Since its a regular HTML files (and we have lots), I can't check whether the
user has a valid session as I would do in a PHP file.

Thanks for any help!

Shams




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




Re: [PHP] restricting access to files using PHP

2003-02-13 Thread Shams

Ooops, I didn't mean to post my question a number of times!  Just that my
message didn't appear (in Outlook Express), so I reposted it.  Thanks to
everyone who replied.

I'd rather not convert .HTML files to .PHP files because there are other
files in the members area that I also wish to protect (.DOC and .PDF files).

I'm interested in your solution David, what is the format of the external
auth script that you use.. is there some kind of return you have to give
.htaccess ?

Also, is there no way I can allow a user to login using a PHP login script,
and then pass the "username" and "password" over to .htaccess to verify ?

Thanks for the help,

Shams

"David T-G" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

You've seen the suggestions from others to change your .html files.  You
may or may not want to do that.

If you don't want to do that, then you need a .htaccess file.  You don't
necessarily, however, need a .htpasswd file as well; just make your php
script the authenticator:

  AuthName AccessYourDirectory
  AuthType Basic
  AuthExternal /path/to/your/script
  order allow,deny
  allow from all
  require valid-user

This is untested code, but you get the idea.  You may have to define your
external auth script with some name and then call it; our version of this
uses NickName instead of /path/to/your/script and in the httpd.conf file
we have

  AddExternalAuth NickName "/path/to/script"
  SetExternalAuthMethod NickName pipe

and I dunno if 1) adding and nicknaming is necessary or 2) you can do it
in a .htaccess file instead of having to put it in the http.conf file.


HTH & HAND

:-D
--
David T-G  * There is too much animal courage in
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!





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




[PHP] is "http://username:password@localhost.com/secure_area/" secure ?

2003-02-18 Thread Shams
Hi,

I have a PHP login scripts that takes the "username" and "password" and
stores it in a session.

Once verified as a valid user against a mySQL database, the user is
redirected to a members area ( "/secure_area" ), using:

http://username:[EMAIL PROTECTED]/secure_area/

This is so that .htaccess (which is in "/secure_area" won't pop up its own
"login/password" box).

However, i am having a couple of problems,

first, once the user is redirected to the /secure_area folder, EVERY link on
that page (and onwards) is prefixed with
http://username:[EMAIL PROTECTED].. for everyone to see !!! and
thus the password has been exposed.
How can I stop it displaying the username and password ?

And also, is this a secure way of logging in?

(it is the only way I can figure out how to do it, so that PHP logs u in and
passes username and password to .htaccess quietly).

Many Thanks for any help!

Shams



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