Re: [PHP-DB] Forms : Validating user input is integer

2001-04-05 Thread boclair

Thanks Steve,

It is not my choice re javascript in this case

I have tried to use the functions is_int($input_var) and
is_integer($input_var)  and the !versions as you suggest but with
failures.

Example 1_

if ((@!$submit) || (!is_int($input_var)) )
  {
   echo "error";
   include "get_id.php";
   }

else {


_Example 2_

if ((@!$submit))
  {
   echo "error";
   include "get_id.php";
   }

elseif (is_int($num)) {
_

There were no problems before attempting validation with is_int() and
is_integer().  The integer validation was being with a javascript and
the creation of the variable was OK.

Further advise appreciated.

Tim




- Original Message -
From: Steve Farmer [EMAIL PROTECTED]
To: boclair [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, April 05, 2001 3:23 PM
Subject: Re: [PHP-DB] Forms : Validating user input is integer


 Hi tim,

 most certainly it can be done on the server side, it juts requires a
 round trip to the server is all

 i think it is ..

 if(!isinteger($input_var)): (check the exact function in the php
manual)
   echo "this is an error (or whatever), press here to go back and
 correct your inpout";
 exit; /* stops the script executing */
 endif;

 HTH
 Steve

 At 3:05 PM +1000 5/4/01, boclair wrote:
 I have a problem with a user input in a form required to be an
 integer, creating a variable for a mysql query.
 
 I have instances where integer, 0, is being typed as letter,o.
 
 The last discussion of validating the input was
 http://marc.theaimsgroup.com/?l=php-dbm=97207172003983w=2
 
 There it was suggested that the only way to validate the input was
 using javascript.  I have a case where clients have disabled
 javascript.
 
 I tried fiddling with is_int($input) but of cause it does not serve
 this purpose.
 
 Does anybody know if such validation can be done server side or
 definitely must be done client side?
 
 Tim Morris
 
 
 
 
 --
 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]

 --
 ---
 "Minds are like parachutes, they work best when open"
 Support free speech; visit http://www.efa.org.au/

 Heads Together Systems Pty Ltd http://www.hts.com.au
 Email: [EMAIL PROTECTED] Tel: 612 9982 6767 Fax: 612 9981 3081

 --
 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] display formatting with a while loop

2001-04-05 Thread olinux

hey all,
well, i dont know that a while loop will be my solution, i think that it may. What i 
would like to do is to display 4 variables and then create another column. the toughy 
is that i an using a series of IF'f inside the while.

So something like this:

while ($1  4) {
   if ($var1 == 1) { 
   $display .= "brvariable one is true";
   $i++;
   }
   if ($var2 == 1) { 
   $display .= "brvariable two is true";
   $i++;
   }
   if ($var3 == 1) { 
   $display .= "brvariable three is true";
   $i++;
   }
   if ($var4 == 1) { 
   $display .= "brvariable four is true";
   $i++;
   }
   if ($var5 == 1) { 
   $display .= "brvariable five is true";
   $i++;
   }
}

So ideally instead of getting this (in the browser):

variable one is true
variable two is true
variable three is true
variable four is true
variable five is true

we would see :

variable one is true|variable five is true   
variable two is true|
variable three is true  |
variable four is true   |

I know that i need to put int a /tdtd between every fourth variable that is 
printed [cuz if they dont equal 1 they do not print anything] 

My problem is, i do not know how to get these inserted.  I have about 15 fields so i 
would like to be able to display them in table cells of 4 or 5 each.

Thank you,

olinux




[PHP-DB] ODBC again

2001-04-05 Thread Fernando Buitrago

My code is:

  $conn = odbc_connect("encuneweb","","");
  $result1 = odbc_prepare($conn, "SELECT * FROM PERSONAS WHERE email =
'$v_mail')";
  if (!odbc_execute($result1))

echo "nuevo usuario";
$insertar_persona = "INSERT INTO Personas (Nombre, Apellido1, Apellido2,
mail, telefono1)   VALUES('$v_nombre', '$v_apellido1',
'$v_apellido2', $v_mail)" );

The  line number 45 is:
The second line ($result1=odbc_prepare.
display the following message:
Parse error: parse error in C:\Sistemas\encune_web\registro.php on line 45

Why.

Thanks and regards

fernando




-- 
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] display formatting with a while loop

2001-04-05 Thread olinux

what if i put the if statements inside of another if statement and then set
the $i back to 1.

if ($1 = 4) {
   $display .= "/tdtd";
   $i = 1;
   }

how exactly would i do this, or is it totally wrong?

olinux


- Original Message -
From: "olinux" [EMAIL PROTECTED]
To: "PHP-DB" [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, April 05, 2001 2:47 AM
Subject: [PHP-DB] display formatting with a while loop


hey all,
well, i dont know that a while loop will be my solution, i think that it
may. What i would like to do is to display 4 variables and then create
another column. the toughy is that i an using a series of IF'f inside the
while.

So something like this:

while ($1  4) {
   if ($var1 == 1)

   $display .= "brvariable one is true";
   $i++;
   }
   if ($var2 == 1)

   $display .= "brvariable two is true";
   $i++;
   }
   if ($var3 == 1)

   $display .= "brvariable three is true";
   $i++;
   }
   if ($var4 == 1)

   $display .= "brvariable four is true";
   $i++;
   }
   if ($var5 == 1)

   $display .= "brvariable five is true";
   $i++;
   }
}

So ideally instead of getting this (in the browser):

variable one is true
variable two is true
variable three is true
variable four is true
variable five is true

we would see :

variable one is true|variable five is true
variable two is true|
variable three is true  |
variable four is true   |

I know that i need to put int a /tdtd between every fourth variable that
is printed [cuz if they dont equal 1 they do not print anything]

My problem is, i do not know how to get these inserted.  I have about 15
fields so i would like to be able to display them in table cells of 4 or 5
each.

Thank you,

olinux




_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
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] Problem with frames

2001-04-05 Thread Bartek Pawlik

Hi!

