Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. What exactly are you putting into the local php.ini and why are you trying to use a local php.ini?
  2. In both of your threads on this, I have mentioned the yyyy-mm-dd format for a reason. If you read my post above in this thread, you will discover that you cannot compare dates unless they are in a yyyy-mm-dd format. You can only compare dates (greater-than/less-than) when the same position in each of the values being compared has the same magnitude (you must use leading zeros in mm and dd) and each position to the left in a value has a greater magnitude than the position to its' right. Until your query looks like the following (or using the BETWEEN ... AND ... syntax) and with the values coming from the date field also in the yyyy-mm-dd format, your query will not work - SELECT * FROM `tests` WHERE date <= 'yyyy-mm-dd' AND date >= 'yyyy-mm-dd' AND member_id = '1' You can use mysql date functions in your query to get your date column values into the correct format, however, the DATE data type exists for several reasons and you should change your design to store values as a DATE data type. Once you do so, youy queries will be faster, your data will take less storage space, and you will be able to directly compare and sort your dates in a query.
  3. That's because you can only do greater-than/less-than date comparisons when the fields making up the date are left-to-right, year, month, day, i.e. yyyy-mm-dd. This is why DATE data types in databases use a yyyy-mm-dd format, so that you can directly order them and do greater-than/less-than comparisons.
  4. jacko_162, which part of this do you need help with? It is not a php problem until the form has been submitted and the two date values have been received on the server. Once the two values are on the server, the php form processing code would need to validate them, format them as yyyy-mm-dd values to match your column values in your database table, escape them to prevent sql injection, and put them into a WHERE clause in a query using the BETWEEN ... AND ... comparison. If the problem is creating the form to input or select them, you must define what method you went to use to enter or pick them and also what format they will be entered as.
  5. The posted code does not correspond to the error messages you posted (line number's don't match, even if we were to assume there were several lines before the first <?php tag), nor does it have any code to make a connection to the database. The code you posted probably never worked, regardless of you putting or not putting a local php.ini on your site. To expand on the errors - The first two errors are because you are outputting something to the browser before the session_start() statement. The error message you are getting for whatever your real code is, tells you where that output is occurring at. You must find and fix whatever is causing that output or you must move the session_start() statement so that it comes before any output is sent to the browser. The second two errors are because you don't have any connection to the database server (at all) in your code. We cannot really help you further, because that is either not your real code or it is not all of your actual code that corresponds to the errors you are getting.
  6. Both of those things were just guesses because you did not post any of the corresponding code. There are actually several other possible reasons for both of those errors, depending on what your code actually is doing from the start of the index.php file up through the lines where those errors are being reported.
  7. The first set of errors are because output_buffering is apparently turned on in the master php.ini, thereby allowing you to write code that is attempting to output something to the browser before the session_start() statement. The second set of errors mean that you did not have a connection to the database server at the time the mysql_query() statement was executed. Best guess is that your database connection code is using short open tags and is not actually being seen as php code.
  8. Based on your code example form the first post in the thread - Some page to be included - <?php $title = "Title Information That I Want To Display."; $main_content = <<<EOT <div class="test"> <div class="junk"></div> </div> EOT; ?> index.php <?php $a = $_GET['a']; $b = $_GET['b']; if (!$a) $a = "home"; if (!$b) $b = "a"; $path = "$b/".$a.".php"; include ($path); include ('include/header.php'); echo $main_content; include ('include/footer.php'); ?>
  9. You need to investigate what your actual table name is v.s. what is in your query and attempt to find what is different between the two. You either have a spelling error, a capitalization difference (assuming you are on an operating system that is case-sensitive), or you have some non-printing or special characters as part of the table name.
  10. The preferred method would be to set them in the master php.ini, followed by either a local php.ini (when php is running as a CGI application) or a .htaccess file (when php is running as an Apache Module), or lastly by putting them into your script (since fatal parse errors won't be reported/displayed when the two settings are put into a script.) The display_errors setting causes errors to be displayed. The log_errors setting would cause errors to be logged.
  11. Variables don't have values until the code that assigns them a value has been executed. You are going to need to reorganize your logic if you want it to work. Simplest method would be to stop looking at php as a way to copy/paste headers, footers, and content that makes up a page and look at it as a way to build and output content where you want it on a page. Put the code that determines $path and the include ($path) statement as one of the first things on the page (after any other initialization logic.) The code being included by $page should consists of some business logic (the $title variable) and presentation logic (the content or even a template.) You then simply echo the content that was built at the appropriate point on the page, but the business logic that defines what the page means is available to everything on the page because it was included first.
  12. The discrete array functions that modify or access an array pointer - end(), key(), each(), prev(), reset(), next(), ... cannot be used inside of a foreach() loop to access the same array that is being iterated over. There is no need to do so or you should not be using a foreach() loop in the first place.
  13. The nettuts site has at least three different php scripts that cover user registration.
  14. Without information from you as to what framework you are using, no one can directly help. Unless the framework provides a method to process the data in blocks, you will either need to write your own code to extend the framework or you will need to write your own code and not use a framework.
  15. Actually, the syntax rules of any computer programming language are much simpler and consistent than the syntax rules of a written linguistic language, but you do need to proofread your code to make sure it has the correct syntax everywhere.
  16. My post asked (told) you how -
  17. In checking what your code is actually doing, it is unlikely that you have ever successfully executed that code. You are using the variable $db in the mysql_error() statements, but $db holds your db name, not the connection variable $connection and in the form processing section, you are using mysql_real_escape_string() without having a mysql connection present first. You also have a mysql_error() in the code that is executed if $_GET['id'] does not have any value.
  18. Your form does not have a POST field named 'id', so the above line of code won't have a value and in fact the reference to $_POST['id'] would be generating a php error. Are you developing and debugging php code on a system with error_reporting set to E_ALL and display_errors set to ON so that all the php errors would be reported and displayed, including the output from your trigger_error() code? The above would insert an empty value if your INSERT query is being executed. Have you determined (by echoing some debugging messages) that the code where the add_track_to_db.php code is being included is actually being executed and the include is working? Having error_reporting/display_errors set as suggested would be telling you if the include is not working due to a path issue.
  19. That means you don't have a connection at the time the mysql_query() was executed. Based on the short open tag you posted <? in the conn.php code, your server is not setup to use the optional short open tags. Be constant and write code that will always be seen as php code by only using full opening <?php tags, they always work, whereas you will always be chasing down php.ini settings to get short open tags to work every time you switch servers or someone updates php on your server.
  20. Yes, but not relative to where login.php is located at. Login.php is in the admin folder. By using include('admin/include/conn.php') in login.php you are asking for the file to exist in admin/admin/include/conn.php Use include/conn.php Edit: You are also apparently attempting to develop php code on a live server. That wastes a huge amount of your time due to the constant uploading of files. You should be developing php code on a local development system and only put it onto a live server once you have it 100% tested.
  21. The most obvious problem is that the HTTP request that that IPN makes to your web server does not contain any cookie values, so your code does not have any $username and the queries won't ever match any row. The HTTP request from your visitor (which would contain his cookie values or his session id) is completely separate from the HTTP request you receive from the IPN. The only information you get from the IPN is the $_POST data that you have configured the IPN to send to you. Edit: Perhaps you are thinking of the AUTO RETURN URL that paypal returns the visitor to at the end of a payment? That HTTP request would contain any cookie/session id that is set for that visitor because it would be the visitor's browser that is making that request on your site.
  22. Any time you have an application that processes an ever increasing amount of data, you need to use memory management techniques (i.e. process the data in discrete chunks instead of all at once.) It's also possible that your existing code is using 2 or 3 times more memory than necessary, but is would take seeing your existing code to be able to help with what it is doing or where memory management could be added to it.
  23. I'm going to guess that you are attempting to develop and debug your php code on a system where error_reporting/display_errors are not set to show you all the errors php detects. For debugging purposes (remove them when you are done and you should actually have these two setting in your master php.ini so that fatal parse errors are displayed too), add the following two lines of code immediately after the first opening <?php tag in your main file - ini_set("display_errors", "1"); error_reporting(E_ALL);
  24. echo "<FORM name='email' action='{$_SERVER['PHP_SELF']}' method='post'>";
  25. It would really help if you provided some line number information about where the error is occurring at. For all we can tell, you are actually getting that error for a mysql_query() statement because your actual msyql_connect() is either failing or the include statement for the file it is in is failing.
×
×
  • 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.