-
Posts
16,734 -
Joined
-
Last visited
-
Days Won
9
Everything posted by PFMaBiSmAd
-
That would indicate that the upload worked (zero error element and a specific file size.) The problem is occurring in something the resize_image() function is doing or in the parameter values being passed into that function. Since black output images are being produced (I'll assume that they were at least in the correct destination folder and of the correct three different sizes as specified by the $GLOBALS['config'] values), what the resize_image() function code is doing, would be where to look next. Where there any other php errors being reported in the code corresponding to the resize_image() function?
-
error: incorrect interger value colume user2 row 1
PFMaBiSmAd replied to andrewsgreen's topic in PHP Coding Help
Given that you are trying to insert an empty string '' into the user2 column, I would expect that error. BTW - you cannot use data values derived from - mysql_num_rows($req2))+1. In modern, multi-taking, interrupt-driven, operating systems, concurrent operations can change the number of rows in a table, making that value incorrect. If you need a specific id value, you need to get that actual value from where it is being assigned. -
You are approaching this problem from the tail-ass end and trying to get someone who hasn't even seen that part of the animal to tell you the eye color of the animal it is attached to. Is this an open-source 3rd party script that someone can just download the whole thing from the author? Snippets of it where errors are being reported at aren't where the problem is occurring at. Also, from the code you have posted, it doesn't have any/good error checking logic to prevent follow-on errors when something didn't occur perfectly in a previous step. Just because if(is_file($file_data['tmp_name'])){ is true, doesn't mean that the upload worked. One of the possibilities is that the upload is failing. What does adding the following, right before the calls to the resize_image() function, show - echo '<pre>',print_r($file_data,true),'</pre>';
-
What you are asking is not possible, unless you pass the file through your server. The client/browser making the http request for the download file must also supply the authentication as part of that http request. Anything thing you do through the client/browser can be seen or captured by the person using that client/browser. The only 'secure' way of doing this, that doesn't expose the actual username/password to a visitor, is if the download site has an API that provides a unique/limited-use access token that you could then output to the client/browser to submit to the download site to provide the authentication.
-
mysql_real_escape_string() but allow \r\n?
PFMaBiSmAd replied to shortysbest's topic in PHP Coding Help
Please start your own thread for your problem. Post your code and sample input that reproduces the problem and state what exact symptoms, errors, or incorrect result you are getting from that code and data. Locking this topic. -
The server-side code that you did post, isn't even checking if a form has been submitted. It's likely the browser is (re)requesting the page for some other purpose that isn't a POST request or perhaps is submitting a post request itself, in addition to the flash, that doesn't contain any data. What's the HTML of your page containing this flash form? It's likely invalid and one browser type is handling it differently than the other.
-
You also already have a thread for this problem/topic. Don't abandon threads and start new ones for the same problem, as that just wastes the forum member's time and actually reduces the amount of help you get. Topic locked.
-
All that code in your logout_timer.php script would become ONE query - $qry = "UPDATE potatis SET connected='offline' WHERE last_active < NOW() - INTERVAL 15 MINUTES";
-
Your column needs to be a DATETIME and you can do all the filtering directly in the update query, no need to select, loop, filter, and update.
-
You probably have other things before or after the data, such as tabs, spaces, or a \r along with the \n. Try the following - <?php $members = file("postcodes.txt"); // get all the lines at once $members = array_map('trim',$members); // trim everything if(in_array("SE5", $members)){ echo "Got you"; }
-
So, you marked the thread as being solved. Does that mean you don't need any help with this?
-
Actually, the editor is a What You Shouldn't see Is What You Get.
-
Reverse Engineer a MySQL Database/Table from PHP source files?
PFMaBiSmAd replied to edwardcox's topic in MySQL Help
If you have or have access to the actual database, you can use any database management tool to get a .sql dump that would contain the table structure(s). If you can execute select queries, you can use a SHOW CREATE TABLE tbl_name query to get the table structure. After performing a query, you can access the meta data returned by that query using functions like - mysql(i)_fetch_field(s) -
It's straight forward, but you must specifically structure your client-side code to use ajax on a web page. The server-side code doesn't change much. It still accepts a http request, validates input, produces a result, and outputs it back to the client. The format of the output needs to take into account how it will be used in the client (is it just a block of text that is displayed or is it data that the javascript uses for some purpose, in which case you would output it as JSON encoded data.) There are countless examples posted all over the Internet.
-
If you want to do something on a web page without refreshing/redirecting, you need to use AJAX to make the http request. Jquery is a popular javascript library that will let you easily write client-side code to make ajax requests and display the returned information on a web page.
-
Also, the issue is only for one of the alias names.
-
If you are on a shared web server, you would only have the ability to change a local php.ini, which would take effect immediately. It however would normally only apply to the folder where the local php.ini is at. Is the script you are having problems with in the same folder where your php.ini is at?
-
No one here is going to help you find where you mis-typed some characters in your code. That isn't learning, that's just you following along with something you saw. If you haven't read a basic php book or tutorial so that you know what the opening and closing {} mean, so that you can identify where they should be at in your code, you need to do that before you try to use a registration tutorial. Also, look at it this way, we have identified what the problem in the code is - missing/mis-matched {}. If you cannot take that information and fix up the code to correct that problem, you will not be able to write any code that does what you want.
-
You need to store the date in a DATE data type with the YYYY-MM-DD format. The only time you should format as DD/MM/YYYY is when you want to display it. edit: damn, the forum's post notification (or lack of) gets a -20 likes.
-
Your code is missing one or more closing } (that closes the else { on about line 100.) has a bunch of miss-matched opening and closing {} The error message you should be getting, which you didn't post so that someone here could more directly find the cause of the problem, concerns a syntax error/unexpected end of file, which is php's way of telling you that you have something that is not terminated by the time php reached the end of your code. A tutorial for a registration script assumes that you already know enough of the basic php language so that you are not lost on what the php code syntax is or what the code is doing and that you just want to see/learn what a registration script would look like. You need to learn the basics of the php language before you attempt to use it for something like a registration script.
-
@jazzman1, I'm going to guess that the problems you found were due to copy/pasting the code, since the OP started other threads for a problem with the string he is building for the file_get_contents statement. Closing this thread since the next thread contains replies earlier than yours.
-
Take a look at the code in the edited reply #27.
-
Did you use jazzman1's originally posted code or the edited code from 2 minutes later?
-
See post #20 in this thread, that I made while you were writing your reply in post #21.