I have a following problem:
I have a script in PHP, say "script1.php", there is a form and submit button.
What I want is, after pressing the button, I want to load 2 frames in one window, but 
(MOST IMPORTANT), I want to pass all variables from form to BOTH frames at once.
Please help, 

Bartek Pawlik
POLAND



-- 
 


Re: [PHP-DB] Problem with frames

2001-04-05 Thread olinux

Use sessions

begin script2.php - the form processor like this

session_start();

session_register('variable');
session_register('another_variable');

$variable = $valueyouwanttostore;
$another_variable = $anothervaluetostore;

just register any variable name, notice, there is no "$" when registering

then begin each frame with
?
session_start();
?

and all of your registred variables will be available!

olinux

- Original Message -
From: "Bartek Pawlik" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, April 04, 2001 11:56 PM
Subject: [PHP-DB] Problem with frames


Hi!

I have a following problem:
I have a script in PHP, say "script1.php", there is a form and submit
button.
What I want is, after pressing the button, I want to load 2 frames in one
window, but (MOST IMPORTANT), I want to pass all variables from form to BOTH
frames at once.
Please help,

Bartek Pawlik
POLAND



--



_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
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] ODBC again

2001-04-05 Thread richarda
 BDY.RTF

-- 
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] ODBC again

2001-04-05 Thread Daevid Vincent

shouldn't that be:
$result1 = odbc_prepare($conn, "SELECT * FROM PERSONAS WHERE email =
'$v_mail'");

you have your double quotes at the end in the wrong place.
they should be before the ") not after )"

daevid.com

 -Original Message-
 From: Fernando Buitrago [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, April 04, 2001 11:47 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] ODBC again


 My code is:

   $conn = odbc_connect("encuneweb","","");
   $result1 = odbc_prepare($conn, "SELECT * FROM PERSONAS WHERE email =
 '$v_mail')";
   if (!odbc_execute($result1))

 echo "nuevo usuario";
 $insertar_persona = "INSERT INTO Personas (Nombre, Apellido1,
 Apellido2,
 mail, telefono1)   VALUES('$v_nombre', '$v_apellido1',
 '$v_apellido2', $v_mail)" );

 The  line number 45 is:
 The second line ($result1=odbc_prepare.
 display the following message:
 Parse error: parse error in C:\Sistemas\encune_web\registro.php on line 45

 Why.

 Thanks and regards

 fernando




 --
 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] SELECT statement

2001-04-05 Thread Jeffrey A Schoolcraft

* Julio Cuz, Jr. ([EMAIL PROTECTED]) wrote:
 Ron,
 
 Thanks for your help, but my problem still there even when I made the 
 following changes:
 
 $sql = "SELECT * FROM \"Remodel\" WHERE Email=\"".$find."\"";

You don't have to quote the table name either.  You can probably get
away with something like this:

$sql = "SELECT * FROM Remodel WHERE Email=\"$find\" \n";

I put the \n at the end of my queries, at the end of every line if it's
a long query, just makes it easier for me to read if I need to do
debugging later, it won't affect your query.

Jeff


-- 
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 : Validating user input is integer

2001-04-05 Thread boclair


- Original Message -
From: Matt Williams [EMAIL PROTECTED]
To: boclair [EMAIL PROTECTED]
Sent: Thursday, April 05, 2001 9:03 PM
Subject: RE: [PHP-DB] Forms : Validating user input is integer



  To gain the full benefit of your suggestion I find that I can
validate
  for a wrong entry containing  a mix alphabetical and numerical
  characters  by altering the elseif line to read
 
  elseif (!eregi("[0-9]",$num) || eregi("[a-z]",$num))
 
  Agreed?
 

  yes and no.

 I've done a lot of testing for this and using just the first one has
never
 let any values of $num through unles they've contained only numbers.
 AFAIK (!eregi("[0-9]",$num) should always return false or 0 or
whatever it
 is unless it contains only numbers.


When I used  only  elseif (!eregi("[0-9]",$num) { }
an input 2i passed the variable 2


 You could also use [^a-zA-Z] for letters you don't want.
 so maybe something like  (!eregi("([0-9]||[^a-zA-Z])",$num))
 not tried so don't rely on that.

xx
correcting some typos this does the job elegantly.  Should read

elseif (!eregi(("[0-9]" || "[^a-zA-Z]"),$num)){  }
xx

 Check out the phpbuilder.com regexp tutorial, I find it a good
resource
 http://www.phpbuilder.com/columns/dario19990616.php3

Have read it and got confused.  Will re-read it with my eyes open.

Thanks for holding my hand.

Tim



-- 
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] Microsoft Access DB PHP

2001-04-05 Thread Andrew Hill

James,

Sure - just connect via ODBC and use the odbc_functions in PHP.

Best regards,
Andrew
--
Andrew Hill - OpenLink Software
Director Technology Evangelism
Universal Data Access Integration 
http://www.openlinksw.com


 -Original Message-
 From: James Kneebone [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, April 04, 2001 11:47 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Microsoft Access DB  PHP
 
 
 Hello List,
 
 I have a query in regards to using PHP to only retrieve records from a
 Microsoft Access Database. I would like to know whether it is possible to
 do so with PHP and not have to change completely and use ASP.
 
 Cheers,
 
 James
 
 
 -- 
 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: Re: [PHP-DB] HELP URGENT

2001-04-05 Thread richarda
 BDY.RTF

-- 
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] Re: INFORMIX INFO PROBLEM (Fwd)

2001-04-05 Thread Misterio X . - Anonymo

Two system tables, SYSTABLES and SYSCOLUMNS contain the information you
want. Just select it out with an ordinary select statement. "select * from
systables".
-- 
mail.pt - Um mail para todos - em http://mail.pt/

-- 
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 : Validating user input is integer

2001-04-05 Thread Boclair


"boclair" [EMAIL PROTECTED] wrote in message
004801c0bdc7$13afbe00$[EMAIL PROTECTED]">news:004801c0bdc7$13afbe00$[EMAIL PROTECTED]...
|
| - Original Message -
| From: Matt Williams [EMAIL PROTECTED]
| To: boclair [EMAIL PROTECTED]
| Sent: Thursday, April 05, 2001 9:03 PM
| Subject: RE: [PHP-DB] Forms : Validating user input is integer
|
|
| 
|   To gain the full benefit of your suggestion I find that I can
| validate
|   for a wrong entry containing  a mix alphabetical and numerical
|   characters  by altering the elseif line to read
|  
|   elseif (!eregi("[0-9]",$num) || eregi("[a-z]",$num))
|  
|   Agreed?
|  
| 
|   yes and no.
| 
|  I've done a lot of testing for this and using just the first one
has
| never
|  let any values of $num through unles they've contained only
numbers.
|  AFAIK (!eregi("[0-9]",$num) should always return false or 0 or
| whatever it
|  is unless it contains only numbers.
|
| 
| When I used  only  elseif (!eregi("[0-9]",$num) { }
| an input 2i passed the variable 2
| 
|
|  You could also use [^a-zA-Z] for letters you don't want.
|  so maybe something like  (!eregi("([0-9]||[^a-zA-Z])",$num))
|  not tried so don't rely on that.
|
| xx
| correcting some typos this does the job elegantly.  Should read
|
| elseif (!eregi(("[0-9]" || "[^a-zA-Z]"),$num)){  }
| xx

or even just
elseif  (!eregi("[^a-zA-Z]"),$num)) { }


Tim Morris



-- 
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] Oracle vs MS SQL vs MySQL

2001-04-05 Thread Misterio X . - Anonymo

JUST STAY AWAY FROM INFORMIX!!! I've a very good experience with Oracle and
Mysql...
-- 
mail.pt - Um mail para todos - em http://mail.pt/

-- 
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 : Validating user input is integer

2001-04-05 Thread Matt Williams


 or even just
 elseif  (!eregi("[^a-zA-Z]"),$num)) { }

