Jump to content

premiso

Members
  • Posts

    6,951
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by premiso

  1. I guess it depends on what type of error he was seeing. The question is what browser was he using? As far as the error_reporting being on, usually on Development servers it should always be E_ALL, on production display_errors should be off mainly because it can be a security issue and it just does not look professional to have errors shown like that. Plus after testing on Dev you should not have any other problems right? (sarcasm) But as you said, it may not be a PHP error and an error on the Client side IE JScript or HTML which could be caused by a different browser... My bet is, if it is a friend, he is just messing with you.
  2. It may be inserting you are just not pulling the right display data: <?php echo $member_details_array['email']; $dtl = mysql_query("SELECT post_dtl, * FROM cmt"); while ($row = mysql_fetch_assoc($dtl)) { foreach ($row as $r) { echo $r . "<br />"; } echo "<br />"; } ?> The above code is dependent on the MySQL connection being connected. EDIT: One other issue I noticed was here: <?php include_once("../functions.php"); include_once("../".$installed_config_file); include_once("constants.inc.php"); $dtl = $_POST[post_dtl]; $query="INSERT INTO cmt (post_dtl) VALUES ('null', '".$dtl."')"; mysql_query($query) or die ('Error posting comment') On your insert you only have 1 column defined but 2 values being inserted... I think you only need one (as I take it the first one is for the auto_increment id that is not necessary). <?php include_once("../functions.php"); include_once("../".$installed_config_file); include_once("constants.inc.php"); $dtl = $_POST['post_dtl']; // also it is good practice to enclose associative array indexes in quotes to avoid notice errors. $query="INSERT INTO cmt (post_dtl) VALUES ('".$dtl."')"; mysql_query($query) or die ('Error posting comment')
  3. description="'.$data['description'].'", WHERE id="'.$data['forumid'].'"'; There is a , before the WHERE. As well as you have your quotations mixed up, singlequotes surround the sql data... description='".$data['description']."' WHERE id='".$data['forumid']."'"; You will have to fix that in the other section of the query as well (the quote part). EDIT: Moving to the proper board (MySQL Help)
  4. Nope it is not, you were basically assinging them to that value, granted that probably will not solve your problem but this would be the correct way to do that: else if ($_SESSION['username'] == $username && $_SESSION['sid'] == session_id()) I am looking at the access page and not really seeing any issues that stand out at me, it looks like it should display the username...if not what is the page doing that it should not be? You never really explained what the problem was in your original post... However, looking at your code it is kind of a mess. I will try and clean it up and post a cleaned up version with comments here when I get a chance later for ya.
  5. Which is why posting some code would have saved some headache. I would suggest it for the next problem as it helps us to see where the real problem is instead of going on wild tangents that have nothing to do with the original problem. Just an idea!
  6. I believe they are alias's of each other...although I cannot find a reference to that in the manual. EDIT: As to the OP's problem: else if ($_SESSION['username'] = $username && $_SESSION['sid'] = session_id()) Notice you use single =, are you meaning to assign them there or are you meaning to set them? As == is the comparison operator...I am not sure if that was your intentions or not.
  7. Nope, I do not have a P.H.D (or bachelors for that matter) so I do not qualify!
  8. That is not recognized by XAMPP because of how XAMPP configures PHP, you can easily make those allowable by modifying the PHP.ini file, that is a php configuration. As far as div's / styles etc. The web server does not care about that, that is all HTML markup which is done on the client side not server side. Now the reference to the .css files do matter, try writing in the full absolute path to the style sheets and see if they work. As far as the overriding, if style.css has the same styles called as the prior sheet it will take precedent over them since it was last to be executed (I believe that is how it goes). The chances are the issue lies within your html code / location of files on the server. Post your current HTML for the page you are trying to style that is not working so we can look at what might be causing the issue. Alternatively, if you are using FireFox you can use the Developer tool to see errors with Javascript and some errors with CSS that maybe happening. (I believe it is located under Tools > Error Console) You may have to clear it out then refresh the page.
  9. Interesting, let me ask you this...why does it matter if it shows as "blank" or not? I do believe the only other way to prevent this (which I do not know if it will work) is if you omit the date field from the insert query. However, you should check your table structure and make sure a default value has not been set for the datefield, as that will always put that value in when nothing else is present. I will do some more digging to see if I can find anything difinitive, but I am pretty sure that is how MySQL is setup. EDIT: Well my digging yielded some interesting results: Found at http://dev.mysql.com/doc/refman/5.0/en/using-date.html might be some good reading as it does seem you can configure your MySQL to do nulls instead of the 0's.
  10. http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html Float is a reserved word. Either enclose it in backticks (not preferred) or change the name to a non-reserved word (preferred).
  11. sessions will be the key. Here is a good tutorial on Sessions and cookies, both of which you will probably want to use for a login system. If you get confused or need help with part of the concepts please post here after reading that tutorial above.
  12. $dob = (isset($_POST['dob']) && !empty($_POST['dob'])) ? date("Y-m-d", strtotime($_POST['dob'])) : NULL; Try that out and see if it works for you. (The ? : is called that Ternary operator if you want more information on how it works).
  13. Yea, I completely missed that part =\ It sucks taking time off from helping lol. Thanks for pointing that out as well.
  14. If it is null, why would you want it in the query? And the way you can keep it in the query is add an OR after it: ID is NULL OR (other expressions here) But doing that basically renders the ID useless anyways so why not just omit it if it is not needed?
  15. Why is that a problem? Basically what that means is that either you are viewing a cached version of your site or somewhere in your code something is messing up. Either in styles.css or twoColLiqRtHdr.css possibly have some issues on their own, or even in the file displaying those css styles has an issue. Given that the first style sheet works, my bet is on that you have an issue in your CSS code that is preventing the other stylesheet to display properly. Perhaps try validating your CSS pages via: http://jigsaw.w3.org/css-validator/ to make sure your sheets are valid and there are no fatal errors in them? It is really hard to tell just from that, the known fact is, it is not XAMPP causing the problem It is somewhere in the code/stylesheets/html.
  16. XAMPP does not have anything to do with CSS working (unless the apache server settings on how to handle css are messed up, which I doubt cause you would of had to mess them up). Chances are the file is not at the specified location... HTML gets parsed by the browser, not the server. Now if the file is not at http://yourserver/styles/style.css then it will not work. Check to make sure that the style sheet is in that folder and not somewhere else.
  17. You omit that from the search, here is a tutorial I created about creating dynamic searches, perhaps it will help you out... http://www.phpfreaks.com/tutorial/simple-sql-search Not sure if you have already looked at it, but perhaps it will help you understand more of what needs to be done...
  18. I never knew the PFR's had psychic abilities =\
  19. Hard to help without seeing the code....
  20. This may be too simple for you, but there is a tutorial on this site: http://www.phpfreaks.com/tutorial/simple-sql-search Maybe that will help you get started in the right direction...
  21. Ok, sorry to be so disagreeable to this statement, but seriously? You believe this...then you have a long ways to go. POST data is just as in secure as GET data. The only difference is you do not see post data, but I can easily mimic a search form and post any data I want to his site. So any flaws that the GET would have the POST would have, which is why you code for sanitizing data and do checks before you query your database etc. To say that POST data is more secure than GET, is kind of ludicrous, yes for a Password form I would agree because the password is not appended onto the url and thus not saved in your browser history. But either way that password is passed un-encrypted as raw text to the script which is why we have SSL sites, which does have encryption tied to it. But a site without SSL, potentially anyone in between your computer and the server can sniff that password out, which is why any site that does some type of financial information tends to have SSL. The valid reason to use get in this situation is to allow people to link/bookmark search results. Doing this will also help content be search engine friendly, as you can create a sitemap of common searches and have google spider them, many sites do this and they also save searches that people have searched for to put on that sitemap automatically. If I were you, before you present items as fact I would do some reading up on them in the future. I would be, because I have been web programming for 11 years now. And at least 7 of them was devoted to learning and understanding search engine optimization. Yep, you code for attacks in either scenario POST or GET for this reason and the reasons I stated (which is basically along the same lines) POST is just as insecure as GET. Ok so how many programmers with PHD degrees does google have working for them? Seriously, their downfall is that they use GET data in basically every single one of their applications, their Google Maps, Google API's all use GET data...come on now. Take the time and actually do the research. The single best search engine we have ever seen on the internet is going to fall because they use GET data instead of POST data?
  22. I think you missed the point of the post, he seems to be getting overlap when he used $c and his theory is that the variables are messing up cause $cat has a c in it...which I have never seen happen
  23. I have never seen that. By all logic it should not do that...I am interested to test this out and see what comes of it, too bad this computer isn't a dev one =\ As for that example, I think you want echo and not $echo Just out of curiosity, what version of php and apache are you using?
  24. It is technically more secure, but for a search function how secure do you need it? Depending on what the search is for, if you are looking for people to be able to link or bookmark a search you want to do it with GET as it allows for that, you cannot bookmark post data.
  25. It should work if the syntax was correct, try this: if(file_exists(func1(parameter).'/images/'.func2(parameter))) { As long as the functions return a string, I can see no reason for that not to work, unless I am mistaken.
×
×
  • 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.