[PHP] Re: newbie:restricting users to change data in a textarea

2003-03-18 Thread Coert Metz
You can put READONLY in your TEXTAREA tag

Coert Metz

Mirco Ellis wrote:
Hi all,

I have a app that enables the user to call data out of a mysql database into
textareas. They can then edit the data and update the database. There is one
field that I whant to stop them from changing. This field I also use in my
sql query when updating the table,ie. where variable='$variable'. So what I
did was simply this:
"\n";
print "\t$variable\n";
print "\n";
instead of:

print "".stripslashes($row['variable'])."";
This definately stopped them from editing it but also disabled the mysql
query from working. Can anyone just give me a couple of ideas how I can make
this work.
Thanks
Mirco



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


[PHP] Re: Really simple string search question

2003-03-16 Thread Coert Metz
You can use strstr, stristr, strpos or regular expressions.
Maybe it's good to check the manual at php.net first before asking
a question ;)
Coert Metz

Kevin - Kd Micro Software wrote:
Hello all,

This is probably a really easy thing to answer but I don't know what the
answer is so if you lot could help me I would appreciate it.
Here's 3 examples:
$var="www.google.com";
$var="blah blah google blah";
$var="google rules";
Now I just want to see if $var contains the word 'google' in it - which all
3 of the above do.
Is there a way to do this?

Kevin Green
KD Micro Software
E-Mail: [EMAIL PROTECTED]
Internet: http://www.kdmicro.com.au



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


[PHP] Re: help me please

2003-03-16 Thread Coert Metz
Hi

Look at http://www.nusphere.com/
Here you can download apache, mysql, php and more with
an easy to use install programm for free.
It works nice for me!

Coert Metz

Blair Robinson wrote:
Hello,
 I am making a web site i just want to be able to view my php outputs On my Computer how do i do this i have downlaoded the 1mb windows php installer. and have the zipped version(4.3.0) that is 4mb I have windows xp. Can you please point me in the right direction or give me some answers on how to view my pages.
 
 Thanks
 Blair.



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


[PHP] Re: fopen

2003-03-16 Thread Coert Metz
Hi

If i'm reading your code in the right way, i think
you can better use the file_exists function available
in php
Read the manual at:
http://www.php.net/manual/nl/function.file-exists.php
Many success

Coert Metz

Sebastian wrote:
hello,

i have this snippet of code, from what i can tell it works .. just wondering
if i am doing it in a correct way, or if there is a better, or faster way.
thanks for any input.
$fp = @fopen("$_SERVER[DOCUMENT_ROOT]/images/$mapname.jpg","r");

if ( $fp )
 {
 $mappic = "";
 }
@fclose ( $fp );
echo $mappic;

cheers,
- Sebastian


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


[PHP] Re: PROBLEMS

2002-11-14 Thread Coert Metz
call session_start() before 

in this way:



..


and so on...

Coert Metz

Ysrael guzmán wrote:

THIS IS MY SCRIPT:
AND THE ERROR IS 
Warning: Cannot send session cache limiter - headers already sent
(output started at
c:\foxserv\www\t-demo1\pedidos\prod_mostrar_tipo.php:4) in
c:\foxserv\www\t-demo1\pedidos\prod_mostrar_tipo.php on line 5


///  SCRIPT  ///




session_start();
if(!session_is_registered("camion"))
   DIE("error");
?>



//require "comun.inc"; para llamar a la conexion mejor poner include
//include "array.inc" para funciones de array
$conexion = mysql_connect("localhost", "root");
mysql_select_db("bd1", $conexion);
?>






