Jump to content

pquery

Members
  • Posts

    71
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Male
  • Location
    Atlanta, GA

pquery's Achievements

Member

Member (2/5)

0

Reputation

  1. Well after reading through tons of log files, both access and error I finally have a working way of restricting my pre-approved browsers and I thought I'd post in case anyone else wanted to know how to do this task. (Also I had to add Chrome to my set of approved browsers since it seems to masquerade as Safari) I know Opera can spoof FF and IE but I'm mainly looking to deter mobile browsers and those that can't comply with the scripting rules in the pages which follow: RewriteEngine On RewriteCond %{HTTP_USER_AGENT} ^Mozilla/[5].*Safari/[533*]* [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^Mozilla/[5].*Firefox/[3.*]* [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^Mozilla/[4].*MSIE/[6.0]* [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^Mozille/[4].*MSIE/[7]* [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^Mozilla/[4].*MSIE*8* [NC] RewriteRule ^test\$ http://mydomain.com/test/index2.php [L] RewriteRule ^test\$ http:// /browser_redirect.php [L] RewriteRule ^index\.php$ http://10.10.8.69/browser_redirect.php [L] If anyone has a way to filter out Google chrome I'll take that suggestion.
  2. I would also check and make sure that your table is named correctly in your query otherwise you'll have to create that table
  3. Friends, I'm asking for a little help from those that already have these strings handy and could cut and paste a reply and save me a few hours of testing and reloading multiple versions of browsers on my test machines. I'm trying to redirect those that are not using one of the compliant browsers which has been predetermined so these need to be determined in the HTTP_USER_AGENT lines such as RewriteCond %{HTTP_USER_AGENT} ^Mozilla/[345].*MSIE* RewriteRule \var\www\html\htdocs\test\index.php$ [L] RewriteRule ^index\.php$ [L] If anyone has the HTTP_USER_AGENT line for the following browsers that they could share I would greatly appreciate it: IE 6.0 / 7.0 / 8.0 Firefox 3.0 / 3.5 / 3.6 Safari 5.0 Thanks
  4. I had the same issue for a while on a new server where I was testing out some new things with mod_rewrite that was running apache2... this is how I solved it go into your /etc/apache2 directory then go into your sites-enabled directory and into the site where you're trying to get the site to have the Rewrite Engine working vi into that file (because hopefully you're doing this at a shell level and not trying to do this from some ISP's control panel editor) it might be named default if you haven't changed any settings an look in the Virtual host settings # AllowOverride None AllowOverride FileInfo Options You need to set the AllowOverride option from none to FileInfo and options (see my example above where I commented out the none) restart your server (/etc/init.d/apache2 restart on debian/ubuntu OR service apache2 [httpd] restart on redhat) and your mod_rewrite changes should take place.
  5. That file looks like it was opened up (or created in) a Microsoft product, especially Word. That's where those inverted quotes come from all the time I've found. What might help you is if you take the whole .sql file, copy and paste it to notepad (NOT word pad) and then save it as .txt or .sql, re-open it and try re-pasting into your browser. I'm guessing that maybe you're doing all of this on a windows based system? That can "wash" the script of the funny single and double quotes that could be hampering your script.
  6. you might want to read on the nagios plugin forums and see how some of them are doing it. Although they usually write their pulgins in PERL, you might be able to see the methods on what they're using to check and calculate
  7. I'm trying to prepare a PHP / PEAR statement for insertion into my MySQL database, but I just can't seem to find where or how to place the field for the auto-increment ID field at the beginning of the table? (an nothing seems to explain this in the documentation I've seen so far. (NULL) doesn't seem to be what I want inserted in this placeholder since it's a non-null field, so I was hoping someone around here knew how to do this (or could point me the way to a helpful link) here's an example of what I'm trying to accomplish: require_once 'dsn.php'; $data = array( "",3, 'Cameron', 'Kirk'); $sth = $db->prepare('INSERT INTO employees VALUES (?, ?,?)'); $res = $db->executeMultiple($sth, $data); if (DB::isError($res)) { // Check the result object in case there die($res->getMessage()); // was an error, and handle it here. } Now my dsn conncetion is fine, but I keep getting the error message of : DB Error: mismatch There's the right number of fields for that table, just the blank is where the autonumber should be.
  8. One thing that might help you is deciding whether you want to use Perl or straight bash scripting for the script you're going to call from the crontab. if you're trying to do something simple like: create a report of large files create a archived backup do a mysql database dump as a backup or even use SAMBA to connect to a windows server on your network to move files these can all be done with bash scripting
  9. I've actually figured out how to enable the mod_rewrite functionality on apache2 after searching around for a while, and now my first few cake applications seem to be working Here's a few ways to test if your mod_rewrite is working correctly: first take a look at your phpinfo(); and do a search for Loaded modules. you should see mod_rewrite in there - if not this is where your problem is second test - Create a .htaccess file (a text file named .htaccess) with the following code in it in a subdir Options +FollowSymLinks RewriteEngine On Save the file to a subdirectory of your main site something like this /rewrite-testfolder/.htaccess Now attempt to browse to the subdirectory (http://localhost/rewrite-testfolder/). One of two things could happen - No errors Congrats mod_rewrite engine is enabled. - 500, Internal Server Error If you get this message then mod_rewrite was not installed/enabled on your computer. This is how I fixed it on my ubuntu / debian based servers running apache2 sudo a2enmod rewrite in a terminal window this enabled the mod_rewrite module, upon refreshing the pages no more 500 server error and Cakes' tiny urls were working, also on the homepage of my cake installation everything was much more colorful and styled (at least on my umbuntu server) - these steps enabled the mod_rewrite on my debian server but didn't produce the colorful cake homepage so I'm still trying to find a solution
  10. the strangest thing about that smarty index page is that the smarty function is never called / declared $smarty -> newSmarty(); unless it's in one of your two includes include_once "local.cfg.php"; include_once INCLUDE_DIR."common.inc.php"; if your site is working then it's fine, but I like to know where things are originating in case something breaks so you don't have to spend hours troubleshooting something.
  11. I'm trying to install cake on my Debian based server and I'm running into some of the same issues which you're having however I'm pretty sure I know what's going on, just not how to solve it: The first question I would ask is on your http://localhost/cake do you have a full color page with styles or a bear bones page? from http://book.cakephp.org/view/326/the-cake-blog-tutorial Occasionally a new user will run in to mod_rewrite issues, so I'll mention them marginally here. If the Cake welcome page looks a little funny (no images or css styles), it probably means mod_rewrite isn't functioning on your system. Here are some tips to help get you up and running: So it sounds like you're having mod_rewrite issues as I am (see the link for other ways to diagnose this and possibly solve if you're using apache 1.*, I'm got apache2 going on my server and things are just in the httpd.conf file anymore so I'm hoping that someone has some experience changing mod_rewrite settings for cake on apache2
  12. When you do your schema think about using a "security_level" or "user_level" table that associates the level and privilages of the current user and then that allows for global changes later on and you can have the ability to 'stack' privileges. here's an example framework (done MySQL style) levelID int (4) levelName varchar (65) then in your users table just include a table field to associate the corresponding user level upon lookup. Then just use sessions at the top of each page to look up access allowed on that page based on the user level. I've also used Smarty before and used some of the built in functions to show or hide content on the template pages based on user access level set in the session.
  13. Is there any way for you to check the logs from your old server? You might have moved to a server that's displaying the warnings in the php.ini instead of logging them. If your page is still displaying with the warnings that I would look that the display_errors setting on the php.ini and then restart apache
  14. where should I look to fix a name not resolving without the www prefix? I have another subdomain resolving to another machine on the network, but I've tried using an alias and a virtual domain but it doesn't seem to resolve, either inside my intranet or on the intranet. Also how long should this take to replicate around a intranet and across the internet?
  15. sometimes I've found the need to add IE specific stylesheets or add IE specific lines to the head of the document(s) There's 6 specific rules/conditions that can be applied: 1. [if IE] - if above or equal to version 5 2. [if IE 6] - if equal to version 6 3. [if lt IE 6] - if less than version 6 4. [if lte IE 6] - if less than or equal to version 6 5. [if gt IE 6] - if greater than version 6 6. [if gte IE 6] - if greater than or equal to version 6 here's an example: <!–[if gte IE 5]> <style type="text/css">@import "IE_only.css";</style> <![endif]–>
×
×
  • 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.