Jump to content


  • Posts

  • Joined

  • Last visited


Everything posted by ldougherty

  1. Do you have access to the error logs on your server? If so try looking in the error log to determine what is happening when you upload the file. One thing to ensure, in your php.ini the upload_tmp_dir should be specified and it should be a directory that is writeable.
  2. Depending what you are trying to do with the referenced file you can either call it via a full path or referenced path. If you are in /var/temp and you you need to access /var/file.txt you can either reference it is ../file.txt or /var/file.txt If the file(s) are web accessible you could use the URL like for linking images.
  3. So how exactly is your script supposed to work, you state something about "uploading a picture in a form in a separate page". Does the upload itself actually work or no? If you can give us the URL where you are running this script it might be helpful so we can see the code in action.
  4. Since you want the uploads to go into different directories based upon the user who is uploading you would need to identify that aspect prior to uploading. If you implement a login system you could set the upload directory based upon the user who is logged in. I do not believe there is any way with PHP itself to set the max folder size as this would be a file system manipulation. You could probably do some arithmetic prior to the upload to determine if it is within the allowed number. For example get the current directory size and store it in a variable then then the difference between the current dir size and the allowed dir size is what would be available to the user and if the upload is less than that number allow it. As for having a page that shows the uploaded files and size, this can be done many different ways but the simplest would be to have an index document that simply lists the files in the directory and if they are of image type to display them as images with whatever criteria you want to associate such as file size. Hope that gives you some direction.
  5. I've actually run this exact code on 3 different servers and on two the output was generated line by line where as on the 3rd the output was generated all at once. I'm honestly not sure of the difference other than possibly OS but everything else matched up exactly the same.
  6. You would have to use a static dimension for the image placement and relevant placement for the inputs. Essentially you create a DIV around the image centering it on the page and then use relative positioning of that DIV to place the inputs.
  7. If you do not supply an index it will just add the item to the end of the array. var[0] = 1; var[1] = 2; var[] = 3; outputting the array would yield 1,2,3
  8. echo "<pre>"; system ("ping -c4 $host"); system("killall ping");// kill all ping processes in case there are some stalled ones or use echo 'ping' to execute ping without shell echo "</pre>"; the 4 is how many ping requests to send and $host is the IP address/domain you wish to ping.
  9. How about just using INPUT boxes inside of DIVS positioned over the image at the right spot? You could add the style to the DIV so it looks just like that area hovering over the image... As for sending the information, just have the form submit to a page that generates an email to the email address you enter on the form and attach the PDF file to the message being sent. You could then store the email address however you want, plain text or database.
  10. Or if you prefer you can just use the system ping command using EXEC in your code. http://us3.php.net/manual/en/function.exec.php You can run any server command in your script via EXEC
  11. You are trying to combine 3 SQL queries into one query which is not how you do it. http://dev.mysql.com/doc/refman/5.0/en/update.html You need to adjust your syntax to update table itema = valuea, itemb = valueb where condition = terms;
  12. http://php.oregonstate.edu/manual/en/mysqli.close.php mysqli::close Closes a previously opened database connection. http://us.php.net/manual/en/mysqli-stmt.close.php mysqli_stmt::close Closes a prepared statement.
  13. So the file does upload without issue but you can't access it via the URL once uploaded right? What are the permissions on the uploaded file, it should be at least 644 to be web accessible. You can use chmod and chown via PHP to change the file permissions directly in your script or figure out why it's being uploaded with minimal permissions in the first place.
  14. You'll want to use the SUM function. http://www.tizag.com/mysqlTutorial/mysqlsum.php To return specific results in your query just use a WHERE clause to meet your needs along with DISTINCT to make sure you only get unique values. http://dev.mysql.com/doc/refman/5.0/en/distinct-optimization.html
  15. "As far as I know, you can't get spam listed if you send 100s of emails unless people are reporting you as a spammer" This actually is not entirely correct. Some mail servers also implement a rate limit meaning if you are hitting their mail servers with an excess amount of connections regardless of being legit mail or not the outbound server IP will be temporary blacklisted.
  16. You would want to use the GD library functions to add a watermark to an uploaded image. There are quite a few examples online such as... http://ditio.net/2007/07/11/creating-watermarks-with-php-and-gd-library/
  17. You should see if your web host offers some type of list server option you can use. A list server will specifically sent out messages in groups and generally the sever administrator has taken precautions to attempt keeping the server from being blacklisted.
  18. The border=0 goes on the img tag not the href. <img src=/images/sitegraphics/facebook.png> should be <img src='/images/sitegraphics/facebook.png' border='0'>
  19. OK, instead of creating the array with items you don't want how about you only put the item into the array if it tests true (==1) using array_push http://us.php.net/array_push This should work if($_SESSION['by'] == 'games') { # Create the Array $array = array(); if($row['ps3'] == 1) { array_push($array, "Playstation 3"); } if($row['xbox'] == 1) { array_push($array, "Xbox"); } if($row['360'] == 1) { array_push($array, "Xbox 360"); } if($row['wii'] == 1) { array_push($array, "Wii"); } if($row['pc'] == 1) { array_push($array, "Windows"); } $comma_separated = implode(", ", $array); echo $comma_separated; }
  20. By storing them in varchar format you can not compare them since your script just looks at them as strings rather than actual dates. If you change the column type in mysql to date you will then be able to compare the values. http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html
  21. Where exactly does it fail, not sure which echo statement you were referring to. You should try echoing the value of the variables before they are called upon in if statements to determine if they have the value anticipated.
  22. Since implode is just creating an array you could just unset the items you don't want in the array. foreach($array as $key => $value) { if($value == ", ") { unset($array[$key]); } } $new_array = array_values($array);
  23. There are several ways to do this such as iframe or using javascript to change the content of an element. The iframe would definitely be the easiest solution as you can set the iframe name and then just target it. http://www.w3schools.com/TAGS/tag_iframe.asp
  24. Your query only returns the first three results with the LIMIT 0,3 therefore you have no retrieved this data to display. The best bet would be to change it to LIMIT 0,6 which would then give you all of the information for the first 6 results. Then take it one step further inside the while loop with a counter in the loop. After the counter hits 3 limit the data that is being written to only titles.
  25. Try adding this to your code.. ini_set('display_errors', 1); error_reporting(E_ALL); This will show you any errors in your script when executing the page. If it doesn't work just check thoroughly through your code for syntax and try outputting variables before the UPDATE query to see if they are coming through the first query as expected. IE echo $values['masterid']
  • 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.