Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Pages: [1] 2
Print
Topic: PHP Upgraded to 5.2.x  (Read 17430 times)
« on: January 17, 2007, 09:58:23 PM »
Alex Melen Offline
President / Founder
Administrator
Addict

View Profile WWW
*****
Posts: 2,076



PHP on free hosting has been upgraded to 5.2.x because of recent security issues with the 4 branch.
Logged


 
« Reply #1 on: January 18, 2007, 04:14:49 AM »
enWILLYado Offline
Newbie

View Profile
*
Posts: 10



How can I use the next php funtion: "fopen" ??

I have seen the phpinfo() and "fopen" and "fwrite" are in the disable_functions... why?
Logged
« Reply #2 on: January 18, 2007, 04:35:08 AM »
krisverbeke Offline
Newbie

View Profile
*
Posts: 1



Has readfile() been disabled?
edit: yes, i see it is in disable_fuctions. Can it be enabled again?

« Last Edit: January 18, 2007, 04:59:44 AM by krisverbeke » Logged
« Reply #3 on: January 18, 2007, 07:06:35 AM »
Alex Melen Offline
President / Founder
Administrator
Addict

View Profile WWW
*****
Posts: 2,076



fopen and fwrite have always been disabled because they can be used to modify files outside of your dir. Same goes for readfile.

readfile() isn't disabled. the following is a list of functions that are disabled and have always been disabled.

system,exec,phpinfo,escapeshellarg,upload_file,rmdir,escapeshellcmd,passthru,proc_close,proc_open,shell_exec,chmod,chown,chroot,chgrp,fsockopen,ftp_connect,ftp_ssl_connect,pfsockopen,socket_connect,socket_create,socket_listen,socket_bind,socket_accept,socket_create_listen,socket_send,socket_write,socket_read,symlink,mail,rename,copy,phpinfo,dl,system,info,upload,system,exec,passthru,eval,is_uploaded_file,move_uploaded_file,escapeshellcmd,popen,pcntl_exec,readfile,shell_exec,escapeshellarg,proc_close,proc_open,ini_alter,popen,show_source,curl_exec,fwrite,fopen
Logged

« Reply #4 on: January 18, 2007, 09:10:48 AM »
enWILLYado Offline
Newbie

View Profile
*
Posts: 10



Never have always been disabled. "fopen" and "fwrite" I have been utilizing them and as of today they have worked .

And how do we use now some to write and to read files from php? What alternatives exist ?
Logged
« Reply #5 on: January 18, 2007, 11:20:31 AM »
Alex Melen Offline
President / Founder
Administrator
Addict

View Profile WWW
*****
Posts: 2,076



I re-enabled them for the time being.. but in general, you could use something like this instead:

// set file to read
$file = '/usr/local/stuff/that/should/be/elsewhere/recipes/omelette.txt';
// read file into string
$data = file_get_contents($file) or die('Could not read file!');
// print contents
echo $data;
Logged

« Reply #6 on: January 18, 2007, 11:42:24 AM »
enWILLYado Offline
Newbie

View Profile
*
Posts: 10



Now, this works. I can read the files Smiley but... How can I write files now?

[Rename and others funcions?]
Logged
« Reply #7 on: January 18, 2007, 12:18:48 PM »
Alex Melen Offline
President / Founder
Administrator
Addict

View Profile WWW
*****
Posts: 2,076



Rename has been disabled for years now... there are other ways to change the file name without rename().. just search google. I'll check it out and see if its worth re-enabling rename.
Logged

« Reply #8 on: January 18, 2007, 01:30:32 PM »
beroo Offline
Newbie

View Profile
*
Posts: 3



what happened to my forum???

http://beroo.t35.com/shabab/index.php
Logged
« Reply #9 on: January 18, 2007, 02:19:49 PM »
enWILLYado Offline
Newbie

View Profile
*
Posts: 10



Since the upgraded, the important and frequently used funcion to write and read files have been disabled.

The administrador should re-active them while WE change the php codes.
Logged
« Reply #10 on: January 18, 2007, 03:28:03 PM »
beroo Offline
Newbie

View Profile
*
Posts: 3



thank you enWILLYado

but  do i have to send to any one email to do that ?
Logged
« Reply #11 on: January 18, 2007, 03:45:59 PM »
chickenmeister Offline
master of chickens
Global Moderator
Member

View Profile WWW
*****
Posts: 211



what happened to my forum???

http://beroo.t35.com/shabab/index.php

I can't really say for sure, but that seems like it would be a non-related issue. If it were because of this you would get a php Warning or Fatal error, rather than just a blank page. You check to make sure that your source code for that page is still intact.

And I can fopen(), fread() and fwrite() files just fine right now, and always have been able to. And I'm glad we have php 5 now. There are some php 5 functions that i've wanted to use in the past, and now i can! Smiley

Logged

Hello world!
« Reply #12 on: January 18, 2007, 04:15:12 PM »
Alex Melen Offline
President / Founder
Administrator
Addict

View Profile WWW
*****
Posts: 2,076



http://beroo.t35.com/shabab/index.php seems in related.. the file is just blank.
Logged

« Reply #13 on: January 18, 2007, 06:23:33 PM »
enWILLYado Offline
Newbie

View Profile
*
Posts: 10



THE NEXT SCRIPT READS A VARIABLE ($var) FROM A FILE ($fileold) AND IT WRITES THE VARIABLE ($var) IN OTHER FILE ($fileold):
Code:
<?php

// set file to read ($fileold.txt)
$fileold "fileold.txt";
// read file into string
$var file_get_contents($fileold /*or die('Could not read file!')*/ ;

// set file to write ($filenew.txt)
$filenew "filenew.txt";
// write variable into the file
$fp fopen ($filenew,"w");
fwrite ($fp$var);
fclose ($fp);

?>

THE NEXT FUNCTION DON NOT WORK:
Code:
$file = "file.txt";$fileread = fopen ($file,"r");$var = $fileread[0];

When changing codes, all my Web worked !
 cool
« Last Edit: January 18, 2007, 06:28:58 PM by enWILLYado » Logged
« Reply #14 on: January 19, 2007, 04:41:08 AM »
beroo Offline
Newbie

View Profile
*
Posts: 3



Mr. Alex Melen : the file isn't blank and it was work

Mr. enWILLYado
thank you again to your help
but pleas were i but that script and how?
Logged
 
Pages: [1] 2
Print
Jump to:  

Powered by SMF | SMF © 2006-2008, Simple Machines LLC