Jump to content

s-o-s

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

s-o-s's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Im trying to test a file upload to a remote server and getting nowhere, I have listed below a simple html form to collect the file for upload. The phpfile file is attached to do the upload. I have heard that the php.ini file needs to have a variable set currently upload_tmp_dir was set to NULL. I have changed this in a local copy of php.ini which I believe needs to be changed I am not familiar with the correct syntax for this but have included by version below also. The file format is root/site/test/ (php & html files) I want to upload the files to root/site/Uploads (If any other ini variables need to be changed - I have complete control over the website from root downwards) Please advise correct php.ini file settings html file html> <head> <title>File Upload Form</title> </head> <body> This form allows you to upload a file to the server.<br> <form action="getfile.php" method="post"><br> Type (or select) Filename: <input type="file" name="uploadFile"> <input type="hidden" name="MAX_FILE_SIZE" value="25000" /> <input type="submit" value="Upload File"> </form> </body> </html> getfile.php <html> <head> <title>Process Uploaded File</title> </head> <body> <?php if ( move_uploaded_file ($_FILES['uploadFile'] ['tmp_name'], "site/Uploads/{$_FILES['uploadFile'] ['name']}") ) { print '<p> The file has been successfully uploaded </p>'; } else { switch ($_FILES['uploadFile'] ['error']) { case 1: print '<p> The file is bigger than this PHP installation allows</p>'; break; case 2: print '<p> The file is bigger than this form allows</p>'; break; case 3: print '<p> Only part of the file was uploaded</p>'; break; case 4: print '<p> No file was uploaded</p>'; break; } } ?> </body> </html> php.ini file ;PHP.ini file ; ;This file contains the changes I have assumed for the php.ini files. ;Temporary Upload File Location is been changed from NULL to allow for ;upload capability upload_tmp_dir=/site/Uploads ; Maximum allowed size for uploaded files. upload_max_filesize = 3M ;End. Thanks for your help! [attachment deleted by admin]
  2. Hi Just started with web design got a dummies for windows book. Have set up a MySQL Database, got the database populating the title and some info at the top of my page. Then wanted to add a section at the bottom of all the websites in my group, by putting their website link and name in the footer, as soon as I added this to the page I hit the above error. I have now stripped out all the other parts of the page to just leave the footer...Problem is still there, have been pulling out hair for 2 hours last night and this morning ...any help greatly received...(ps line 52 = </html> closing tag). Ive done a search and each one of these problems seems to be a small but created by a different cause, I just can't see a missing : or } etc I'm just going blind looking. Thanks for your help! Here's the code. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html lang="EN" dir="ltr" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/xml; charset=utf-8" /> <title>Territory Title</title> </head> <body> <?php $terrID=1; //Temporary Set Value of Default Territory /* Data of SQL-server */ $server= "**********"; /* Address of database server */ $user= "*********"; /* Database user name */ $password= "*******"; /* Database Password */ $database= "*******"; /* name of database */ $table= "Territories"; /* Name of table, you can select that */ /* Accessing SQL-Server and querying table */ MYSQL_CONNECT($server, $user, $password) or die ( "<H3>Server unreachable</H3>"); MYSQL_SELECT_DB($database) or die ( "<H3>Database non existent</H3>"); // Get Territory Information Query $result=MYSQL_QUERY("SELECT Info, PTitle, TTitle, Logo FROM $table Where TerritoryID=$terrID"); list ($territoryInfo, $territoryPageTitle, $territoryTitle, $territoryLogo) = mysql_fetch_row($result); // Get the list of valid Websites for footer $webSites=""; $result=MYSQL_QUERY("SELECT TTitle, Website FROM $table"); while (list($TTitle, $Website) = MYSQL_FETCH_ROW($result)) { $webSites .= "<a href=$Website> $Website - $TTitle, </a>"; } Print <<< HERE <div id="footer"> <p> © Copyright 2010 </p> <p> $webSites </p> </div> HERE; /* Close SQL-connection */ MYSQL_CLOSE(); ?> </body> </html>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.