But that would not stop other characters.

M@

-- 
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] Microsoft Access DB PHP

2001-04-05 Thread James Kneebone

I should have classified it a bit more. The server is currently Unix but I
have an option (one that I don't really want to take) of having the whole
website, etc being moved to one of the NT servers.

I read something about iODBC or something like that, but I'm not too
familiar on that topic. I would like a simple solution if possible - if
not, looks like I might change to one of the NT servers and the IIS/PHP
solution.

James

At 08:13 AM 5/04/2001 -0400, Andrew Hill wrote:
James,

Sure - just connect via ODBC and use the odbc_functions in PHP.

Best regards,
Andrew
--
Andrew Hill - OpenLink Software
Director Technology Evangelism
Universal Data Access Integration 
http://www.openlinksw.com


 -Original Message-
 From: James Kneebone [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, April 04, 2001 11:47 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Microsoft Access DB  PHP
 
 
 Hello List,
 
 I have a query in regards to using PHP to only retrieve records from a
 Microsoft Access Database. I would like to know whether it is possible to
 do so with PHP and not have to change completely and use ASP.
 
 Cheers,
 
 James
 
 
 -- 
 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]
 
 
 
* 
James Kneebone

researching KNEEBONE, WILLIAMS, SNELL, NOELL, LEANE, NICHOLLS (Cornwall)
researching ALLAN, WHITTET, McNAUGHTON, NISBET (Scotland)
researching THOMPSON (Ireland)

-- 
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] odbc_exec and error handling in transact sql

2001-04-05 Thread Ilse

Hello,

I have a problem with odbc_exec in combination with error handling in my
stored procedure on sql server7.

When an error in the stored procedure occurs, the procedure finishes with no
problems but the return value of the odbc_exec function is false. The
problem with this false return value is that i, because of that, not the
output parameter of the stored procedure can access through odbc_result.

Does anybody know a sollution?



-- 
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 : Validating user input is integer

2001-04-05 Thread Boclair


"Matt Williams" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
|
|  or even just
|  elseif  (!eregi("[^a-zA-Z]"),$num)) { }
|
| But that would not stop other characters.
|
| M@


Whoops!  Careless of me.  The line should read, and as I tested it,

elseif (eregi("[a-zA-Z]",$num)) { }

Do you see any problem with this?

I have tried with every type and mix of input that I can think of and
was successful in denying all but digit inputs, but I have little
confidence in what I am doing.  With your examples I am at least
coming to some understanding of Dario Gomes article on PHPBuilder.


Tim




-- 
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]




Fw: [PHP-DB] Prob with Ingres II (apache DSO) - repost

2001-04-05 Thread systems



I'm trying  to create a 'libphp4.so', including Ingres support
(-with-ingres=
), and everything on the PHP side seemed to go ok - no errors in the
make.  But an ./apachectl configtest gives this:

Syntax error on line 205 of  .. httpd.conf
Cannot load ... libphp4.so into server: undefined symbol: CM_CaseTab

Any ideas anyone?


thanks a lot


gordon gallacher
inverness, scotland

(Environment:  SuSe Linux 7.1; Apache 3.1.19, PHP 4.0.4pl1; Ingres II)

PS without Ingres, the dso for php4 works fine ...




-- 
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 : Validating user input is integer

2001-04-05 Thread Matt Williams


 Whoops!  Careless of me.  The line should read, and as I tested it,
 
 elseif (eregi("[a-zA-Z]",$num)) { }
 
 Do you see any problem with this?

Yes, same thing it will accept other character like !*- etc...

try

if(!eregi("^[0-9]+[0-9]*$",$num)
{   
  //error
}

M@

-- 
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] odbc_exec and error handling in transact sql

2001-04-05 Thread Renze Munnik

Ilse wrote:
 
 Hello,
 
 I have a problem with odbc_exec in combination with error handling in my
 stored procedure on sql server7.
 
 When an error in the stored procedure occurs, the procedure finishes with no
 problems but the return value of the odbc_exec function is false. The
 problem with this false return value is that i, because of that, not the
 output parameter of the stored procedure can access through odbc_result.
 
 Does anybody know a sollution?
 
 --
 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]


