Jump to content

rich_web_development

Members
  • Content Count

    35
  • Joined

  • Last visited

Everything posted by rich_web_development

  1. I just checked on http://phpcodechecker.com/ It gives the same error I'm getting for the upload.php code I copied from the w3schools website http://www.w3schools.com/php/php_file_upload.asp It gives the same error: Parse error: syntax error, unexpected '$check' (T_VARIABLE) in C:\xampp\htdocs\upload.php on line 8 ‚ÄčIt also gives the same Parse error for the code I copied from the PHP.net website
  2. Changed double quotes to single quotes and still get the same error:
  3. if I change upload.php to: <?php $target_dir = "uploads/"; $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); $uploadOk = 1; $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION); // Check if $uploadOk is set to 0 by an error if ($uploadOk == 0) { echo "Sorry, your file was not uploaded."; // if everything is ok, try to upload file } else { if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) { echo "The file ". basename( $_FILES["fileToUpload"]["name"]). " has been uploaded."; } else { echo "Sorry, there was an
  4. I've looked in the apache error logs and keep getting the following: [Fri Sep 02 18:30:30.650622 2016] [ssl:warn] : www.example.com:443:0 server certificate does NOT include an ID which matches the server name [Fri Sep 02 18:30:30.688379 2016] [mpm_winnt:notice]: Child: Starting 150 worker threads. [Fri Sep 02 18:30:58.097000 2016] [:error] [pid:tid ] [client ::] PHP Parse error: syntax error, unexpected '$check' (T_VARIABLE) in C:\\xampp\\htdocs\\upload.php on line 8, referer: http://localhost/PicTest.html I run the XAMPP control panel with admin rights and have clicked on the red x'
  5. I use sublime text 3. I've tried it with notepad and saving as UTF-8 encoded but still get the same Parse errors
  6. <!DOCTYPE html> <html> <body> <form action="upload.php" method="post" enctype="multipart/form-data"> Select image to upload: <input type="file" name="fileToUpload" id="fileToUpload"> <input type="submit" value="Upload Image" name="submit"> </form> </body> </html> Then for the upload.php: <?php $target_dir = "uploads/"; $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); $uploadOk = 1; $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION); // Check if image file is a actual ima
  7. I have followed the PHP File Upload instructions at http://www.w3schools.com/php/php_file_upload.asp When I go to up load the photo I get: Parse error: syntax error, unexpected '$check' (T_VARIABLE) in C:\xampp\htdocs\upload.php on line 8 AGAIN! Just to confirm. I have done a copy and paste of what's on the w3schools website for PHP File Upload, I have a fresh install of xampp on my windows 10 machine, I have checked the PHP.ini to make sure file_uploads is set to ON, I have created a UPLOADS folder in the same place as my html file and upload.php. Can someone please help.
  8. Ok. How stupid of me. That was simple. Think I've fixed it now. Changed the CSS to: @media screen and (max-width: 680px){ul.topnav.responsive{position: fixed;right:0px;width:100%;top:0px;} Thank you very much for your help!
  9. Thanks for the reply. The jQuery adds the new class 'fixednav' when on scroll which works fine until the screen goes below 680px. I have the css set so that the navigation bar changes to just display 'menu' and then toggles when clicked to display the navigation options(I used the code that's on the RWD bit of w3schools css). When the screen is below 680px the navigation bar shows only the menu and when you click menu it shows the navigation options. When you click on the menu the navigation bar no longer stick to the top. If you open the f12 tools you can see the .fixednav gets overwr
  10. Hi, I was wondering if anyone could help me. I have managed to get the navigation bar under my header to collapse into a menu when the screen size gets smaller than 680px. I watched a YouTube video on how to get the navigation bar to stick to the top of the screen on scroll. The problem is when the screen is smaller than 680px the navigation bar sticks to the top UNTILL the menu toggles to show the navigation options then the navigation no longer sticks to the top. The jQuery looks like this: jQuery(document).ready(function(){ var navOffset = jQuery(".topnav").offset().t
×
×
  • Create New...