Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. Do some troubleshooting, you were already told how -
  2. You need to use the variable that you fetched from the table - $info['username'] or the variable you set from the $_COOKIE - $username
  3. Your else {} statement that is outputting the error information is part of this if() test - if ($_POST['submit'] == "Update") So, anytime the $_POST variable does not have that value, you will get just "Error:" because none of the mysql_ statements have even been executed. You should actually have the existing else {} statement be part of an if() that you put around the mysql_query() statement. But your actual problem appears to be that your form is not setting the $_POST variable as you expect. Have you echoed $_POST['submit'] to see what it actually contains? Beyond that you would need to post your form for anyone here to be able to help with why it is not sending the expected value.
  4. The mysql username and password is only used to secure the connection to the database server and limit what can be done over that connection. If someone has physical access to your server, they HAVE your actual database data files and can read any of the information in them.
  5. You ARE doing exactly what I posted was needed to make images work on a web page. Are you high on something or are you just trying to spam this forum? What you just posted has absolutely nothing to do with the code in the first post where you were trying to output one set of headers followed by multiple sets of image data.
  6. What makes you think that your mysql password stored in a .php is not secure?
  7. The session is not being started, probably due to a header error or an include statement that is not working or short open tags being used... Are you developing and debugging php code on a system with error_reporting set to E_ALL and display_errors set to ON in your php.ini to get php to display all the errors it detects so that it would be helping you? Stop and start your web server to get any change made to php.ini to take effect and confirm that the settings where actually changed using a phpinfo() statement in case the php.ini that you changed is not the one that php is using.
  8. You can output ONE image at a time as the only thing on a page and it will work because the browser can correctly decode what you sent it. This is the same as if you browsed directly to the URL in an <img tag. You CANNOT output more than one image at a time and you cannot output the image data directly on a HTML web page.
  9. Cannot actually help you with your problem without seeing the actual code responsible for the symptoms.
  10. This is not really a header issue. You CANNOT output an image on a web page by directly outputting the image data on the page. You must use a HTML <img tag for each image. The browser then fetches the image from the URL that is in the src='...' attribute. Ref: http://w3schools.com/html/html_images.asp To use an image that is produced by php, the URL that you put into the <img tag would be to the .php script that outputs the header followed by the image data. You would typically include an ?image=some_identifier GET parameter on the end of the URL that specifies which image to produce and output.
  11. Only in those web pages that are setting or referencing a session variable.
  12. Slightly off topic, but you might want to consider using a switch/case statement instead of multiple if/elseif statements as it will make adding options easier and provides a default statement to directly handle cases where the value is not one of the ones being tested.
  13. You already have an existing thread for this problem, don't start another one.
  14. Output the headers first, then output each row in the loop instead of saving it in $csvOutput. Add a check at the start of the code you posted above to make sure the current visitor is logged in.
  15. Nothing in php that is associated with the word global or globals should be used. Php attempted to allow bad code to be written that would 'work' and resulted in a lot of wasted time and confusion in the process.
  16. Php code is executed on the web server when the page is requested. The line - $width = "<script>document.write(screen.width);</script>"; does not set $width to the screen.width value. It sets $width to that literal string containing that javascript code that once it is echoed out to the browser and executed in the browser causes the width to be displayed in the browser. To get any information from the browser to the web server it must be passed as part of the HTTP request that is made for a web page. You would need to use AJAX or some other method of making the HTTP request. See the following link for an example of a "poor man's" ajax solution - http://us2.php.net/manual/en/faq.html.php#faq.html.javascript-variable
  17. That's because a query returns a result resource and you need to use one of the mysql_fetch_xxxx statements to get a row from the result set - http://us3.php.net/manual/en/function.mysql-fetch-assoc.php
  18. The mysql PASSWORD() function is not intended to be used by your application code. The hash length that it uses has been changed at least once, breaking any application that was using it. You would need to do a test by SELECT'ing both the value from the password column and what PASSWORD('".$pass."') returnes and see if they are the same. If you have just written this application and don't yet have any real passwords stored, switch to the MD5() or SHA1() functions instead.
  19. Options -Indexes only prevents directory listing. It does not prevent serving web pages.
  20. The query that jcombs_31 posted gives 2300 as the total. That is what you stated the result should be. Did you even try it?
  21. The OP started a new thread for this same subject - http://www.phpfreaks.com/forums/index.php/topic,270054.0.html
  22. http://dev.mysql.com/doc/refman/5.0/en/show-columns.html
  23. Something tells me that you are actually asking about a query like the following - select * from mytable where datecol >= STR_TO_DATE('01-01-2009', '%m-%d-%Y') AND datecol <= STR_TO_DATE('09-22-2009', '%m-%d-%Y') which would actually be an efficient query that would work.
×
×
  • 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.