Uhm. Don't you check the result of odbc_exec() then? I mean, if you
know that that function went wrong; isn't that enough to know what
to do (or what _not_ to do)?

I don't realy see the problem here. What's the big diff if odbc_exec
tells you it went wrong or that odbc_result tells you it went
wrong???

-- 

* RzE:

***
**  Renze Munnik
**
**  E: [EMAIL PROTECTED]
**  M: +31 6 218 111 43
***

-- 
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] odbc_exec and error handling in transact sql

2001-04-05 Thread Ilse

Hallo Renze,

Bedankt voor je reactie.

The problem is that the stored procedure in the odbc_exec didn't went wrong.
It encountered an error, handled it and finished the final part of the code
successfully. Unfortunately, the odbc_exec returns false. The stored
procedure has an output parameter who's value i have the use in the
remainder of the php code, but i can not get it through odbc_result because
of the false return value.


"Renze Munnik" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Ilse wrote:
 
  Hello,
 
  I have a problem with odbc_exec in combination with error handling in my
  stored procedure on sql server7.
 
  When an error in the stored procedure occurs, the procedure finishes
with no
  problems but the return value of the odbc_exec function is false. The
  problem with this false return value is that i, because of that, not the
  output parameter of the stored procedure can access through odbc_result.
 
  Does anybody know a sollution?
 
  --
  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]


 Uhm. Don't you check the result of odbc_exec() then? I mean, if you
 know that that function went wrong; isn't that enough to know what
 to do (or what _not_ to do)?

 I don't realy see the problem here. What's the big diff if odbc_exec
 tells you it went wrong or that odbc_result tells you it went
 wrong???

 --

 * RzE:

 ***
 **  Renze Munnik
 **
 **  E: [EMAIL PROTECTED]
 **  M: +31 6 218 111 43
 ***

 --
 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] passing parameters between forms

2001-04-05 Thread Theo de Jong

with

input type=hidden value=$var  name=var

you can pass variables right through a form .
Have to do things differently when working with security issues at hand
though.

!-- search2.php --

 HTML
 BODY
 H1This is the Displaying page/H1
 ?php

 if(mem_id)
 {
 echo("FORM ACTION=search3.php");
 echo("$mem_idBR");
 echo("$nameBR");
 echo("$ageBR");

 echo("INPUT TYPE=hidden VALUE=$mem_id
NAME=mem_id");
 echo("INPUT TYPE=hidden VALUE=$name NAME=name");
 echo("INPUT TYPE=hidden VALUE=$age NAME=age");

 echo("INPUT TYPE=submit VALUE=Enter NAME=Enter");
 //  require("search3.php");
 //  series($mem_id,$name,$age);
 echo("/FORM");

 }
 else{ echo("H2Inconvient data/H2");}
 ?
 /BODY
 /HTML

Sharmad Naik [EMAIL PROTECTED] schrieb in im Newsbeitrag:
[EMAIL PROTECTED]
 Hi,
 I have created a database with following structure

 CREATE TABLE member(
 mem_id INT,
 name TEXT,
 age INT);

 the first page is as follows :

 !-- search1.html --
 HTML
 BODY
H1 This is the  first page /H1
FORM ACTION=search2.php
Member ID :
INPUT TYPE="TEXT" NAME="mem_id"
Member NAME :
INPUT TYPE="TEXT" NAME="name"
Member AGE :
INPUT TYPE="TEXT" NAME="age"

INPUT TYPE="submit" NAME="Enter"
/FORM
 /BODY
 /HTML

 The second page that is search 2.php is as follows :

 !-- search2.php --
 HTML
 BODY
 H1This is the Displaying page/H1
 ?php

 if(mem_id)
 {
 echo("FORM ACTION=search3.php");
 echo("$mem_idBR");
 echo("$nameBR");
 echo("$ageBR");
 echo("INPUT TYPE=submit VALUE=Enter
NAME=Enter");
 //  require("search3.php");
 //  series($mem_id,$name,$age);
 echo("/FORM");
 }
 else{ echo("H2Inconvient data/H2");}
 ?
 /BODY
 /HTML

 This is search3.php

 ?php
 function series($mem_id,$name,$age)
 {
 echo("$mem_id");
 echo("$name");
 echo("$age");
 }

 series($mem_id,$name,$age);

 ?


 In my search3.php I want to insert (which i have not given) or atleast
echo the parameter like mem_id, age and name.My Q
 +is how do i pass the parameters between search2.php and search3.php.If
there is another way out pls tell.
 I tried using functions to get the work done.but couldn't get my way out.

 Can anybody help me?


 Sharmad

 --
 The secret of the universe is @*í!'ñ^#+ NO CARRIER
 ___  _  _  _
 |_|_||_||_||\/||_|| \
 _|| || || \|  || ||_/

 --
 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] ocibindbyname: ORA-01008: not all variables bound

2001-04-05 Thread Paul Fernandez

Hello,

The goal here is to insert a single row, then get a numerical value "id"
(generated by the insert trigger) to use in another insert statement.

I get, "ORA-01008: not all variables bound" when running this script:

?
$query = "insert into table (col1, col2) values ($val1,$val2) returning id
into :id";
$parsed = OCIParse($connection,$query);

OCIBindByName($parsed,":id",$id,-1);

// execute first insert
$cursor = OCIExecute($parsed);

// construct and execute 2nd insert
$query2="insert into table2(id,etc) values (:id, $etc)";
$parsed2 = OCIParse($connection,$query2);
$cursor2 = OCIExecute($parsed2);
?

It seems so simple.  What am I doing wrong?

Paul Fernandez



-- 
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] ocibindbyname: ORA-01008: not all variables bound

2001-04-05 Thread Joe Brown

Don't have a whole lot of practice with the OCIBindByName function, but I
seem to be having success within a recursive select statement.

I'm not useing the  operator in my implementation.  Don't know if that's a
good or a bad thing (yet), but it seems to be functioning properly.

The third parameter you have -1.  I think you want to set it to a legitimate
max field length value.  -1 is used for LOBs, ROWID and FILENAME parameters,
not run of the mill number and varchar2 fields.

