Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. http://us2.php.net/manual/en/ini.core.php#ini.post-max-size
  2. How do you know that the id is not passed? What is your php code in download.php?
  3. reset(), key(), and next() are NOT used with a foreach() loop. The whole purpose of the foreach loop is that IT iterates over the elements of the array and it provides a way of access both the key and the value.
  4. It sounds like your data was escaped twice when it was inserted into the database. If you have one actual \ in the data, when you look directly in the table using your favorite database management tool there should be only one \ character in the table.
  5. You probably have some non-printing characters in $file2check. Does using var_dump() on $file2check produce an expected length that matches the visible characters?
  6. Based on the line number where the output is being started at, you have two new-lines or lines with something in them before the first opening <?php tag in the paypal_success.php file or the code you posted is not from the /home/public_html/payment/paypal_success.php file.
  7. $_FILES['new_image'] is an array. About the only time it won't be set is if uploads are not enabled on your server or your form is invalid. $_FILES['new_image']['error'] will be a value of 4 if no file was selected to be uploaded. Your error checking logic would need to test for a value of 4 and skip over the upload processing section of your code. Your error checking logic should be testing the ['error'] element now and only processing the uploaded file if the ['error'] element has a value of 0. Ref: http://us3.php.net/manual/en/features.file-upload.errors.php
  8. You also did not provide any clue as to what your code is actually doing. Is it outputting the "your mail was successfully sent ..." message or the "unable to send mail ..." message? For debugging purposes, add the following two lines of code immediately after the first opening <?php tag on the page to get php to show all errors it detects when your code runs - ini_set("display_errors", "1"); error_reporting(E_ALL);
  9. A session is no more or less reliable than a cookie because by default a session id is propagated between page requests using a cookie. So, whatever systematic problem the OP is having setting a cookie will also prevent his use of a session. If he was attempting to use a session, this thread would instead be titled "my sessions don't persist between page requests". rizlmilk, your page did not send a cookie when I tired it. You likely have a header error occurring on the page. For debugging purposes, add the following two lines of code immediately after the first opening <?php tag on the page that sets the cookie - ini_set("display_errors", "1"); error_reporting(E_ALL);
  10. Generating a list of sequentially numbered variables to hold a set of same type data is never a good idea. Once you have created them, you need extra logic to keep track of them and iterate over the correct number of them. Arrays should be used when you have a set of same type data, that's what array data structures are for.
  11. Try using var_dump on what completedresearch($_SESSION['Current_User']) returns to see what you are actually getting. Also try using var_dump inside the function on what mysql_fetch_assoc($Get) returns. If you are getting an array inside the function but at getting a NULL where the function is called, it is because php has a problem returning the value of some of the built-in functions (I have only seen this with a few of the mysql_ functions.) If this is what is occurring, you need to assign mysql_fetch_assoc($Get) to a variable, then use that variable in the return statement. If you are getting bool(FALSE) values both inside and outside the function , then the query executed but there were zero matching rows. Your function needs some additional logic to cause it to behave in an expected way in the case where there are zero matching rows in the result set. It will currently return a FALSE value which will cause an error in the in_array() function. You should probably return an empty array in this case. Your current code in the function will, when the query finds any matching row(s) in the table, return an array with only one single entry that is the first row in the result set.
  12. See this current thread for more information about using more than one database at a time - http://www.phpfreaks.com/forums/index.php/topic,283182.0.html
  13. Untested, but should work - <?php $db_names = array('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'); // get the actual names of your databases into an array shuffle($db_names); // randomize the names $query = "SELECT testfield FROM $db_names[0].testtable UNION SELECT testfield FROM $db_names[1].testtable UNION SELECT testfield FROM $db_names[2].testtable UNION SELECT testfield FROM $db_names[3].testtable UNION SELECT testfield FROM $db_names[4].testtable "; ?>
  14. Yes. Are you querying tables in two different databases or are those actually two tables in a single database?
  15. Only one connection is needed if the username/password is the same. You can either select the database using mysql_select_db() before a specific query or you can specify the database in the query using the db_name.table_name syntax instead of just using the table_name in the query.
  16. That pretty much eliminates the actual browser causing it and confirms it is something in your server Edit: or in your code in the browser. Just because the specific URL is not being rewritten, does not mean that the url rules are not being evaluate. This is the most likely cause, especially because it acts different with and without GET parameters on the end of the URL. Post your .htaccess file. You have also not posted the form that is requesting that page so it is also likely that it is doing the double request. Once in your javascript and once when the browser requests it due to the normal form submission.
  17. If there are no actual characters before the <?php tag, then your file has been saved as a UTF-8 encoded file and the BOM (Byte Order Mark) characters that your editor placed at the start of the file are the problem. You either need to save the file as an ANSI file or if you must save it as a UTF-8 encoded file, save it without the BOM.
  18. You would use a simple look-up array - <?php // note: leading zero's make numbers octal, so to avoid problems with 08 and 09, two-character strings are used $mth_name = array('01' => 'January', '02' => 'February'); // add the rest of the months $mth = '02'; echo $mth_name[$mth]; ?>
  19. I would use HTML array variables. See Example #3 at this link - http://us.php.net/manual/en/features.file-upload.post-method.php
  20. $_GET['name'] is already available when the code in the included file becomes part of the main file.
  21. abazoskib, the post you just quoted and replied to is from really really long ago...
  22. Undefined index names for $_SESSION variables would indicate that those variables don't exist where they are being referenced. Either the code that is setting them is not being executed or some code is un-setting them or a valid session was not started on the page where they were set or a valid session was not started on the page where they are being referenced...
  23. Yes - http://us3.php.net/manual/pl/features.file-upload.errors.php
  24. You should actually be checking the ['error'] element and only processing the file if the error value is 0. Uploads that fail with an error that would cause the ['name'] element to be empty, set it to an empty string, not a NULL value. $HTTP_POST_FILES was depreciated long ago in php4.1, turned off by default in php5, and completely removed in php6. Use $_FILES instead.
  25. The upload of the larger size file is probably failing due to upload size restrictions on your server, but your code has no error checking logic in it to prevent the copy() statement from being executed when there is no actual valid source or destination file, so you get an error out of the copy() statement. But that's just a guess since you did not post any code.
×
×
  • 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.