-
Posts
16,734 -
Joined
-
Last visited
-
Days Won
9
Everything posted by PFMaBiSmAd
-
After your code that sets $combatStats, I would do the following (keeps the data in an array called $data in this example for easier access) - $data = array();foreach($combatStats as $key => $value){$data[$key] = explode(";",$value);} This will produce an array that looks like - Array( [currentSquares] => Array ( [0] => a [1] => b [2] => c ) [speech] => Array ( [0] => d [1] => e [2] => f ) [setup] => Array ( [0] => g [1] => h [2] => i ))
-
What method are you using to get the $combatStats array that you show holding all the data in your first piece of code? Also, what is your final goal? Getting all the values (for display or as settings) or getting all the values and then finding specific values among all the data?
-
For example - http://www.phpfreaks.com/forums/index.php/topic,311919.msg1472958.html#msg1472958 It also puts the 'reply' button menu item off the right-hand side of the screen. Scroll back and forth to read the post, scroll right to hit the reply button, scroll left to type the reply. This occurs in the latest version of FF (haven't tested it in any other browser.)
-
Your query lists 16 columns, but there are only 15 data values, i.e. Column count doesn't match value count
-
Your code produces a query that looks like this (missing the WHERE keyword) - Did you really look at your query?
-
Images as submit buttons only submit the x,y coordinates where the image was clicked. The browsers that are setting the 'login' name for your button are not strictly following the w3.org specification. You either need to use the name_x or name_y value (see this link - http://us.php.net/manual/en/faq.html.php#faq.html.form-image) or you need to use a hidden form field with a name/value you can test if the form was submitted.
-
Your advice on designing a cyclic insertion?
PFMaBiSmAd replied to eco's topic in Application Design
Since web servers are stateless (they don't know or care anything outside of the current page being requested), you would need to remember the current line of the file being processed using a session variable (or alternately you could remove each line from the file once it is successfully processed.) How many total lines will you be doing this for, because it might be better if you assigned categories to 10 or more lines at one time. Are you assigning categories using a drop-down select/option list or typing them in? If you are typing them, it would be simper to just open the CSV in Excel and type them into a column that you add for that purpose. Edit: You could always just insert all the lines (without a category) into the database table and then have an 'edit' page where you display all the lines that don't have a category and enter the category information on that page. -
Can anyone see anything wrong with my code?
PFMaBiSmAd replied to jamesxg1's topic in PHP Coding Help
Best guess is that your upload is failing (there's at least 10 different things that could prevent it, from uploads not being enabled on your server to the file size exceeding the limits set in the php.ini) and your code has absolutely no error checking and error reporting/logging logic in it to test if the upload worked before attempting to access any of the uploaded file information. -
Your query is inside of the conditional logic - if($general == 'mobile'){ your query is in here} but you are attempting to fetch the results after and outside of that conditional logic. Your code will produce that error every time it is executed and $general is not equal to 'mobile'. You need to fix your logic so that you only fetch the results from the query when the query is executed.
-
my server automatically blocks automated email. What are my options?
PFMaBiSmAd replied to pioneerx01's topic in Other
Find out what restrictions are in place to use the mail server and satisfy the restrictions. -
Can anyone see anything wrong with my code?
PFMaBiSmAd replied to jamesxg1's topic in PHP Coding Help
The biggest problem is that there is nothing that would set $_FILES['imageone'], so all the code dependent on that would be skipped over. You have attempted basic troubleshooting to find out what your code is doing? -
Read the documentation for imagejpeg, particularly for the second parameter.
-
Actually, cookies who's expiration date goes past are simply no longer valid and they are simply no longer sent to the server with the http request.
-
The problem occurs because it is the web server that handles the upload and only invokes the target page of the form action = "" attribute once the upload has completed. Even the Alternative PHP Cache (APC) upload progress is limited to a single thread because they did not build in a way of passing a unique process id back and forth between the pieces of code. I have seen a php script that listens on a specifically assigned port number and handles the uploading of the file directly and passes a process id to the code running in the browser. If I find the script, I will post a link. Edit: http://sourceforge.net/projects/upu
-
Too bad the changes weren't tested. Even in this thread, the in-line ad is over the text of the post. In posts with code blocks, the width is out of control and the posts cannot be read. I particularly like the Ass-a-me-se ads and am going to click on them to get me a Bride.
-
I can see his post OK (using Firefox - latest). I'm guessing that the hacker who broke into the forum and modified it forgot that this is a programming help forum and being able to actually see what was posted is kind of important to asking for and giving help. His post is pointing out that you removed the echo statement that was before the $imagename; in the src="..." attribute. Why did you do that?
-
If you want to prevent the listing of files, when you don't have a default document file present, add the following to the .htaccess file in your document root folder - Options -Indexes
-
Have you tested that anyone can actually do that? That would imply that you have either disabled the php language in a folder or the method that you used to enabled php in the first place is specific to some other folder.
-
Birthdays should be stored as a yyyy-mm-dd value (mysql DATE format.) Doing so will allow you to use the many mysql date/time functions directly in the query to do anything you want with the value. Due to the limitations of a Unix Timestamp (and any of the php functions that relies on them, such as strtotime, mktime...) you should not use them for birthdays. Nor would you do anything that involves timezones. What exactly ARE you attempting to get your query to find/return?
-
If a file your application is expecting to include/require does not exist, you have bigger problems to worry about than if your code halts or not.
-
question mysql security.... is this function practical, safe enough?
PFMaBiSmAd replied to mac007's topic in PHP Coding Help
Using $money = $_GET['money'] would not bypass your sanitize function, because the $_GET variables are already escaped by your function. It would however add an unnecessary line of code and the memory needed for the $money variable. You can just use $_GET['money'] anywhere you need to use it. If you are going to reference a variable more than one time in your code, you can save a little typing by creating another (shorter named) variable from a variable like $_GET['money']. Back to your original post, don't use $_REQUEST, ever. Because it combines get, post, and cookie, you end up overwriting values if you forget you already have used a same name variable in your application and it makes it a little easier for hackers to feed your code the hackers values for post and cookie data by simply trying things on the end of the URL that is used to request your page. -
Also, why are you writing out/duplicating all that code over and over when the only thing that is changing between them is the calculation of a few values. And using three UPDATE queries when you only need one for all the values. Just calculate the values in a switch/case statement and use common code for everything else. Also, I would put the display_errors/error_reporting code after the first <?php tag and before any lines of code so that any errors that occur in those lines of code (your session_start, include statements, and logincheck..) will also be displayed/reported. Also also, why are you selecting everything from your users table for the current username in one query and then executing another query right after that getting the cardid for that username? You have about 5 times more code than you need and the more code you write the more errors you have to find and fix.
-
receive an warning of mysql_real_escape_string
PFMaBiSmAd replied to mark103's topic in PHP Coding Help
if you would remove all the @'s you put in your code to hide the php errors that are occurring on each one of those mysql_ instructions, you would probably learn that you are not making a connection to the database server. Also, mysql_db_query() is depreciated and should be replaced with a call to mysql_select_db() and you should use mysql_query() to perform queries.