perhaps:
OCIBindByName($parsed,":id",$id,32);  //may work better?

""Paul Fernandez"" [EMAIL PROTECTED] wrote in message
9ai699$n70$[EMAIL PROTECTED]">news:9ai699$n70$[EMAIL PROTECTED]...
 Hello,

 The goal here is to insert a single row, then get a numerical value "id"
 (generated by the insert trigger) to use in another insert statement.

 I get, "ORA-01008: not all variables bound" when running this script:

 ?
 $query = "insert into table (col1, col2) values ($val1,$val2) returning id
 into :id";
 $parsed = OCIParse($connection,$query);

 OCIBindByName($parsed,":id",$id,-1);

 // execute first insert
 $cursor = OCIExecute($parsed);

 // construct and execute 2nd insert
 $query2="insert into table2(id,etc) values (:id, $etc)";
 $parsed2 = OCIParse($connection,$query2);
 $cursor2 = OCIExecute($parsed2);
 ?

 It seems so simple.  What am I doing wrong?

 Paul Fernandez



 --
 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] ocibindbyname: ORA-01008: not all variables bound

2001-04-05 Thread Thies C. Arntzen

On Thu, Apr 05, 2001 at 12:47:37PM -0400, Joe Brown wrote:
 Don't have a whole lot of practice with the OCIBindByName function, but I
 seem to be having success within a recursive select statement.
 
 I'm not useing the  operator in my implementation.  Don't know if that's a
 good or a bad thing (yet), but it seems to be functioning properly.
 
 The third parameter you have -1.  I think you want to set it to a legitimate
 max field length value.  -1 is used for LOBs, ROWID and FILENAME parameters,
 not run of the mill number and varchar2 fields.
 
 perhaps:
 OCIBindByName($parsed,":id",$id,32);  //may work better?

this is a working sample:

?php
 
$data = array("larry","bill","steve");
 
$db = OCILogon("scott","tiger");
$stmt = OCIParse($db,"insert into names values (myid.nextval,:name) returning 
id into :id");
OCIBindByName($stmt,":ID",$id,32);
OCIBindByName($stmt,":NAME",$name,32);
 
while (list(,$name) = each($data)) {
OCIExecute($stmt);
echo "$name got id:$id\n";
}
?

re,
tc
 
 ""Paul Fernandez"" [EMAIL PROTECTED] wrote in message
 9ai699$n70$[EMAIL PROTECTED]">news:9ai699$n70$[EMAIL PROTECTED]...
  Hello,
 
  The goal here is to insert a single row, then get a numerical value "id"
  (generated by the insert trigger) to use in another insert statement.
 
  I get, "ORA-01008: not all variables bound" when running this script:
 
  ?
  $query = "insert into table (col1, col2) values ($val1,$val2) returning id
  into :id";
  $parsed = OCIParse($connection,$query);
 
  OCIBindByName($parsed,":id",$id,-1);
 
  // execute first insert
  $cursor = OCIExecute($parsed);
 
  // construct and execute 2nd insert
  $query2="insert into table2(id,etc) values (:id, $etc)";
  $parsed2 = OCIParse($connection,$query2);
  $cursor2 = OCIExecute($parsed2);
  ?
 
  It seems so simple.  What am I doing wrong?
 
  Paul Fernandez
 
 
 
  --
  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] display formatting with a while loop

2001-04-05 Thread Theo de Jong

looks like you could load the desired variables in an array($y,$x) where $y
ranges from 0 to 3..
then you could echo the 4 rows walking through array(0,$x), array(1,$x),
etc.


"olinux" [EMAIL PROTECTED] schrieb in im Newsbeitrag:
000a01c0bdb6$7ec21500$[EMAIL PROTECTED]
 what if i put the if statements inside of another if statement and then
set
 the $i back to 1.

 if ($1 = 4) {
$display .= "/tdtd";
$i = 1;
}

 how exactly would i do this, or is it totally wrong?

 olinux


 - Original Message -
 From: "olinux" [EMAIL PROTECTED]
 To: "PHP-DB" [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Thursday, April 05, 2001 2:47 AM
 Subject: [PHP-DB] display formatting with a while loop


 hey all,
 well, i dont know that a while loop will be my solution, i think that it
 may. What i would like to do is to display 4 variables and then create
 another column. the toughy is that i an using a series of IF'f inside the
 while.

 So something like this:

 while ($1  4) {
if ($var1 == 1)

$display .= "brvariable one is true";
$i++;
}
if ($var2 == 1)

$display .= "brvariable two is true";
$i++;
}
if ($var3 == 1)

$display .= "brvariable three is true";
$i++;
}
if ($var4 == 1)

$display .= "brvariable four is true";
$i++;
}
if ($var5 == 1)

$display .= "brvariable five is true";
$i++;
}
 }

 So ideally instead of getting this (in the browser):

 variable one is true
 variable two is true
 variable three is true
 variable four is true
 variable five is true

 we would see :

 variable one is true|variable five is true
 variable two is true|
 variable three is true  |
 variable four is true   |

 I know that i need to put int a /tdtd between every fourth variable
that
 is printed [cuz if they dont equal 1 they do not print anything]

 My problem is, i do not know how to get these inserted.  I have about 15
 fields so i would like to be able to display them in table cells of 4 or 5
 each.

 Thank you,

 olinux




 _
 Do You Yahoo!?
 Get your free @yahoo.com address at http://mail.yahoo.com


 --
 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] Fatal error: Call to unsupported or undefined functi on mysql_connect()

2001-04-05 Thread Jason Vance

"Call to undefined function" means it doesn't know the name of the function
you are calling.

Hi there, i've had this error as well, using Redhat Linux 7.0.  For me, i'm
using the RPM's to install apache+PHP+MySQL, however, the php-mysql add-on
module is unable to recognize the dependant module mysql.  However i have
already installed and got a mysql database working!

