Jump to content

mac_gyver

Staff Alumni
  • Posts

    5,449
  • Joined

  • Days Won

    174

Everything posted by mac_gyver

  1. the code you are attempting to use contains three problems that are either preventing it from working, preventing it from telling you why it isn't working, or is telling you it worked when it may not have. 1) the @ error suppressor in front of the mail() function call is preventing the reporting of any errors detected by php or returned to php from the sending mail server. remove the @ and temporarily, for debugging purposes, add the following two lines of code immediately after the first opening <?php tag - ini_set("display_errors", "1"); error_reporting(-1); report back with any error messages you get that you cannot solve. 2) the mail() function returns a true/false value that you need to test in your code. if it returns a true value, it means that the sending mail server accepted the email and will likely try to send it to the to: email address. you should only display the success message if the mail function returned a true value. this does not mean that the sending mail server will succeed in sending the email or that the receiving mail server accepted the email. it only means that php found a sending mail server at your web hosting and that mail server didn't return any error to php. 3) the email is not from the email address that the visitor entered in the form. the email is being sent from the sending mail server at your web hosting to the to: email address. the from address you put into the mail header should be a real mail box at your sending mail server at your web hosting or at least the domain name in the from address must correspond to your web hosting. most receiving mail servers currently test that the domain the mail says it is from can be traced back to the actual sending mail server. in your testing if you entered a from address at @gmail and you are using a to: address @gmail, unless your web hosting is at google, the receiving mail server knows you didn't send this email from a gmail mail server and will discard it.
  2. at a minimum, you need to move the header('Content-type: image/jpeg'); statement down so that it is right above the imagejpeg($jpg_image); line. by outputting the header() first, any php or application error messages are treated as part of the binary image data. i also notice that you are saving the image to two different files. if your intent is to save the image, why are you outputting it to the browser using the header(); and imagejpeg($jpg_image); statements?
  3. there are probably around a dozen different things that could prevent any particular code from functioning, while giving an indication that it completed. to narrow down the possibilities, you would need to post your code.
  4. a) the forum section where you posted is for questions related to this website, phpfreaks - b) programming help forums are not here to find or to write code for people. c) moving to the misc forum section.
  5. the sql statement in your php code is not the same as when you directly ran it. i recommend that your form your sql statement in a php variable, thereby separating the sql from the php code running the query, so that you can echo the sql statement to see exactly what it is.
  6. your code above doesn't modify the file, only the rendering of the file in the browser. to do what you are asking for your current scheme would require that you open, read, and parse through the existing 'logs.html' file and only save the content up through the <body> tag back into the logs.html file (btw - your html is invalid because you are adding the <table>... data after the closing </body></html> tags) OR that you keep a starting 'template' file that you can copy over the logs.html file to 'reset' it. as stated previously in this thread, your approach is backwards, resulting in a lot of extra work to accomplish simple tasks. you really need to separate your data from your page design. store the raw data in a csv file or more properly in a database, then simply retrieve the data and output it in your html page when that page gets requested. to clear the data, all you do is clear the source where the raw data is stored.
  7. are you really selecting ALL the model information withing knowing and limiting it by a selected make and also selecting ALL the trim information without knowing the model and limiting it by the selected model?
  8. your approach to this is backwards. you should be logging the raw information/data to a file/database and only output your nice html page when you want to display that data. to manipulate the information in any way, you would edit/delete the raw data, not the resulting html page produced from that data.
  9. the following will select the current Round number, if any. if you want to select the rows corresponding to that round number, you would use this as a sub-query in your main query - SELECT Round, MIN(CONCAT(Date,' ',Time)) as start, MAX(CONCAT(Date,' ',Time)) as end FROM gameround GROUP BY Round HAVING NOW() BETWEEN start AND end
  10. when you put an image onto a web page, the browser takes the url of that image from the html markup and 'downloads' the image in order to display it. therefor, you cannot prevent http access to the image and have it displayed on a web page.
  11. your form doesn't have a closing </form> tag, that i could see, so you actually have just one huge form and the last value for any name='...' attribute is what will be submitted. make sure your html markup is complete and valid.
  12. great, where exactly are you stuck at when you tried to do this? programming help forums are not here to find, to write, or to reverse engineer code or designs you want, need. or would like to implement. we are here to help you with code you have written or with specific errors or specific programming questions. do you have any code you need help with or a specific error with that code or a specific programming question?
  13. no one can tell you, just based on the symptom, what exactly your code is doing that could cause that symptom. it will take seeing your code in order to help you at all or to even narrow down the possibilities to just one or two likely things to investigate further.
  14. when you copy/paste the content from your database gui, it copies the links and image tags leading to your web hosting, which causes a pop-up authentication dialog box every time someone views your post. in the future, just copy/paste the necessary text.
  15. read is a reserved keyword. either rename the column to something else or put back-ticks `read` around the column name every time you use it in a query. ref: http://dev.mysql.com/doc/refman/5.6/en/reserved-words.html
  16. web sites should function even if the visitor has turned off javascript in his browser. so, your design should have the drop-down and a submit button (that could be rendered inside <noscript></noscript> tags if you are also supply a javascript/jquery method of submitting the form when the drop-down is changed.) you can use a single page for this, no need for multiple pages. just have the first drop-down submit to the same page it is on. read the value from the first drop-down, if any, and produce the second drop-down.
  17. $con isn't an instance of your database object. it is either something else (a boolean...) or it doesn't exist at all (a null...) in the program scope where you are trying to use it.
  18. you have to submit the data from the first dropdown form element somehow, and that takes either a submit button that can be clicked on or some javascript to submit the form using an event tied to the dropdown. which of those methods do you want to use?
  19. your goal for database queries is to run one (or as few as possible) query that get the rows you want in the order that you want them. for what you have shown, assuming you only want those specific id values and that there are other id values in the table that you don't want - $query = "SELECT `category` FROM `categories` WHERE `id` IN(1,2,3,4) ORDER BY id"; if you in fact want all the rows - $query = "SELECT `category` FROM `categories` ORDER BY id"; after you have selected the row(s) you want in the order that you want them, simply output them the way you want when you loop over them.
  20. when you include a file using php, the contents of that file is essentially copy/pasted at the point of the include() statement. it becomes part of the main file's code and all the markup in it is part of the main file and is relative to the main file. you can/should be able to use the magic constant __DIR__ (and strip off the leading $_SERVER['DOCUMENT_ROOT'] part) in the code in the projects.php file to build the relative directory path from the main file, to produce a relative url that the browser can use to request the js/css... files. however, the projects.php code is a complete html document in itself. when you include that into your main file, you now have a broken html document. the end result on the server-side must be a valid html document. edit: you also have an issue with your include() statement. the include statement expects a file system path. in the value you are supplying to it - "/tables/php/projects.php", the leading / will be treated as the root of the current disk. the file system path you supply to the include() statement should either not have the leading slash (making it relative to index.php) or it should have $_SERVER['DOCUMENT_ROOT'] prepended to it to make it an absolute file system path. the gist of this is, you have file system paths that php is using and you have urls that the browser is using and they must all be correct in the context of where they are being used. you also need to validate $_GET['page'] to insure someone doesn't supply ANY PATH they want and obtain access to protected content and actions.
  21. lol, working on them now.
  22. from that list, at least magic-quotes and safe-mode have been completely removed from php. if you are upgrading php versions, you need to read the relevant php version migration sections in the php.net documentation appendices so that you are aware of the changes that will not only affect the options when you build php, but may also require changes to your code. ref: http://www.php.net/manual/en/appendices.php
  23. you need to rethink your password reset logic. your current code will allow anyone who learns, sees, or just tries a bunch of email addresses to go through and trash existing user's passwords, because you are directly updating the password in the users table when the request to reset a password is made. the request to reset a password should be stored in a separate table and should only update in the actual users table when the new password that was sent in the email gets used. as to why your last posted code isn't working. the new password is whatever is produced by rand(999, 999999). the new password is NOT in $new_password or any part of $new_password. $new_password is the salted/hashed value. you would need to store the rand(999, 999999) value in a variable in order to be able to send it through an email and to use that same value in the Hash::make( ... ,$salt); statement.
  24. during the log in process, exactly at which step in that code is the data and/or code doing what you expect and exactly at what step is the data and/or code failing and indicating the login is not successful? since we don't have your full code or your database, YOU must pin down the problem to the specific statement in the code that is giving an indicate that the log in failed, and at that point, what exactly is the data vs what the data should be. public function login($email = null, $password = null, $remember = false) { also, are you seriously writing code like the above? the $email and $password parameters are required for the function to work. if you are calling this function without supplying any of those call time parameters, there's no point in even calling it. making all the parameters optional, as coded, is opening you up to writing code that won't throw errors when used incorrectly.
  25. as a starting point, you need to set the character encoding on your web page to be UTF-8 (it is currently windows-1252 as reported by my browser's info page, you are setting in the page to charset=iso-8859-1)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.