-
Posts
16,734 -
Joined
-
Last visited
-
Days Won
9
Everything posted by PFMaBiSmAd
-
^^^ Yes.
-
I recommend you add the following to your code so that you can see what you are actually getting- echo '<pre>',print_r($_POST,true),'</pre>'; You only get the checkboxes that are checked, but you get all the text fields. If you want to assoicate the correct checkbox with the same numbered text field you would need to put the $i index counter into the [] array brackets so that ignore[0] corresponds to area[0], ignore[1] corresponds to area[1], ...
-
To restrict the output of your media files to only those visitors that are either authorized to view them or have actually visited one of your pages, you would need to dynamically output the media files using php code and use a session variable (set on the web page and checked in the php code that outputs the media file) to determine if the media file should be output at all.
-
It is not very efficient to do a directory scan and access session data files, and it is even more inefficient to actually open and read through each of those files. There could literally be hundred of files, some expired but not yet cleaned out and some for active visitors. What overall goal are you trying to accomplish, because there is probably a better way of doing it that does not involve reading session data files.
-
HTTP_REFERER is an optional header that can be set to anything, and in fact most web proxy scripts set it to the domain being requested so that the request looks like it came from someone who is viewing a page on your site. Using HTTP_REFERER will stop casual hot-linking and it will stop your legitimate visitors who's browsers don't set it, but it won't stop someone who really wants to hot-link your media files. What sort of problem are you having that you are trying to solve?
-
The URL you put into your <img src="..." alt=""> tag needs to have a GET parameter on the end of the URL that specifies which image your 'file 2' code should output. Your 'file 2' code would use that GET parameter as the picid in the where clause in the query.
-
Your To: address is a gmail address and you are putting a gmail address into the From: address header. If you are not sending this using a gmail mail server, I can guarantee that gmail will discard the email. The From: address must be an address hosted at the sending mail server where your php script is running at.
-
You are not using the 4th parameter in the setcookie(), so the cookie is only available at the same path where it was set.
-
The question asked for a php script -
-
You would need to use the following logic - $result = mysql_query("SELECT *, DATE_FORMAT(`start_date`, '%b %e, %Y') AS s_date FROM craft_shows WHERE $field LIKE '%$find%'"); if(mysql_num_rows($result) == 0) { echo "<p>0 matches found.</p>"; } else { echo "<table><tr><td class=\"shows\">"; while($row = mysql_fetch_array($result)) { echo "<a href='/show_submits/show_detail.php?id={$row['id']}'>Details</a>\n"; echo $row['venue_state'] . " {$row['s_date']} {$row['show_name']} {$row['venue_city']}<br>\n"; } echo "</td></tr></table>\n"; }
-
After looking more closely at the LOGIC in your code, it is no wonder it does not do what you expect. You are executing one query with a WHERE clause in it to find if there are any results, then executing a different query on that same table to get the results and display them. Just simplify and fix the logic in your code so that it executes one query.
-
Only one of your two queries use DATE_FORMAT() in it to return the stored 2010 17 12 date in the Dec 17 2010 format that you want. You would probably want to use DATE_FORMAT() in both queries.
-
When prompting a visitor for a date, you cannot let them enter it free form as you will get a dozen different formats. You must use three drop down select menus, one each for the day, month, and the year and/or you need to use a date-picker that allows them to click on a date on a calendar to pick a date. I'm going to guess that the answer to my question - What value are you entering?, is that you are entering a date in some format only known to you and you are putting that into the WHERE $field LIKE '%$find%'" search and you are expecting that to find the matching rows, but it does not and instead executes the second query in your code that displays everything?
-
You post doesn't exactly demonstrate what problem you are having. What value are you entering, what result are you getting, and what result do you expect to get?
-
Your 'file 2' code can only output one image at a time (that is the way images work on web pages.)
-
How to get the line number of a CSV file?
PFMaBiSmAd replied to lopes_andre's topic in PHP Coding Help
Detecting the first line and either skipping over it or reading the field names from it has nothing to do with a count of the number of the total lines or the ability to goto line x. I would say you are over complicating this. -
How to get the line number of a CSV file?
PFMaBiSmAd replied to lopes_andre's topic in PHP Coding Help
Why do you need a count of the number of lines and the ability to goto line x if all you need to do is insert the data into a database table? -
can't find a solution...updating order mysql with array
PFMaBiSmAd replied to kirkh34's topic in PHP Coding Help
You need to use the id of the row in the WHERE clause, not the current order_number. -
Some error checking and error reporting/logging logic would tell you why the query is failing.
-
Because you have single-quotes around 'week' in your query, making it a string instead of your column name.
-
Browsers and web servers operate on a request/response basis. They don't operate like a local application would. There are a number of reasons why a web server, php, the browser, and even proxy servers that might be between the two won't allow this to work. Once you get it working on one system it probably wont work on another. You should either write this as a local compiled application using C or a similar programming language or if you must use a browser/web server you should use AJAX to periodically make http requests to the web server to get and display any updated information.
-
Your browser is probably requesting the page twice. Firefox does this for 2-3 different reasons and other browsers do it as well for their own reasons. There are also reasons why the server will cause a file to be requested twice.
-
Here's your existing thread where you first asked the question - http://www.phpfreaks.com/forums/mysql-help/how-to-get-database-to-accept/ Here's your existing thread after you added inet_aton() to the code - http://www.phpfreaks.com/forums/php-coding-help/this-was-working-fine/