The function mysql_connect() gives me the error "Call to undefined
function", SO I FORCED THE PHP-MYSQL INSTALLATION (rpm --nodeps mysql -i -vv
php-mysql-4.0.4pl1-3.i386.rpm), and i can now use this function to connect
to the database, however, i'm now getting "Warning: Supplied argument is not
a valid MySQL result resource in /var/www/html/test.php on line 9" which is
the mysql_fetch_array() command.

When i list RPM packages on my system versus what the php add-on module is
asking for is (when it fails during installation) the only difference is
case sensitivity?!  Could this be the problem?

Has anyone run into this installation problem of apache+php+mysql RPM on a
redhat linux box?   I guess i'm going to have to compile the servers myself.

Thanks,

Jay

-Original Message-
From: Patrick Dunford [mailto:[EMAIL PROTECTED]]
Sent: April 4, 2001 5:17 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Fatal error: Call to unsupported or undefined
functi on mysql_connect()


On 4 Apr 2001 06:54:45 -0700 AD in php.db, Brunner, Daniel said:

Hello...

Either the Username or Password or Database does not exist...

NO!.

"Call to undefined function" means it doesn't know the name of the function
you are calling.

if the function name is correct you either need to load a mySQL library for
PHP using the dl statement or you need to compile PHP with mySQL support
enabled.

Check with your server administrator.


Do this

$db =3D mysql_connect(server, $user, $password)=20
   or die ("Sorry something is wrong");
$select =3D mysql_select_db("intranet", $db);
   or die ("Sorry something is wrong");

That way you can see if it connects and or if the Database does
exist.


You can also delete $select as well so it would read.

mysql_select_db("intranet", $db);
   or die ("Sorry something is wrong");

That what I use

That really might be the problem..


Learn how to put in debug stuff. It's easier to see your
mistakesI know I had a bunch...



Dan=20




 --
 From:Patrick Sch=E4fer
 Sent:Wednesday, April 4, 2001 7:41 AM
 To:  PHP
 Subject: [PHP-DB] Fatal error: Call to unsupported or undefined
 function mysql_connect()=20
=20
 Can anybody help me with this problem 
=20
 Fatal error: Call to unsupported or undefined function =
mysql_connect()
 in
 dbopen.php on line 7
=20
 $server =3D "localhost";
 $user   =3D "dbuser";
 $password =3D "pass";
 $db =3D mysql_connect($server, $user, $password); -- This is line 7 =
of
 my
 script
 $select =3D mysql_select_db("intranet", $db);
=20
 Thanks,
 Patrick
=20
=20
 --=20
 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]
=20
=20



--
===
Patrick Dunford, Christchurch, NZ - http://pdunford.godzone.net.nz/

   Rejoice in the Lord always. I will say it again: Rejoice!
-- Philippians 4:4
http://www.heartlight.org/cgi-shl/todaysverse.cgi?day=20010404
===
Created by Mail2Sig - http://pdunford.godzone.net.nz/software/mail2sig/


-- 
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] Is there a way to make the field to show more data that showing part of it?

2001-04-05 Thread Scott Fletcher

Hi!

I found an interesting PHP issues here.  I use the "odbc_result_all" to
display everything in the database on the webpage.  I got this instead of
what I expect.  All datas in the field get cut off when displaying it on the
website.  The MS-SQL database showed all of the data in that field.

Here's what it's look like

Website ---
Address the following issues: 1. In order to us this printer with Deal
Pack, you must download and install an Epson FX-100 printer driver (see Deal
Pack Help for details). 2. In order to us this printer with Deal Pack, you
must change some of the de

MS-SQL ---
Address the following issues:  1. In order to use this printer with Deal
Pack, you must download and install an Epson FX-100 printer driver (see Deal
Pack Help for details).  2. In order to use this printer with Deal Pack, you
must change some of the default printer settings within the printer (see
Deal Pack Help for details).

-

Is there a way around it?  PHP is suppose to show them all, not part of it.

Thanks,
 Scott



-- 
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] Passing Arrays

2001-04-05 Thread Jordan Elver

Hi,
How can I pass an array between two pages. I've tried using serialize and 
unserialize. But it doen't return an array. When I use gettype() on it, it 
say's that the typ-e is boolean?

Any ideas?

Cheers,

Jord

-- 
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] mysql_result()

2001-04-05 Thread Jordan Elver

Thanks for everyones help with this one, all suggestions appreciated.

Cheers,

Jord

On Wednesday 04 April 2001 17:06, you wrote:
 Jordan,

 If you know your result is going to product one row, try using:

 $row=mysql_fetch_array($result, MSQL_ASSOC);
 // returns an assoc array where the field names are keys, field value is
 value

 $id=row[id];
 $name=row[name];
 etc.

 Best regards,
 Andrew
 --
 Andrew Hill - OpenLink Software
 Director Technology Evangelism
 eBusiness Infrastructure Technology
 http://www.openlinksw.com

  -Original Message-

  From: Jordan Elver [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, April 04, 2001 11:46 AM
  To: PHP Database Mailing List; PHP General Mailing List
  Subject: [PHP-DB] mysql_result()
 
 
  Hi,
  If I knnow that a query will only retrun one row, can I do thiss (below)
  rather than using a while loop for one record?
 
  $id = @mysql_result($result, 0, 'id');
  $name = @mysql_result($result, 0, 'name');
  $email = @mysql_result($result, 0, 'email');
  $address1 = @mysql_result($result, 0, 'address1');
  $address2 = @mysql_result($result, 0, 'address2');
  $town_city = @mysql_result($result, 0, 'town_city');
  $postcode = @mysql_result($result, 0, 'postcode');
 
  Cheers,
 
  Jord
 
  --
  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] Varible insert

2001-04-05 Thread rjones

Shannon,

If your customer can exit out before they have completed all the forms do
you want their partial information in your database?
If you do not want incomplete records you will want to wait until all fields
have been completed before inserting.
Look into using sessions to store and pass fields between forms.
Otherwise inserting as they complete one form and move to the next wil not
take as much write time as one longer series of data.

