Jump to content

TweezerMan

Members
  • Posts

    1,763
  • Joined

  • Last visited

Contact Methods

  • Website URL
    http://tweezersedge.com/

Profile Information

  • Location
    Vallejo, CA

TweezerMan's Achievements

Veteran

Veteran (13/14)

  • First Post
  • Collaborator
  • Posting Machine Rare
  • Conversation Starter
  • Week One Done

Recent Badges

1

Reputation

  1. From what I can tell, MySQL's FROM_UNIXTIME() function does not support negative epoch timestamps (just as the inverse function UNIX_TIMESTAMP() does not either). If your query is being constructed in PHP, you can use PHP to convert the timestamp, then place that result in your MySQL query: >$mydate = gmdate('Y-m-d H:i:s', -13391999); In the above example, $mydate will contain '1969-07-30 00:00:01'.
  2. Based on my testing, using htmlspecialchars() with any of the quote style constants (or none of them) works as described in the PHP documentation. I wrote the following script and tested it on my server: ><?php header('Content-Type: text/plain'); echo 'ENT_COMPAT = ' . ENT_COMPAT . "\n"; echo 'ENT_QUOTES = ' . ENT_QUOTES . "\n"; echo 'ENT_NOQUOTES = ' . ENT_NOQUOTES . "\n"; echo "\n"; $text = 'one \' two " three &'; echo "Encoding special characters in string [$text]:\n"; echo 'DEFAULT: ' . htmlspecialchars($text) . "\n"; echo 'ENT_COMPAT: ' . htmlspecialchars($text, ENT_COMPAT) . "\n"; echo 'ENT_QUOTES: ' . htmlspecialchars($text, ENT_QUOTES) . "\n"; echo 'ENT_NOQUOTES: ' . htmlspecialchars($text, ENT_NOQUOTES) . "\n"; ?> The script displays the following results: >ENT_COMPAT = 2 ENT_QUOTES = 3 ENT_NOQUOTES = 0 Encoding special characters in string [one ' two " three &]: DEFAULT: one ' two " three & ENT_COMPAT: one ' two " three & ENT_QUOTES: one &#039; two " three & ENT_NOQUOTES: one ' two " three & Each of the quote style constants is being properly evaluated by PHP, and when used in htmlspecialchars(), each quote style constant is encoding the correct characters. It's hard to say what's going on without seeing the code and/or a concrete example, but it doesn't look like it's due to htmlspecialchars() not handling ENT_COMPAT correctly.
  3. Later on in your series of posts, you mentioned that you "removed everything to do with ROXIO". There is a Roxio Knowledgebase article on "CD/DVD drives missing after installation", with separate utilities available to fix your registry depending on whether a Roxio product is currently installed or uninstalled.
  4. You don't say which registry key you're removing, but I suspect you probably haven't found the one that is the problem. From the text of the error message you posted, it appears that windows is returning a "Code 19" error for the cd-rom and dvd drivers: Microsoft has a couple of articles in its Knowledge Base that may be directly on point with your issue: CD-ROM access is missing and messages cite error code 31, code 32, code 19, code 39, or code 41 after you remove Easy CD Creator in Windows XP CD-ROM drive or DVD-ROM drive appears to be missing after you install Windows XP The first article includes a "Guided Help" utility that can perform the registry edit for you. If you decide to manually delete the registry keys mentioned, the steps described in the second article are more thorough, as they include exporting a copy of the registry keys before deleting them. (But the registry keys are the same ones mentioned in the first article.) Also, the second article contains instructions on how to uninstall the corrupted device drivers (not just remove them), which is not covered in the first article. Hope this helps...
  5. On many PC's, you can hit the 'Pause / Break' key to freeze the BIOS output while booting. If I need to remember something or report something back, I write it down on a piece of paper. When done, I press the space bar (aka the 'any key' ) to resume booting.
  6. You can get the last AUTO_INCREMENT generated by using the mysql_insert_id() function right after performing the INSERT query.
  7. MT 3.3 has been released today! This is the long-awaited upgrade to MT 3.2. * MT 3.3 features * New licensing & pricing (free personal license with unlimited users / unlimited blogs / no support is back!) * New documentation, including downloadable User Manual and Installation Guide I participated in the beta testing of MT 3.3, and like MT 3.2, this another upgrade well worth getting! My single favorite new feature in MT 3.3: Activity Feeds. I can get notifications of new comments / trackbacks (and anything else recorded in MT's Activity Log) in my newsreader. Plus, checking an Activity Feed triggers MT's new Scheduled Tasks framework, eliminating the need for cron jobs to perform scheduled posting of entries or deleting junk comments / trackbacks. (Side note: When you download and install MT 3.3, the version will actually indicate 3.31. That is the correct version.)
  8. To block access from IP addresses in the range of 85.102.40.0 - 85.102.255.255, you'd need 4 directives in your .htaccess file: ># Block IPs in the range of 85.102.40.0 - 85.102.255.255 deny from 85.102.40.0/21 deny from 85.102.48.0/20 deny from 85.102.64.0/18 deny from 85.102.128.0/17 85.102.40.0/21 blocks 85.102.40.0 - 85.102.47.255 [2048 IPs] 85.102.48.0/20 blocks 85.102.48.0 - 85.102.63.255 [4096 IPs] 85.102.64.0/18 blocks 85.102.64.0 - 85.102.127.255 [16384 IPs] 85.102.128.0/17 blocks 85.102.128.0 - 85.102.255.255 [32768 IPs] ...for a total of 55,296 IP addresses blocked. Blocking "85.102.40" will just block the range of 85.102.40.0 - 85.102.40.255 [256 IPs], a much smaller range than what is desired.
  9. Welcome to the forums, 5FM! This doesn't make much sense. GoDaddy shouldn't care too much about what outgoing ports are used, and the port to connect to on the remote server (the MySQL database server) must be 3306. Also, connections to a MySQL database server are not http or https connections (a MySQL server is not a web server). Assuming that there isn't another php script being imported, this script isn't using the variables that hold the connection information to actually connect to the MySQL server. In the last line of code, $hostname_conAdmin, $username_conAdmin, and $password_conAdmin should be $hostname_conIDX, $username_conIDX, and $password_conIDX. That's about all I can tell you, based just on what you've posted.
  10. I think you mistyped this part of your code, as it is invalid and doesn't work on my test page: ><a href="popWin('./index.php?action=open&id=579')"> ('href' should be 'onclick'...and I don't know what you have for 'href') This tells me that you're losing the value of the morewin variable after the popup window has been opened. I don't know what you have for the href attribute in the link that opens the popup window, but if it links to the same page the script is on, or to another page with a copy of this script code on it, the closepopWin() code won't work. Javascript variables and their values do not carry over from one page to another (including a reload of the same page). If the link that runs popLink() also loads a page in the main window, the value of morewin will be lost. I'd suggest using basically a null href with the onclick code to call popLink(): ><a href="#" onclick="popWin('./index.php?action=open&id=579')"> If you'd like the link to work in browsers that don't have javascript, or don't have it enabled, you could have the same link in both the href and onlick attributes, but the onclick code must have a 'return false;' at the end to disable the normal link function if the javascript code runs: ><a href="./index.php?action=open&id=579" onclick="popWin('./index.php?action=open&id=579'); return false;">
  11. I created a test page with the code you listed at the beginning of your post, and a couple of links with an onclick event to open and close the popup browser window. Your code appears to be fine. However, I initially had the same issue you did - the open window code worked, but the close window code did not. As it turned out, I had misspelled 'onclick' in the close window link ('onlick'), which prevented the close window code from being run. Once I corrected that, the close window code worked correctly. I'd suggest looking at how you're calling the javascript closepopWin() function in the body of your page, and make sure there aren't any errors / typos in it.
  12. Welcome to the forums, stb76! I believe you're getting this error because ODBC libraries that support the type of database you want your script to talk to have to be compiled into PHP. TCH servers do not have PHP compiled with any ODBC driver support, so the various odbc_* functions would be unavailable.
  13. I don't know what you're doing now (I guess not display an image at all...?), but what I would do is have a 'default' image available for reviews that do not have their own image. In your PHP code, check to see if there was an image name in the query results. If so, set $image to the name returned in the query; otherwise, set $image to your default image name. Then in the code you've shown here, $image will always be set, and there would be no need for an if block at that point. Here, I was talking about someone entering an invalid movie id. You'd query the database, but the database would return no results in that case. After running the query, but before generating anything for the web page, you'd want to check and see if the initial query returned anything (whether the movie id was valid or not). >$result = mysql_query("SELECT * FROM movie where movieid='$id'", $link); if (!mysql_num_rows($result)) { ...Bad movie id - display 404 page here... } ...continue with code to display requested page...
  14. Part 3 of my 3 part reply... Rather than create and use an actual column in your table, you may be able to use a calculated column instead. To get a reliable list of "S" titles without combing through the entire database in PHP, your MySQL query is going to need to identify those titles itself. I'm sure what IMDB uses is more complex, but here's a query that will pull movie titles beginning with "S", taking into account titles starting with "A", "An", or "The": >SELECT title, CASE WHEN SUBSTRING(title, 1,2) = "a " THEN CONCAT(SUBSTRING(title, 3), ', ', SUBSTRING(title, 1, 1)) WHEN SUBSTRING(title, 1, 3) = "an " THEN CONCAT(SUBSTRING(title, 4), ', ', SUBSTRING(title, 1, 2)) WHEN SUBSTRING(title, 1, 4) = "the " THEN CONCAT(SUBSTRING(title, 5), ', ', SUBSTRING(title, 1, 3)) ELSE title END AS list_title FROM movies WHERE title REGEXP '^((a|an|the) )?s.*' ORDER BY list_title ASC This query select the movie title, and calculates a list_title for each title as follows: 1) If title starts with "a " (case insensitive), strip that from beginning of title, add ", " to end of title, followed by just the "a". 2) If title starts with "an " (case-insensitive), strip that from beginning of title, add ", " to end of title, followed by just the "an". 3) If title starts with "the " (case-insensitive), strip that from beginning of title, add ", " to end of title, followed by just the "the". 4) Otherwise, use the actual title. The WHERE clause filters the records by only returning records that start with "s" (case-insensitive), optionally preceded by "a", "an" or "the" and a space. Since list_title is an actual column returned in the query, it can be sorted on, and the above query sorts the results alphabetically by the new calculated list_title column.
  15. Part 2 of my 3 part reply... You can redirect to any URL as long you haven't outputted anything (used any echo() statements or output any plain HTML) yet to the visitor's browser: ><?php if ($bad_id) { header("Location: http://www.my-TCH-domain.com/"); /* Redirect browser */ /* Make sure that any subsequent code in script does not get executed when we redirect. */ exit; } ?> (...where $bad_id represents some condition you've tested, indicating an invalid id.) If you have a custom 404 error page, you could just output a 404 header and include the file, rather than do an actual redirect. If you don't have a custom 404 error page (you're just relying on the Apache default 404 page), you can replicate it with the following code: ><?php header("HTTP/1.1 404 Not Found"); echo <<<EOT <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL {$_SERVER['REQUEST_URI']} was not found on this server.</p> <hr> {$_SERVER['SERVER_SIGNATURE']} </body></html> EOT; ?>
×
×
  • Create New...