Deftone Posted July 27, 2006 Share Posted July 27, 2006 Hi,Again I'm going to ask foryor help. :'(I have script that give me the possibility to upload the foto's to my gallery.Since PHP 5 this script is not working.When I fill all the info the fields turns blank but nothing happens Can you help me again ?[code]<?phpinclude ('_mySQL.php');if ($toevoegen == "ja") {if ($pwd == "$pass") {$database_server = mysql_connect("$host","$user","$pass");mysql_select_db("$database", $database_server);mysql_connect("$host","$user","$pass");mysql_select_db("$database");$query = "SELECT id FROM plaatjes ORDER BY id DESC LIMIT 0, 1";//Select$resultaat = mysql_query($query) or die ("Het ophalen van de gegevens is mislukt.");while ($record = mysql_fetch_object($resultaat)) {$beschikbaar = $record->id + 1;}$map = "../uploads/";$mapa = "../fotos/";//uploaden// Bestands naam opvragen$bestand2 = explode("\\", $bestand_name);$laatste = count($bestand2) - 1;$bestand2 = "$bestand2[$laatste]"; //$bestand2 = "$beschikbaar.jpg";$aaa = "$beschikbaar.jpg";// Save file copy($bestand, "$map$bestand2"); print ("De afbeelding is met succes geupload.<br>");//Renamerename("$map$bestand2", "$mapa$aaa");echo "De afbeelding is met succes hernoemd.<br><br>";$bestand = "$thumbnail";$map = "../uploads/";$mapa = "../thumbnails/";//uploaden// Bestands naam opvragen$bestand2 = explode("\\", $bestand_name);$laatste = count($bestand2) - 1;$bestand2 = "$bestand2[$laatste]"; //$bestand2 = "$beschikbaar.jpg";$aaa = "$beschikbaar.jpg";// Save filecopy($bestand, "$map$bestand2"); print ("De thumbnail is met succes geupload.<br>");//renamerename("$map$bestand2", "$mapa$aaa");echo "De thumbnail is met succes geupload.<br><br>";[/code] Quote Link to comment Share on other sites More sharing options...
Deftone Posted July 27, 2006 Author Share Posted July 27, 2006 No one :'( Quote Link to comment Share on other sites More sharing options...
spfoonnewb Posted July 27, 2006 Share Posted July 27, 2006 Do you need PHP 5, if not why not just revert back to version 4? Quote Link to comment Share on other sites More sharing options...
Deftone Posted July 27, 2006 Author Share Posted July 27, 2006 Yeah good question.Becouse My new host only have PHP5 ;) Quote Link to comment Share on other sites More sharing options...
Deftone Posted July 27, 2006 Author Share Posted July 27, 2006 By the way this is the last script that don't work.The other I get fixed with help from this forum Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted July 27, 2006 Share Posted July 27, 2006 When your host upgraded to version 5 they finally bit the bullet and disabled register_globals (http://www.php.net/register_globals), like they should have a few years ago when the default changed from enabled to disabled. To fix your problems, you need to start using the super global arrays $_POST, $_FILES, etc.Read the section in the manual.Ken Quote Link to comment Share on other sites More sharing options...
Deftone Posted July 30, 2006 Author Share Posted July 30, 2006 Hi Ken,I try to make it work but it did not worked.I'm to new in this world to fix it. Quote Link to comment Share on other sites More sharing options...
Deftone Posted August 1, 2006 Author Share Posted August 1, 2006 Ok maybe I'm a littlebit futher.Now when I try to upload something I get this error:[code]Warning: rename(../uploads/,../fotos/317.jpg) [function.rename]: Permission denied in /home/knr11315/domains/kimi-raikkonen.nl/public_html/plaatjes/toevoegen.php on line 40[/code]The line 40 in the php script is like this:[code]rename("$map$bestand2", "$mapa$aaa");[/code]What is wrong with this one ? Quote Link to comment Share on other sites More sharing options...
SharkBait Posted August 1, 2006 Share Posted August 1, 2006 Just seems that the permissions on the script that needs to rename the file is incorrect. Or that the directory where the file is to be renamed does not have the correct permissions either... Quote Link to comment Share on other sites More sharing options...
Deftone Posted August 1, 2006 Author Share Posted August 1, 2006 I chmod throug SSH all the files to 777So I dont think it's the permission issueI also call the webhost but they said that it's the script that couses the problem Quote Link to comment Share on other sites More sharing options...
spfoonnewb Posted August 2, 2006 Share Posted August 2, 2006 Although my problem was on a VPS I had an issue with ownership, I had to run chown & chngrp commands on shell, and to put the directories at 777Since I dont know if your on shared hosting or what? I cant help too much.Is PHP_Safe_Mode On? I also had a problem with that, and had to turn it off. Quote Link to comment Share on other sites More sharing options...
Deftone Posted August 2, 2006 Author Share Posted August 2, 2006 Dear,I'm on the shared hosting.I think that's the problem is that I'm the ftp user and I don't have permission to rename files.But how to change the user? Iknow that php knows two users php and ftp I chmod the files already to 777 but it's not helping. Quote Link to comment Share on other sites More sharing options...
spfoonnewb Posted August 3, 2006 Share Posted August 3, 2006 You can use: (In Shell)chgrp -Rv GROUPNAME /root/path/file.phpchown -Rv USERNAME /root/path/file.phpYou'll need to know what the username and group are to do that though, so id ask you host.Some ftp/sftp programs will tell you what they are by right-clicking a file you can use and hitting properties, I know WinSCP does that.Make sure you right click a file that you have rights to rename/edit. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.