-
Posts
16,734 -
Joined
-
Last visited
-
Days Won
9
Everything posted by PFMaBiSmAd
-
Adding the MAX_FILE_SIZE field to the form would only serve to limit the maximum size (it would generate an error value of 2) and has nothing to do with getting an error value of 1. Are you sure a local php.ini can be used to change those two settings on your server? What does a phpinfo() statement show for the upload_max_filesize setting? What exact size is the file that is not uploading?
-
Dynamically generated pages, where the content at the same URL can be different for each page request, must specifically contain headers that prevent the caching of the content on the page. A lot of web hosting specifically outputs headers that cause content on a page to be cached (in order to reduce server load). You must output your own headers to override this behavior for dynamically generated pages.
-
php warning - supplied argument is not a valid MySQL result resource
PFMaBiSmAd replied to Nucleus's topic in PHP Coding Help
That would be on the same line, not the line right after... That would however work assuming there is a semi-colon ; on the end of it to terminate the statement. -
No Sessions, No Cookies, No HTTP_REFERER, What Next?
PFMaBiSmAd replied to drath's topic in PHP Coding Help
Cannot really help you with what your code is doing or not doing without seeing it. -
$_SESSION variables lost untill refresh page
PFMaBiSmAd replied to meltingpoint's topic in PHP Coding Help
Cookies are also domain specific and cannot be passed between different domains. -
<?php phpinfo(); ?>
-
The DECIMAL datatype was changed a couple of times in gong from mysql 4.1 to the current version. However, just putting quotes around the value in the query string should not trigger any problem (other than that an extra handling that is necessary because a quoted number is first converted to a float before it is used.) Since you did not state exactly what problem, error, or unexpected result you are getting, it is not directly possible to help you. There are however a section in each version of the documentation that describes what changes were made to the DECIMAL datatype.
-
php warning - supplied argument is not a valid MySQL result resource
PFMaBiSmAd replied to Nucleus's topic in PHP Coding Help
mysql_numrows() is a perfectly valid (but depreciated) alias name for the mysql_num_rows() function and is not the reason why you are getting an error about an invalid result resource. The error is because your query failed to execute due to an error and returned a FALSE value instead of a result resource. For debugging, echo mysql_error() on the line right after the mysql_query() statement to find out why it failed. -
$_SESSION variables lost untill refresh page
PFMaBiSmAd replied to meltingpoint's topic in PHP Coding Help
Browser's (all of them) DO NOT pass session id cookies back and forth between http and https protocols due to the security breach this would cause. -
http://php.net/mysql_affected_rows
-
Your php version, specifically the version of the mysql client library files that come with your version of php, are too old to use with the version of mysql you are using. You need to upgrade your php version.
-
$_SERVER['HTTP_REFERER'] is there a better solution??
PFMaBiSmAd replied to New Coder's topic in PHP Coding Help
Yes, think of the log in as a 'box' or a code block that you include on any page that needs it (such as the way this forum handles the log in.) If the visitor is not logged in, the log in form is displayed in a specific region on the page. The log in form submits back to the current page. The code that processes the log in form is part of the code block that you included on the page. If you are logged in, the username and a log out link/menu is displayed instead. -
Each call to a mysql_fetch_xxxxx() instruction retrieves ONE row from the result set (like it states in the php documentation.) You would need to use the mysql_fetch_xxxxx instruction in a loop (like the examples in the php documentation show) to retrieve each row in a result set.
-
What is the actual code you tried and what was the exact result? Is $row['id'] the base part of the file name? Does the path and file name 'images/pigs/".$row['id'].".jpg' exist relative to the file containing that code? Basically, fill us in on the relevant information that you know about the problem so that someone could actually help you.
-
A) Take some responsibility for your code on your server with your database (we don't have access to these, so the only person here who can troubleshoot what is going on is you.) B) Echo the value being tested in the logic to see what it is to find out why the conditional test is failing. What does echoing mysql_num_rows($result) show? C) If mysql_num_rows($result) is zero, find out why. Echo $qry, then look directly in your database using your favorite database management program and check if there is a row that exactly matches the username and password value that is being put into the query. D) Does $username and $_POST['password'] have the correct values in them (for all we know, they don't, either because your form is invalid and is not sending anything or your logic that is for example setting $username is causing it to be empty...)
-
If what you mean is that if you use the second piece of code somewhere on the page after the first piece of code that nothing is retrieved because the while() loop is skipped over, then you need to reset the result pointer to the beginning of the result set - http://php.net/mysql_data_seek
-
$_SERVER['HTTP_REFERER'] is an optional header that the browser provides when it makes a http request. If it is not set, then it is not set and you cannot do anything about it.
-
Your email column should already be a unique index to enforce uniqueness, then just use the IGNORE keyword - insert IGNORE into `mlist_01` (`email`) select DISTINCT(`email`) from `mlist_02`
-
No Sessions, No Cookies, No HTTP_REFERER, What Next?
PFMaBiSmAd replied to drath's topic in PHP Coding Help
Use a $_SESSION variable, but set it to a different unique value on each page (after you test if it has the correct value that says the visitor came from the previous page.) -
The correct format of a DATE field is YYYY-MM-DD
-
It tuns out that $_SESSION can only be an associative array. You need to use a name and make a 2-dimensional array - $_SESSION['qty'][$idi]=$izbroj;
-
Add the ini_set("display_errors", "1"); error_reporting(E_ALL); code to procesor.php as well, right after the <?php tag (before the session_start()).
-
How have you determined that the delay is due to the preg_match instead of it being due to fetching the source that you are using preg_match on?
-
The From: address must be a valid email address at the sending mail server or there must be an SPF record at the domain being used in the From: address that indicates that your sending mail server is authorized to send email for that domain. Would you trust an important letter that has a From: address that says it is coming from one location but the post mark says it came from somewhere else?
-
What exact method are you using to edit the web page? A programming editor running on a computer or a web form in a browser? Are you actually editing the source of the page or are you editing content in a database that a web page then displays? In general, you would need to use a semaphore in a file or a database to restrict access to one person at a time. Since php functions like flock release the lock when the script on a page ends, they would not directly be usable if a web form is being used to edit the web page in question.