echo $codigo;
// función que determina si un determinado valor coincide con 
// un elemento que pertenece al array que se pasa como parámetro  
//
//function esta_en_array($objetos, $elemento)
//   {
//   $i = 0;
//   $encontrado = false;
//   while (($i < count($objetos)) && !$encontrado)
//  {
//  while($elemento = each($objetos[$i]))
//  {
//  $encontrado = ($objetos[$i] == $elemento);
//  $i++;
// }
//  }
//   return $encontrado;  
//   }
//
$consulta = "select * from productos where prod_cod = '$codigo'";
$rta = mysql_query($consulta, $conexion);
$num_filas = mysql_num_rows($rta);
$num_campos = mysql_num_fields($rta);
//echo $num_filas;
while($filas = mysql_fetch_array($rta))
{
$codigo = $filas['prod_cod'];
$nombre = $filas['prod_descripcion'];
$precio = $filas['prod_precio'];
 	 		echo "";
   		echo "";
echo "
face='verdana' size=2>", $filas['prod_descripcion'], "";
echo "";
echo "
";
echo "
ACTION='guardar_array.php'>\n";
echo "";
echo "";
 			//echo "
VALUE='$filas['prod_cod']'>";
 			echo "";   
 //		if (esta_en_array($camion, $cantidad))
  //	   {
//   echo "VALUE='$cantidad' size='15'>";
  //  }
//else
  //  { 
//   $cantidad = 0;
  // echo "VALUE='$cantidad' size='15'>";
//}
 // echo ">";
  
  
  echo "
VALUE='$codigo'>\n";
  echo "
VALUE='$nombre'>\n";
  echo "
VALUE='$precio'>\n";
  


 // echo "";
 // echo "";

  echo "";
  echo "\n";
  echo "";
  
  echo "";
  echo "";
	   




		 		echo "";
echo "";
echo "";
echo "";
echo "";

		 		echo "";
echo "
width='100%'>";
echo "CODIGO: 
color='red' face='verdana' size=2>", $filas['prod_cod'], "\n";
echo "";
echo "";

echo "";
echo "
width='100%'>";
echo "PRESENTACION: 
color='red' face='verdana' size=2>", $filas['prod_presentacion'],
"\n";
echo "";
echo "";

echo "";
echo "
width='100%'>";
echo "FABRICANTE: 
color='red' face='verdana' size=2>", $filas['prod_fabricante'],
"\n";

echo "";
echo "
width='100%'>";
echo "DESCRIPCION: 
color='red' face='verdana' size=2>", $filas['prod_propiedades'],
"\n";
echo "";
echo "";	
}
	
echo "";
?>










mysql_free_result($rta);
mysql_close($conexion);
?>



Ysrael Guzmán Meza


-Mensaje original-
De: BigDog [mailto:bigdog@;venticon.com] 
Enviado el: Jueves, 14 de Noviembre de 2002 09:54 a.m.
Para: [EMAIL PROTECTED]
Asunto: RE: [PHP] PHP Auth with Apache


You are sending the header information to the browser before the session
stuff begins...


make sure that you call "session_start();" right after your 
tag...



On Thu, 2002-11-14 at 21:50, Ysrael Guzmán wrote:

I have a problem, i'm new in PHP

It is the problem in my browsegive me the solution please

Warning: Cannot send session cache limiter - headers already sent 
(output started at c:\foxserv\www\t-demo1\pedidos\prod_oficina.php:5) 
in c:\foxserv\www\t-demo1\pedidos\prod_oficina.php on line 6


HELP MEEE!!1

Sos

ygm




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




[PHP] shell_exec problem

2002-11-14 Thread Coert Metz
Hi everybody

I have some few problems with the shell_exec command.
I want to send a fax with hylafax using the sendfax program in linux.
When I try to do shell_exec ("sendfax -n -d faxnumber faxfile") it will 
not work I can see in my httpd file that linux only gets the command 
'sendfax' and not the parameters '-n -d .'.

Can anybody help me?

Thanks in advance

Coert Metz


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



[PHP] Re: scanning for non alpha characters

2002-11-14 Thread Coert Metz
PHP also supports regular expressions
Check the manual at php.net for more information
(ereg_replace a.s.o)

Coert

Cj wrote:

I want to scan the variables passed from teh url of my script for non alpha
characters.  The variables should only consist of a-z A-Z 0-9 and spaces,
full stops and commas (Basically I don't want scripts to be passed via the
variable to the server)

I've used perl a long time ago and its regular expressions seemed ideal for
this kind of thing.  Can enybody suggest a scrip to remove unwanted
characters from my variable?





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