-
Posts
16,734 -
Joined
-
Last visited
-
Days Won
9
Everything posted by PFMaBiSmAd
-
$_FILES is empty, and $_SERVER['CONTENT_LENGTH'] is empty
PFMaBiSmAd replied to Ionisis's topic in Applications
The form you posted works for me and gives the expected $_FILES and $_SERVER['CONTENT_LENGTH'] data. I'm going to guess that something in your actual form or form processing code is causing the problem. Post enough of the code on your page that reproduces/duplicates the problem. If you only select ONE file in the first field, but have the 4 fields in the form, does it work? -
$_FILES is empty, and $_SERVER['CONTENT_LENGTH'] is empty
PFMaBiSmAd replied to Ionisis's topic in Applications
The $_FILES and the $_POST array are both empty (done by php) when the total of all the form data exceeds the post_max_size setting. What does a phpinfo() statement show for the post_max_size and upload_max_filesize settings? Also, are you on a server where the Suhosin hardened php patch has been installed, as it imposes some other upload restrictions. -
Your query looks correct. I suspect there is something in one of the values that is breaking the sql syntax and the error is just detected at that point. I recommend that you form your sql query in a php variable and then echo that variable so that you can see what exactly the sql is.
-
^^^ Not if you did what I posted. You echoed the $result variable. That has nothing to do with what I stated.
-
File_Exists Returns False Even Though the File is There
PFMaBiSmAd replied to chaseman's topic in PHP Coding Help
file_exists() does NOT work with the http:// protocol. Why wouldn't you just use a local file system path to do this? -
Form the final query in a php variable, so that you can echo what it actually is, then just put that variable into the mysql_query() statement - $query = "SELECT count(*) FROM jobs ". (($sch)?"WHERE ".join(" AND ", $sch):"").""; $result = mysql_query($query); Just echo $query; on the next line after where it is formed to see what the query is.
-
There's nothing technically wrong with what you posted. Best guess is there is something in the actual $_GET['id'] that is the problem. Posting the actual error message would help pin down what the problem is.
-
User Avatar not uploading even tho its correct image type (.jpg/.png)
PFMaBiSmAd replied to Russia's topic in PHP Coding Help
By combining the type/size validation into one statement, with one error message, you will never know why your test is failing. You need perform each validation check separately so that each one has a separate and distinct message and you should show the value that failed the test as part of the error message. Show the actual $_FILES["photo"]["type"] value so that you can see what is wrong with it. And by looking at your form code, your upload isn't working anyway because you don't have a proper enctype= attribute in your form tag. Doesn't anybody check the basic requirements before doing anything? -
having a for loop inside a mysql SELECT statement
PFMaBiSmAd replied to micmola's topic in PHP Coding Help
Without an example of what you are trying to accomplish, the answer would be that almost anything is possible in programming, as long as it makes sense. -
get_file_contents does not work with existing local files
PFMaBiSmAd replied to techdude's topic in PHP Coding Help
^^^ You would need to post actual code that demonstrates/reproduces the problem. Posting two partial snippets of code, taken out of context of where they work and where they don't, without even identifying which one is which, doesn't help. -
You would use array functions to loop over the data. From the upload section of the php.net documentation -
-
The second parameter of imagepng() is the file name to save the image as -
-
If you right-click on a blank area of the menu, there is a selection you can un-check to put the tab back at the bottom.
-
The code you posted doesn't produce that error. You would need to post the actual code where you tried to remove the URL if you want help with what is wrong with it. AND if your data is being properly escaped (only one time) when it is inserted in to your database (the \ escape characters won't be present in database) and magic_quotes_runtime is turned off so that it won't get escaped when being retrieved, there is no need to use stripslashes() on the data when you retrieve and output it.
-
You would typically put the ID of the data being referenced on the end of the URL ?id=some_id_number AND you would check on each page if the current visitor has permission to operate on that ID (his ID is the same as the ID from the end of the URL.) So, if your login system has a $_SESSION['userid'] variable - <?php session_start(); // start/resume the session if($_SESSION['userid'] == $_GET['id']){ // the current logged in visitor OWNS the id being operated on // allow the visitor access to the operations on this page... } else { // the current logged in visitor does not match the id being operated on, just let him view the data or redirect him somewhere else on the site } ?>
-
It would take having enough of your code that DUPLICATES the problem for anyone to be able to see or help with what it is doing. Just posting a small portion from one page where you are un-setting some variables doesn't help. Best guesses - 1) You are redirecting all over the place and your code is redirecting to the index.php page where you are un-setting the variables. 2) You don't have an exit; statement after one or more of your header() redirects and the code on the page continues to execute while the browser is requesting the new page and that code is clearing the variables.
-
Array or session problem in php version 5.2.17
PFMaBiSmAd replied to zeekonia2002's topic in PHP Coding Help
You wouldn't ever need them to be on. They were turned off by default in php4.2 in the year 2002 because they open a huge security hole that allows hackers to set your program and session variables simply by putting get parameters on the end of URL's when they visit your site and a lot of web sites were taken over. -
Array or session problem in php version 5.2.17
PFMaBiSmAd replied to zeekonia2002's topic in PHP Coding Help
There's nothing php version specific in your code. It's more likely that your session_start() statement is failing due to a php.ini configuration difference. Are you developing and debugging your code on a system with error_reporting set to E_ALL and display_errors set to ON so that php will report and display all the errors it finds? There would likely be an error that would indicate why your code is not working. What have you done to debug at what point your code is doing what you expect and at what point it is not? You could have missing data in your database so that only specific produce id's work or your code that is producing the get parameters on the end of the URL's could be messing up or about a half-dozen other things could be going wrong. -
Are you developing and debugging your code on a system with error_reporting set to E_ALL and display_errors set to ON so that php will report and display all the errors it finds? There would likely be an error that would indicate why the header() statement is not working.
-
A) Your return statement in your dbClass constructor doesn't do anything and should be removed. B) Creating an instance of your dbClass in $db means that in the main program $db->db is the connection link. C) When you pass $db into the baseClass() and store it in the $mysql_conn variable, you would access it inside the baseClass() using $this->mysql_con->db
-
mysql_real_escape_string Function Clearing Values
PFMaBiSmAd replied to EmperorJazzy's topic in PHP Coding Help
LOL - ^^^ Then why aren't you using mysqli_real_escape_string() (after you connect to the database server.) You should be developing and debugging your code on a system with error_reporting set to E_ALL and display_errors set to ON so that php will report and display all the errors it finds. You will save a TON of time. -
mysql_real_escape_string Function Clearing Values
PFMaBiSmAd replied to EmperorJazzy's topic in PHP Coding Help
I'm going to guess you don't have a connection to the mysql server at the time you use mysql_real_escape_string() on the values. -
@CLUEL3SS, here's what you get from a site like that for most entered values - And frankly, sites like that WANT you to enter an actual MD5 value of your password or enter your real password as a test because they have your IP address from the HTTP request and they can now try to take over your router or any of the web applications you might be hosting at your IP address.
-
If there are no rows in the php_blog_comments table, in the query at about line 58, the code you posted will output nothing to the page. What exactly do you expect when you first browse to the page?
-
Add - GROUP BY users.id