Rich
- Original Message -
From: "Shannon Doyle" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, April 04, 2001 9:47 PM
Subject: [PHP-DB] Varible insert


 Hi People,

 It seems like all I am doing lately is going into areas of php that I
 haven't done before and get stuck. Anyway, here is another small request
 that I have.

 I have a series of pages that must insert into a mysql database the
results
 of the entries. I know how to insert these details into a database,
however
 there are over 200 entries across 20 or so pages. What I am in need of
doing
 is the following:

 Is there a way of creating one insert statement that can be used by all
 pages to insert the data from the fields into the appropriate fields in
the
 database? ie the sql insert statement is dynamic and will adapt.

 I have an idea that maybe the "get" method on the form will be of some
help,
 but not sure.

 Any ideas etc would be helpful.

 - Shannon


 --
 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] Passing Arrays

2001-04-05 Thread rjones

Jordan,

Look at Implode() and Explode() for string manipulation of arrays.

Rich
- Original Message -
From: "Jordan Elver" [EMAIL PROTECTED]
To: "PHP Database Mailing List" [EMAIL PROTECTED]; "PHP General Mailing
List" [EMAIL PROTECTED]
Sent: Thursday, April 05, 2001 7:56 AM
Subject: [PHP-DB] Passing Arrays


 Hi,
 How can I pass an array between two pages. I've tried using serialize and
 unserialize. But it doen't return an array. When I use gettype() on it, it
 say's that the typ-e is boolean?

 Any ideas?

 Cheers,

 Jord

 --
 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] Protecting files

2001-04-05 Thread Mick Lloyd

Can anyone point me to a tutorial that explains in words of one syllable how
to protect files/directories without using .htaccess and .htpasswd.

I have log-in screens that search an authorized users database for name,
password, level before they can get into the site. But each time someone (ie
me at the moment) tries to log-in, the browser throws up the (HTTP
Authentication?) dialog box - I guess because I have .htaccess and .htpasswd
protecting the directories where the scripts reside. I would prefer not to
have this happen and rely only on authentication from the database. But how
do I then protect the directories/scripts from anyone wanting to have a look
(not that they're worth much!).

Thanks

Mick Lloyd
[EMAIL PROTECTED]
Tel: +44 (0)1684 560224


-- 
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 : Validating user input is integer

2001-04-05 Thread boclair


- Original Message -
From: Matt Williams [EMAIL PROTECTED]
To: Boclair [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, April 05, 2001 11:28 PM
Subject: RE: [PHP-DB] Forms : Validating user input is integer


The line should read, and as I tested it,
 
  elseif (eregi("[a-zA-Z]",$num)) { }
 
  Do you see any problem with this?

 Yes, same thing it will accept other character like !*- etc...

 try

 if(!eregi("^[0-9]+[0-9]*$",$num)


   file://error
 }


You are right again.  Stops all further processing of the inserted
variable if it is not entirely composed of digits.

It did  not cross my mind to check for ! (shift 1) and similar entry
errors.

Once again, thanks.

Tim

So here is the final working script

?
if ((@!$submit) || empty($num) )
 {
 echo "div align='center'span class='note'No entry was
made/span/div";
include "get_id.php";
 }
if(!eregi("^[0-9]+[0-9]*$",$num))
 {
  echo "div align='center'span class='note'The ID should have
been a  number./span/div";
  include "get_id.php";
}
else
{
   include "do_form.php";
 }
?


Tim


-- 
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] Protecting files

2001-04-05 Thread Ron Brogden

At 03:09 AM 4/5/2001 +0100, Mick Lloyd wrote:
But how do I then protect the directories/scripts from anyone wanting to 
have a look
(not that they're worth much!).

Create a .htaccess file that contains the following:

deny from all

Place it in the directories you wish to protect.  Next, create a script 
which will pass through a given file to a user if certain conditions are 
met (there are a few functions that can help with this under file i/o in 
the PHP manual).

Be EXTREMELY careful on how you handle paths with this.  The best thing to 
do is to make the file requests based on an ID number (remember to force 
the value to an integer in your script) and then associate the "id" with an 
entry in the config file or database so people cannot call your script with 
arbitrary file names.  Make sure you catch the default case where the ID 
does not match a file too just in case.

Cheers



-
Island Net AMT Solutions Group Inc.  Telephone:  250 383-0096
1412 Quadra  Toll Free:1 800 331-3055
Victoria, B.C.   Fax:250 383-6698
V8W 2L1  E-Mail:[EMAIL PROTECTED]
Canada   WWW:   http://www.islandnet.com/
-


-- 
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] Microsoft Access DB PHP

2001-04-05 Thread Fernando Buitrago

Well, PHP has a odbc funcions, all the reference located in www.php.net
 by the way, ASPEdit 2000 tool has a complete referene about these funcions
and PHP, ASP, Perl and others.

Try to use this. Is Good.

Regards

Fernando



-- 
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] Protecting files

2001-04-05 Thread Miles Thompson

Mick,

Since you have the login screens, etc. already, once a user is 
authenticated, start a session and register a session variable, using a 
meaningful value fetched from the database. I use "member_id", but anything 
will do.

At the very top of each page you want to protect, with no spaces or 
ANYTHING before it, add this code:
? session_start(); if( !session_is_registered( "member_id" ) ) { 
header("Location: user_logon.php\n"); } ?
The pages all have to have a .php extension so that this code  will 
execute, but other than this one line they can be straight HTML.

When a user hits the page, coming from anywhere, and doesn't have a session 
registered with something in "member_id", he is redirected to the logon 
page, creatively named "user_logon.php".

The beauty of this is that the session disappears when the browser is 
closed, you can also provide a "logout" function which has only to destroy 
the session variable. Now you can dispense with .htaccess and .htpasswd.

To protect each directory, all you need is an index.php in each, containing 
nothing more than this line. Anyone blundering in will be directed to log 
on. If you prefer to not protect some pages in a directory, leave the line 
off.

More than a word, and I hope it's helpful - Miles


At 03:09 AM 4/5/01 +0100, Mick Lloyd wrote:
Can anyone point me to a tutorial that explains in words of one syllable how
to protect files/directories without using .htaccess and .htpasswd.

