Re: [PHP] Fatal error: [] operator not supported for strings

2003-08-19 Thread desa15

==
not
=

$_SESSION[id_produs][]== $_POST[id_produs];



Un saludo, Danny


   

  Daniel 

  [EMAIL PROTECTED]  Para: [EMAIL PROTECTED]  
   
  o   cc: 

   Asunto:   Re: [PHP] Fatal error: [] 
operator not supported for strings  
  19/08/2003 10:06 

   

   





I checked ant that is not the cause of this problem.
Any other sugesstion?


John W. Holmes [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Daniel wrote:

  hi, how do i solve this error?
 
  Fatal error: [] operator not supported for strings
  in /var/www/html/p.../magazin/cos.php on line
  13
 
  line 13 is this line:
 
  $_SESSION[id_produs][]=$_POST[id_produs];
 
  no error when i run in local host , when i upload
  in server (with PHP 4.2.2) only got this error.
 
  first time click is fine, but when i click the
  product once again, i got tat fatal errorhow
  can i solve it?? pls advice. thanks.

 Sounds like you've already assigned a value to $_SESSION['id_produs']
 and are now trying to turn it into an array.

 $_SESSION['id_produs'] = 'string value';
 $_SESSION['id_produs'][] = 'some other value';

 Check your code...

 --
 ---John Holmes...

 Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

 PHP|Architect: A magazine for PHP Professionals ? www.phparch.com







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







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



RE: [PHP] dev style guide

2003-08-08 Thread desa15

The Hungarian notation was developed by a Hungarian programmer from
microsoft.
I use hungarian notation in visual c++ but in php ???
If you have more information search in http://msdn.microsoft.com have
examples and the complete and protability list, to other langauages such vb


Un saludo, Danny


   
   
  Jay Blanchard  
   
  [EMAIL PROTECTED]  Para: Chris W. Parker [EMAIL 
PROTECTED], Mike Migurski [EMAIL PROTECTED], 
  ations.comjsWalter [EMAIL 
PROTECTED]  
  cc: [EMAIL PROTECTED]  
   
  06/08/2003 13:31Asunto:   RE: [PHP] dev style 
guide 
   
   
   
   




[snip]
I've found a few articles on Hungarian notation but none of them have
been all that great. Real wordy and without good examples. Do you have
any examples/articles to contribute?
[/snip]

There is a lot to go on out there
http://www.google.com/search?hl=enie=UTF-8oe=UTF-8q=Hungarian+notatio
n

We have agreed on cetain types (strings are strFoo, integers are intFoo,
doubles are dblFoo, etc.) and allow for other descriptive notation where
standard terms do not work.

HTH

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







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



Re: [PHP] Help with Mod mathematical function

2003-08-06 Thread desa15


if you turn on --enable-bcmath, you can use de bcmod function equivalen to
Mod operator from visual basic


Un saludo, Danny


   

  Dean Baldwin 

  [EMAIL PROTECTED]  Para: [EMAIL PROTECTED]   

   cc: 

  06/08/2003 12:19 Asunto:   [PHP] Help with Mod 
mathematical function 
   

   





Hi,

I am porting a vb application across to php but have come up against a
small
problem. The code uses the Mod calculation however I cannot find any Mod in
php. The line of code that uses it looks like:

Data = (index Mod 16)

Anybody have any ideas how I recreate this in php? Both data and index are
integers.

Regards,
Dean


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







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



Re: [PHP] jabber - chmod on files

2003-08-01 Thread desa15

To change the rights from a php script put the following lines


define('CHMOD_FILES', 0666);
//define('CHMOD_DIRS', 0777);

@chmod(Your file name, CHMOD_FILES);



Un saludo, Danny


   

  Carlos Castillo  

  [EMAIL PROTECTED]  Para: '[EMAIL PROTECTED]' [EMAIL 
PROTECTED] 
  com.co  cc: 

   Asunto:   [PHP] jabber - chmod on files 

  31/07/2003 23:51 

   

   





HI,





I'm using jabber but I have one problem, I did an administrator webpage for
it, so I create the users for jabber in that page, when I create the user,
it creates a xml file with permission of 644 and the owner is apache, but
when I connect on the jabber or that user connects the xml file changes to
600 and the owner to root.





The problem is that I have to read that file after he connects but when I
try I don't have access, because the perm is on 600,





How can I change the perm from the php page, so I change with chmod 644
.xml before I open itor how can I modify jabber so it doesn't
change the perm of the files?





Thanks!





Carlos A. Castillo.
Ingeniero de desarrollo
[EMAIL PROTECTED]




Su Aliado Efectivo en Internet
www.imagine.com.co
(57 1)2182064 - (57 1)6163218
Bogotá - Colombia

- Soluciones web para Internet e Intranet


- Soluciones para redes
- Licenciamiento de Software
- Asesoría y Soporte Técnico













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



Re: [PHP] PHP or CGI in C/C++

2003-08-01 Thread desa15

You can install Zend Optimizer from www.zend.com is free but with comercial
license.

Perform some optimizations in your code to not compile the same code in
each request.


Un saludo, Danny


   

  John Manko   

  [EMAIL PROTECTED]  Para: Decapode Azur [EMAIL 
PROTECTED]  
  cc: [EMAIL PROTECTED]   

   Asunto:   Re: [PHP] PHP or CGI in C/C++ 

  01/08/2003 08:45 

   

   





i did a quick google, and found the following.  hope it helps

http://phpcomplete.com/articles.php?sec=readArticleid=306
http://www.php-accelerator.co.uk

plus, there is something called PHP bcompiler (byte compiler).

I dont know the details of any of these, but should help.  maybe others
can expand on the details.

- John Manko


Decapode Azur wrote:

I would expect compiled C/C++ to be faster as there is no need for
the code to be interperated and compiled on each request.




Is it possible to compile PHP to improve the speed execution ?








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







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



[PHP] Redirect to HTTPS

2003-08-01 Thread desa15
I have a stupid question.

I need if i be in a http make a redirect to https.
Http is a 80 port and ssl is a 443 port

if ($HTTP_SERVER_VARS['SERVER_PORT']==80)
{

 header(Location: https://mynet.com/pay.php;);
 exit;
 }

Is the correct way to do this ??? Exist any function to make this ???



Excuse my broken English, Regards from Spain

Un saludo, Danny



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



Re: [PHP] Right Click Hyperlink

2003-07-31 Thread desa15

you refer to this 

script language=JavaScript
var message=some text;

function click(e) {
if (document.all) {
if (event.button == 2) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
// --
/script
script
!--
 function mOvr(src,clrOver) {
 if (!src.contains(event.fromElement)) {
   src.style.cursor = 'hand';
   src.bgColor = clrOver;
  }
 }
 function mOut(src,clrIn) {
  if (!src.contains(event.toElement)) {
   src.style.cursor = 'default';
   src.bgColor = clrIn;
  }
 }
 function mClk(src) {
 if(event.srcElement.tagName=='TD')
   src.children.tags('A')[0].click();
 }
// --
/script



Un saludo, Danny



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



[PHP] Backtip operator

2003-07-29 Thread desa15
Hi to all, any one can tell me, what is the correct way to write secure
applications in php and how is the best way to remove or prevent the
backtip operator.

I think what my code is very insecure.
What is the correct way to do this ???

$Myusername = isset($HTTP_POST_VARS['username']) ? trim(htmlspecialchars
($HTTP_POST_VARS['username'])) : '';

$Myusername = substr(str_replace(\', ', $Myusername), 0, 25);


   if ($Myusername ==){
  exit;
   }
   elseif (eregi(;, $Myusername) ){
  echo Hacking attempt;
  exit;
   }
   elseif (eregi(`, $Myusername) ){
  echo Hacking attempt;
  exit;
   }

   $Myusername= str_replace(\', '', $Myusername) ;
   $Myusername= str_replace(`, , $Myusername) ;


Un saludo, Danny



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



Re: [PHP] Displaying MySQL data inside of a table

2003-07-28 Thread desa15

$mysql_link = mysql_connect(localhost, USER, PASS);

  mysql_select_db(DB, $mysql_link);

   $SQL = SELECT * FROM tbl;

   $result = mysql_query($SQL, $mysql_link) or die (mysql_error());

   echo table border=1 cellpadding=5;

   while($resultat = @mysql_fetch_array($result)) {

   echo trtd

  $resultat[ip]

/td;

echo /table;
   }

   $mysql_link=mysql_close($mysql_link);

Un saludo, Danny



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



Re: [PHP] Displaying MySQL data inside of a table

2003-07-28 Thread desa15
[EMAIL PROTECTED] wrote:
 $mysql_link = mysql_connect(localhost, USER, PASS);

   mysql_select_db(DB, $mysql_link);

$SQL = SELECT * FROM tbl;

$result = mysql_query($SQL, $mysql_link) or die (mysql_error());

echo table border=1 cellpadding=5;

while($resultat = @mysql_fetch_array($result)) {

echo trtd

   $resultat[ip]

 /td;

here is '/tr' missing:
/td/tr;


 echo /table;
}

the echo '/table'; should come after the closed while:
}
echo '/table';

$mysql_link=mysql_close($mysql_link);

 Un saludo, Danny

ciao SVEN


Excuse me, i write directly in the e-mail





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



[PHP] Help with cache-proxies

2003-07-25 Thread desa15
Hi to all, i have a big problem, i use a phpBB forum in my page, here in
Spain the ISP's use a cache proxie system.

And when change anything in my forum such as image or new functionality, my
users can not view the forum.

Yesterday i include a visual system confirmation to register, and today my
users can not view the forum.

This is the header directives of the header file of the forum

if (!empty($_SERVER['SERVER_SOFTWARE'])  strstr($_SERVER
['SERVER_SOFTWARE'], 'Apache/2'))
{
  header ('Cache-Control: no-cache, pre-check=0, post-check=0');
  echo Apache 2;
}
else
{
  header ('Cache-Control: private, pre-check=0, post-check=0,
max-age=0');
  echo Apache;
}
header ('Expires: 1');
header ('Pragma: no-cache');

Any one can help me

Excuse my broken english





Un saludo, Danny



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



Re: [PHP] File upload

2003-07-25 Thread desa15

a litle example of my upload file

form enctype=multipart/form-data method=post action=doupload.php 
p align=center
input name=userfile type=file  size=30 style=font-family: v;
font-size: 10pt; color: #5E6A7B; border: 1px solid #5E6A7B; padding-left:
4; padding-right: 4; padding-top: 1; padding-bottom: 1br
br
button type=submit style=font-family: v; font-size: 10pt; color:
#5E6A7B; border: 1px solid #5E6A7B; padding-left: 4; padding-right: 4;
padding-top: 1; padding-bottom: 1Transferir/button
/p
/form


doupload.php

?php
include configimage.php;

$image_name= $HTTP_POST_FILES['userfile']['name']; //El nombre original del
fichero en la máquina cliente.

$image_type= $HTTP_POST_FILES['userfile']['type'];//El tipo mime del
fichero (si el navegador lo proporciona). Un ejemplo podría ser
image/gif.

$image_size= $HTTP_POST_FILES['userfile']['size'];//El tamaño en bytes del
fichero recibido.

$image_tmp= $HTTP_POST_FILES['userfile']['tmp_name']; //El nombre del
archivo temporal

$mime_type=array(image/jpeg,
 image/pjpeg,
 image/gif,
 image/x-png );

$ext = strrchr($image_name,'.');

  $endresult = font size=\2\El archivo ha sido transferido bra
target=_blank href=http://bmwfaq.com/uploads/$image_name
http://www.bmwfaq.com/uploads/$image_name /a/font;

  if ($image_name == ) {
$endresult = font size=\2\No se han seleccionado
archivos/font;

  }elseif (($size_limit == yes)  ($limit_size  $image_size)){
$endresult = font size=\2\El archivo es demasiado
grande/font;

  }elseif (($limit_ext == yes)  (!in_array(strtolower
($ext),$extensions))) {
$endresult = font size=\2\Este tipo de archivo no está
permitido/font;

  } elseif (!in_array($image_type, $mime_type)) {
$endresult = font size=\2\Este tipo de archivo no es una
imágen/font;

  } elseif (file_exists($absolute_path/$image_name)) {
  $endresult = font size=\2\El archivo ya existe en el
servidor/font;
  } else {
if (is_uploaded_file($image_tmp)){
  copy ($image_tmp,$absolute_path./.$image_name);
}else{
  Possible file upload attack. Filename:  .
$HTTP_POST_FILES['userfile']['name'];
}

  }
?




   

  Peda   

  [EMAIL PROTECTED]  Para: [EMAIL PROTECTED] 

   cc: 

  25/07/2003 13:51 Asunto:   Re: [PHP] File upload 

   

   







 maybe you should try $HTTP_POST_FILES?

I have tryed that too, but nothing happened.



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







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



[PHP] Load in a dedicated server

2003-07-24 Thread desa15
Hit to all, i have a Sun cobalt Raq 550, with php 4.1 as a module with
apache 1.3

The load average of my server is ever above 0.20 to 0.60 whith the same
users

When i turn off register globals and turn on safe mode in php.ini and
restart the apache daemon to take the changes, the load averge is ever 0.90
to 1.20

I not found anything about this params affect the optimization, is posible
???
any can help me ??


Best rtegards, and excuse my broken english




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



Re: [PHP] Load in a dedicated server

2003-07-24 Thread desa15

* Thus wrote [EMAIL PROTECTED] ([EMAIL PROTECTED]):
 Hit to all, i have a Sun cobalt Raq 550, with php 4.1 as a module with
 apache 1.3

 The load average of my server is ever above 0.20 to 0.60 whith the same
 users

 When i turn off register globals and turn on safe mode in php.ini and
 restart the apache daemon to take the changes, the load averge is ever
0.90
 to 1.20

Have you tried toggling each one seperatly to see which one is
causing the overhead. My bet would be the safe_mode since it has
extra work to do.

If that is the case safe_mode is VERY expensive, or something is
wrong. I hope (nothing personal) that there is something wrong with
your php scripts, because that is too high of a price to pay for
safe_mode.


Curt
--
I used to think I was indecisive, but now I'm not so sure.


I found the problem, my scripts works fine :), apache work fine and lightly
load :).
safe mode and mysql persistent connections is a bad idea, in a server with
high load.
I change to non persisten connections and everything works ok, but the
performance is no
acceptable. The first step is change to a cache system to reduce the load
in a server, with
persistent connections.

Excuse my broken english.

Thx


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





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



Re: [PHP] How to execute a bat file on the Apache server

2003-07-22 Thread desa15

Use

algo.bat

REM Output from a batch file
Dir C:\
sleep 10

?php
echo  exec (C:/algo.bat);
?

or

?php
echo system (C:/algo.bat);
?


Check if the safe_mode is on, and turn to off


Un saludo, Danny



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



Re: [PHP] Variable not passed twixt pages..

2003-07-18 Thread desa15

echo $HTTP_GET_VARS['mailaddress'] ;



Un saludo, Danny



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



Re: [PHP] popping up download dialog box

2003-07-18 Thread desa15

if (!empty($file['file_data'])) {
  if (get_user_os() == MAC) {
header(Content-Type: application/x-unknown\n);
header(Content-Disposition: attachment; filename=\.$file
['file_name'].\\n);
  }
  elseif (get_browser_info() == MSIE) {
$disposition = (!eregi(\.zip$, $file['file_name'])  $action !
= zip  $action != lightbox) ? 'attachment' : 'inline';
header(Content-Disposition: $disposition; filename=\.$file
['file_name'].\\n);
header(Content-Type: application/x-ms-download\n);
  }
  elseif (get_browser_info() == OPERA) {
header(Content-Disposition: attachment; filename=\.$file
['file_name'].\\n);
header(Content-Type: application/octetstream\n);
  }
  else {
header(Content-Disposition: attachment; filename=\.$file
['file_name'].\\n);
header(Content-Type: application/octet-stream\n);
  }
  header(Content-Length: .$file['file_size'].\n\n);
  echo $file['file_data'];
}
exit;

Un saludo, Danny



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



Re: [PHP] 4.3.2 fopen() problem/limit?

2003-07-17 Thread desa15

check if  allow_url_fopen is  on  in /etc/php.ini or C:\Windows\php.ini



Un saludo, Danny



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



Re: [PHP] 4.3.2 fopen() problem/limit?

2003-07-17 Thread desa15

ohh, excuse me, i read bad your message.
What is the size of the file ??
check in php.ini  the postmax_size param.

Is very strange

Un saludo, Danny



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



[PHP] PHP About Security

2003-07-16 Thread desa15
Hi to all.

I attempt to make security my host i change the following params in php.ini

allow_url_fopen = Off

safe_mode =on
safe_mode_gid = on
disable_functions = readfile,system

Any sugestion, or comment about make php secure ??

Excuse by my broken english

Un saludo, Danny



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