[PHP] File Type Validation problem.

2003-03-29 Thread Webmaster MBT
Hi I am wondering if any one can help me please:

 

I'm trying to validate a file when uploading it. I want only to accept .jpg
and .gif files so I'm trying to use.

 

If(($file_type = = " image/JPEG") || ($file_type = = "image/GIF"))

 

But it will not let through even the .jpg or .gif images.

 

I was thinking of validating the filename to end up in .gif or .jpg, but
since it exists the $file_type, I'm sure I'm doing something wrong.

 

Your help is greatly appreciated.

 

LRC Elliot J. Balanza

CEO

M&B Trading Co., SA de CV

Bringing the world together

[EMAIL PROTECTED]

www.mbtradingco.com

58748874 

 



[PHP] Image size, (not weight) help

2003-03-29 Thread Webmaster MBT
Hi:

I would like to know if there is a way to know the size foan image when
uploading it from a form page on PHP.
I know the weight can be measured with $file_size but what Im looking for is
to be able to validate if an image is more than 220pixels width or of
height.

Thanks in advance

EJB



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



[PHP] How to delay a header( Location: )

2003-03-21 Thread Webmaster MBT
Hi I need to delay the jump of a page that uses header(location: ) to jump.

Ive tried adding a , after the file name (that's how we do it on html) but
it doesn't work

 

Any Ideas?

 

EJB



[PHP] How to detect if a cookie is set?

2003-03-21 Thread Webmaster MBT
Hi I'm trying to make a script that first figures out if a cookie is set, if
not,do this, if so, do that.

Can I use:

Isset($HTTP_COOKIE_VARS['nick'] or what should I use?

EJB



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



[PHP] problem with importing fields.

2003-02-14 Thread Webmaster MBT
Hi List.

I have been working on a problem that is driving me crazy.

I have to create a process in which I upload some info to a table. Since I
have to add some different information to that table, I decided to do it
like this.

1.I create a temporary table copying the structure of my final table. I.E.
$query_temp_table="CREATE TEMPORARY TABLE tguias SELECT * FROM guias WHERE
1=0";
$temp_table=mysql_query($query_temp_table, $cosmo_logistic) or
die(mysql_error());
I do this in PHP.
It works fine It seems.
2. I populate the temporary table.
$query_populate_tguias="LOAD DATA LOCAL INFILE
'c:/cosmo/www/upload/guias.txt' INTO TABLE tguias FIELDS TERMINATED BY ','
ENCLOSED BY '\"'
(cliente,asesora,extra1,peso,albaran,gerente,tipo,imprimir)";
$populate_tguias=mysql_query($query_populate_tguias, $cosmo_logistic) or
die(mysql_error());
3. Then I pass the information along with some other variables to the real
table.
mysql_select_db($database_cosmo_logistic, $cosmo_logistic);
$query_poblar = "SELECT * FROM tguias";
$poblar = mysql_query($query_poblar, $cosmo_logistic) or die(mysql_error());
$row_poblar= mysql_fetch_assoc($poblar);
$totalRows_poblar= mysql_num_rows($poblar);
   do { 
mysql_select_db($database_cosmo_logistic, $cosmo_logistic);
$query_poblar_guias="INSERT INTO guias
(cliente,asesora,peso,albaran,gerente,tipo,imprimir,manifiesto,Status)
VALUES
(\"".$row_poblar['cliente']."\",\"".$row_poblar['asesora']."\",".$row_poblar
['peso'].",\"".$row_poblar['albaran']."\",\"".$row_poblar['gerente']."\",\""
.$row_poblar['tipo']."\",".$row_poblar['imprimir'].",\"".$manifiesto."\",\"A
\")";
$poblar_guias=mysql_query($query_poblar_guias, $cosmo_logistic) or
die("No pude insertar el registro ".mysql_error());
} while ($row_poblar=mysql_fetch_assoc($poblar));?>

with this source file:
"13DAN010","D79406","13DAN010", 1 ,"20430002201","75301;753","PAQUETE","1"
"13DAN010","D55816","13DAN010", 1.32
,"20430003101","100201;1002","PAQUETE","1"

it Does not work at all. I wonder if it is because it has a . in the number
even as the field receiving it is a decimal(10,2) or if it is because in one
of the field I have ;. 

The thing is that it will import one, and skip one full record each time.
But the one it inserts, is correctly inserted with the ; and the decimal
point correct. Any idea why it might be pasing one row and adding one?

This is driving me crazy.

When I do this same procedure on another table with source code like: 
"D79427","LOPEZ DURAN ELISA","ACUEDUCTO TARRAGONA 59","15","PASEOS DEL
BOSQUE","NAUCALPAN","53297"," ","LOPEZ DURAN ELISA","",F,T

it Works correctly even as it has two false or true fields.







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