I have log-in screens that search an authorized users database for name,
password, level before they can get into the site. But each time someone (ie
me at the moment) tries to log-in, the browser throws up the (HTTP
Authentication?) dialog box - I guess because I have .htaccess and .htpasswd
protecting the directories where the scripts reside. I would prefer not to
have this happen and rely only on authentication from the database. But how
do I then protect the directories/scripts from anyone wanting to have a look
(not that they're worth much!).

Thanks

Mick Lloyd
[EMAIL PROTECTED]
Tel: +44 (0)1684 560224


--
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] Reference

2001-04-05 Thread Fernando Buitrago

I need all the referece Offline Of PHP, where is this?.

regards



-- 
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] Convertion Types

2001-04-05 Thread Fernando Buitrago

Where is the functions referece of convertion types like: isinteger.

Regards.



-- 
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] DIferents types in SQL

2001-04-05 Thread Fernando Buitrago

I need to know if the Query is possible with differents types of fields and
variables to insert or update statements.

PHP sad me that error parse.

Regards.

Note: I need the reference of convertions type's funcions.




-- 
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] Help! installation class redeclare error vbulletlite

2001-04-05 Thread aaron

I'm usiing vbulletlite version 1.1 on IIS 4.0 w/mysql 3.x

I run the install script which creates the database, when I select to
continue I receive the error.

fatal error: cannot redeclare class db_sql_vb in ./db_mysql.php on line 6

I've tried stopping IIS, mysql, but nothing works.

I hope you can help.

Thanks

aaron



-- 
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 : Validating user input is integer

2001-04-05 Thread Boclair


"boclair" [EMAIL PROTECTED] wrote in message
002101c0bd8e$30742e60$[EMAIL PROTECTED]">news:002101c0bd8e$30742e60$[EMAIL PROTECTED]...
| I have a problem with a user input in a form required to be an
| integer, creating a variable for a mysql query.
|
| I have instances where integer, 0, is being typed as letter,o.
| Does anybody know if such validation can be done server side or
| definitely must be done client side?

Brad S Jackson replied suggesting that the php function preg_match()
should be used for this type of server side validation.

^^
Brad,

- Original Message -
From: Brad S. Jackson [EMAIL PROTECTED]
To: boclair [EMAIL PROTECTED]
Sent: Thursday, April 05, 2001 11:54 PM
Subject: Re: [PHP-DB] Forms : Validating user input is integer




 This is probably the most efficient way to check.  The preg
functions are faster
 than the ereg functions so I never use ereg.  I think server side
validation is
 required and client side is optional.

 if(preg_match("/^[0-9]+$/", $var))
echo "Valid";
 else
echo "Invalid";

There you go.  Does the same job as Matt William's  eregi()

I am getting invaluable lessons on this stuff, which I never
understood before.

Using the php preg_match() function the tested script is
_
?
if ((@!$submit) || empty($num) )
 {
   echo "div align='center'span class='note'No entry was
made/span/div";
include "get_id.php";
 }
if(preg_match("/^[0-9]+$/", $num))
 {
   include "do_form.php";
   }
else
   {
   echo "div align='center'span class='note'The ID should have
been a number./span/div";
include "get_id.php";
 }
?
___

Many thanks
^^^
Tim Morris





-- 
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 : Validating user input is integer

2001-04-05 Thread Boclair


Ben Udall [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
| boclair wrote:
|  I have a problem with a user input in a form required to be an
|  integer, creating a variable for a mysql query.
| 
|  I have instances where integer, 0, is being typed as letter,o.
|  Does anybody know if such validation can be done server side or
|  definitely must be done client side?
|
| A basic client-server rule is to never trust the client.  You should
be
| doing all validation on the server side.  Client side validation is
a
| nice feature, but should be in addition to the sever side checking
and
| never required.
|
| Here's the quickest way I know to validate an integer in php:
|
| if (ereg("^[0-9]+$", $input))
| {
|// $input is a valid non-negative integer
| }
|
| or, if negative numbers are valid, use could use this one:
|
| if (ereg("^-?[0-9]+$", $input))
| {
|// $input is a valid integer
| }


Once again, thanks.  This validates for an all digit variable.  In
this case the tested script reads

?
if ((@!$submit) || empty($num) )
 {
   echo "div align='center'span class='note'No entry was
made/span/div";
include "get_id.php";
 }
if (ereg("^[0-9]+$", $input))
 {
   include "do_form.php";
   }
else
   {
   echo "div align='center'span class='note'The ID should have
been a number./span/div";
include "get_id.php";
 }
?

Will I ever get on the ball and stay there

Tim Morris




-- 
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] oracle and php

2001-04-05 Thread Novotn Petr

Hi all,
I am begginer in using ORACLE 8i DB with PHP, so please, could anybody help
me ? When I try to connect or use any OCI or ORA function, it only say me 

Fatal error: Call to unsupported or undefined function ocilogon() in
/home/httpd/html/ora.php3 on line 8

here is the part of code:


?





$handle = OCILogon("scott","tiger");

if ($handle == false ) { echo 'error';
echo ocierror($handle).":".OCIError($handle);
exit;
}


But I suppose, the problem is not in the code, but in some adjustment ...

Thanks,
Petr.



-- 
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] oracle and php

2001-04-05 Thread Vlad

It seems that you must include support of oracle functions (special module)
in your configuration file. In windows it is php.ini file.
 Hi all,
 I am begginer in using ORACLE 8i DB with PHP, so please, could anybody
help
 me ? When I try to connect or use any OCI or ORA function, it only say me

 Fatal error: Call to unsupported or undefined function ocilogon() in
 /home/httpd/html/ora.php3 on line 8

 here is the part of code:


 ?





 $handle = OCILogon("scott","tiger");

 if ($handle == false ) { echo 'error';
 echo ocierror($handle).":".OCIError($handle);
 exit;
 }
 

 But I suppose, the problem is not in the code, but in some adjustment ...

 Thanks,
 Petr.



 --
 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]