-
Posts
16,734 -
Joined
-
Last visited
-
Days Won
9
Everything posted by PFMaBiSmAd
-
You would use an array for the form field name, where the array index is the id of the corresponding item. See this link - http://us2.php.net/manual/en/faq.html.php#faq.html.arrays Then in your form processing code, you would iterate over that array using a foreach(){} loop, to get the array index value (id) and the corresponding price to use in the update query that would be inside that foreach(){} loop.
-
Based on the address bar in your browser's screen shot, I would say that you didn't actually browse to the URL of the form, so when the form was submitted, it didn't actually request the .php file through the web server on your computer, and the php code wasn't parsed and interpreted as php code. Use: http://localhost/name_of_your_form.php
-
Warning: Cannot modify header information - headers already sent by
PFMaBiSmAd replied to simmsy's topic in PHP Coding Help
Line 15 of fightlivecommentaryrd1.php is sending something to the browser, probably html markup. -
http://php.opensourcecms.com/scripts/show.php?catid=5&category=Forums
-
Edit: In case we haven't covered all the bases yet ... That doesn't matter. A bot script posts directly to your contact us .php script and doesn't care about anything you did in your form. Also, someone who simply disables javascript in their browser could post anything they wanted. Some possible ways a .php script could be put onto your site, provide the .php code you posted is your only server-side script - 1) Your FTP/ssh or web hosting account username/password was guessed or intercepted (perhaps through an unsecured wifi network connection). 2) The web host has not secured the web/ftp servers so that your account is the only account that has access to your folders. 3) The web host's FTP/ssh or master hosting account username/password was guessed or intercepted (perhaps through an unsecured wifi network connection). The server and/or web server access log should show when and provide more information about how that file got written to the server. How do your real images normally get put into the /public_html/images/ folder? Is the images folder itself something that you created? It's also possible that if the method that the web host has used to secure account folder/files relies solely on permissions, that if you created the image folder yourself through FTP that it did not get the necessary ownership/permissions to prevent other accounts from placing files into it.
-
The answer to your specific question is NO. If that's all the .php code you originally had on your site, it cannot be used to place a .php script file into a folder under your account. The sm5vy7.php file got into that folder through some other means.
-
That error, for the posted code, means that the query failed due to an error of some kind (connection problem, sql syntax error, wrong table/column names, un-escaped string data being put into the query statement.) You would need to troubleshoot why the query is failing. You can echo mysql_error(); to get php/mysql to tell you why the query is failing.
-
I suspect this question is somehow related to your existing thread where you are deleting a record and the display of the data doesn't reflect the deletion until after you refresh the page? If so, throwing more code at the problem is not likely to solve it. You need to find and fix the actual cause of the problem. Ajax/jquery is used to add functionally to a working page (i.e. your page should work when javascript is disabled) not fix a problem on a page.
-
Have you determined yet if the problem is due to the order of your logic on the page, because if it is, nothing you do short of fixing the order that the logic deletes and then gets/displays the data in, will correct the problem. What you are doing (making a page request back to the same page that inserts/updates/deletes data and then displays data) is a common task. Throwing more code (jquery/ajax) into the problem won't necessarily solve anything. You use jquery/ajax to add functionality to a page, not fix basic things that don't work right. You didn't actually post your complete requested logic in your existing thread for this problem, so no one here can actually help you with why your page is dong what it is.
-
You likely have an error in your code that is determining when to show a post (usually a wrong formatting character.) Post your code/query that is responsible for matching/retrieving the offending result along with a sample of the data.
-
The problem is not in the few lines of code that deletes the recored (that work's doesn't it) and the problem is not in the block of code that displays the data (that works doesn't it), the problem, if it is being caused by the code, is in the order in which the data is being deleted in the database table and when the data is being selected from the database table when the page is requested, which is why Pika asked for ALL the logic.
-
register_long_arrays
PFMaBiSmAd replied to freelance84's topic in PHP Installation and Configuration
You need to turn it off. If you delete the setting from your php.ini file, php will use the default value (which is '1' (on) for that particular setting, depending on php version.) Unless you are using a php version that has actually removed the offending depreciated feature, you must specifically set it to an off value. -
unable to access images outside public folder
PFMaBiSmAd replied to jasonc's topic in PHP Coding Help
Each image on a web page requires an <img src="URL_that_results_in_the_image_being_sent_to_the_browser" alt=""> HTML tag. That's how the browser knows where to fetch the image in order to render it on the page. The URL_that_results_in_the_image_being_sent_to_the_browser that you put into the src="..." attribute is the URL of your .php script that outputs the correct content-type header followed by the image data. -
why is it calling my database name and the table?
PFMaBiSmAd replied to Monkuar's topic in PHP Coding Help
Is the spelling and capitalization exactly the same? If you are on a case-sensitive operating system, iNettuts and inettuts are not the same. -
unable to access images outside public folder
PFMaBiSmAd replied to jasonc's topic in PHP Coding Help
Your ACTUAL code is concatenating double quotes to the start and end of the $uploaddir . $reportCode value. Also, the response to the http request for the image can only be the content-type header followed by the image data. -
unable to access images outside public folder
PFMaBiSmAd replied to jasonc's topic in PHP Coding Help
Without your actual code that is getting/forming the $image and triggering the error and both the error messages, it's kind of hard to help you with the half dozen possible things that could prevent a file operation from matching the actual filename. For example, the exact wording of all the error messages, less your account/domain part of them, may in fact tell someone here what is causing the problem. -
unable to access images outside public folder
PFMaBiSmAd replied to jasonc's topic in PHP Coding Help
Is the spelling and capitalization of both the path and the file correct? -
$subject['id'] contains something other than a number. If you form the query statement in a php variable, you can echo the actual query as part of the die() statement so that you can see what the query actually is. Right before the query that uses $subject['id'], use var_dump($subject); to see what $subject contains. Also, try echo mysql_num_rows($subject_set); at that same point to see if the first query actually matched any rows.
-
There are always options. You can install a free all in one Apache/Php/Mysql package on just about any modern computer and develop your code locally before putting it onto a live server. As to the error message. That at least identifies the database class as mysqli. $result is a mysqli result object. See the following link for the methods and properties that you can use with a mysqli result object - http://us3.php.net/manual/en/class.mysqli-result.php fetch_assoc would be a good choice to use to fetch the price alias value.
-
After you answer Pika's question, you would take the absolute value of the difference between the data and the target value, then find the value(s) with the smallest abs(difference).
-
Your database class is the OOP class you are making an instance of in your db_connect() function code, nothing to do with the database server information you posted. A) You should be learning php, developing php code, and debugging php code on a local development system, not on a live server. B) You can set php's error_reporting/display_errors settings in your script (which won't show fatal parse errors in your main file, which is why the settings should be in the master php.ini.) You can always add the following two lines of code immediately after your first opening <?php tag for debugging purposes (remember to remove them once you are finished debugging your code so that you won't expose server/account information to a hacker that intentionally triggers errors on your live site) - ini_set("display_errors", "1"); error_reporting(-1);
-
The ->query() method of your database class probably (depending on what database class you are using) should either return a FALSE value (which won't echo as anything) when your query FAILS due to an error, or it will return a result resource/result object, which you then need to fetch the data from. So, what is your database class you are using and you need to have php's error_reporting set to E_ALL and display_errors set to ON in your master php.ini so that php will report and display all the errors it detects.
-
DISTINCT removes duplicate rows from the result set. Since the product_sku is probably different in each row, the the rows are all different and there's nothing for distinct to remove. If all you are trying to get is a list of distinct order_id's, why are you selecting other columns? Use GROUP BY order_id to consolidate all rows having the same order_id into one row in the result set.
-
The 2nd parameter was only added in php5.3. What's your php version and do you have error_reporting set to E_ALL and display_errors and/or log_errors set to ON so that php would report and display/log all the errors it detects?
-
AND you cannot use mysql_num_rows (non-i ) function on a mysqli result. You would need to use mysqli_num_rows (with an i )