Jump to content

pquery

Members
  • Posts

    71
  • Joined

  • Last visited

    Never

Everything posted by pquery

  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]–>
  16. create yourself a nice small rounded bottom and set that to be the background image of the id="bottomCell" flip that image and then use that as the background image of the id="topCell", if your tables arn't going to be uniform in size however make sure that your background image scales nicely
  17. I finally figured out a fix (for others that might run across the same problem) All the microsoft KB articles were basically worthless ~ imagine that. here is the way I got mine to work <?php session_cache_limiter("must-revalidate"); session_start(); header("Content-type: text/xml"); header('Content-Disposition: attachment; filename="DMTMtests.xml"'); //header("Pragma: no-cache"); //header("Expires: 0"); $created = date('l jS \of F Y h:i:s A'); NOTICE that the session_cache_limiter is above the session_start(); IE now will allow the file to be saved.
  18. I'm having some problems with my web application now that it's gone live... one of the main features was that the client was going to be able to download Excel files (well open Xml files in this case) from the web server. And I got all that working... When they asked their site to be secured via Secure Certificate, I said no problem. Now it seems the two together along with trying to download the file on IE causes a real issue with an alert box popping up stating "Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later" The script to dynamically kick out the XML works on the intranet (no SSL certificate) and it also works with the SSL via firefox which the client will not deploy on their network. I've read about 4 Microsoft KB articles including http://support.microsoft.com/kb/234067 http://support.microsoft.com/kb/812935-I didn't see how to implement this one in a php context. http://support.microsoft.com/kb/316431 http://fr.php.net/session_cache_limiter is session_cache_limiter() what I should be using to get around this? (I did try this with this is the code that works on the Intranet / FF <?php session_start(); header("Content-type: text/xml"); header('Content-Disposition: attachment; filename="PTMAssessments_'.$group.'.xml"'); header("Pragma: no-cache"); header("Expires: 0"); and then there were different things I was trying after reading the MS KB articles, such as... <?php session_start(); session_cache_limiter('public'); header("Content-type: text/xml"); header('Content-Disposition: attachment; filename="PTMAssessments_'.$group.'.xml"'); //header("Pragma: no-cache"); //header("Expires: 0"); if anyone has a solution to this Microsoft IE issue I would really appreciate it.
  19. another option i've found that works when testing things on a windows box in an Xampp enviroment is to download the package you want from http://pear.php.net/packages.php then untar them or un tarzip them and place them into the xampp/php/PEAR directory that will usually work - I've had success with quite a few packages like that (and they found the fonts without errors vs some of my linux machines)
  20. I've been trying to figure out what this page has been barking about for half the afternoon now.... I keep getting the same number of fetch array warnings as that are built for my array which is generated, I just don't know if I'm missing a comma or semi or what, because I've inserted it in my DB as a straight SQL query using a number of the values that have been echoed out and it gives me exactly the data that I'm looking for... WHILE ( $row = mysql_fetch_array($result2)) { $i++; $candidates[] = $row['applicationID']; } //print_r($candidates); //misc functions mysql_select_db("$db2_name")or die("cannot select DB"); echo " Origional I value = $i <br />"; //foreach ($candidates as &$value) { WHILE ( $i != 0 ) { //echo "canidate $i = $candidates[$i] <br />"; $value = $candidates[$i]; //$sql = "SELECT applicationID, firstName, lastName FROM applicants WHERE applicationID = '$value';"; $sql = "SELECT t1.applicationID, `firstName` , `lastName` , `applicantPosition` FROM `applicants` AS t1 LEFT JOIN applicantposition AS t2 ON ( t1.applicationID = t2.applicationID ) WHERE t1.applicationID = '$value';"; echo "value = $candidates[$i] <br />"; $result = mysql_query($sql); [b]$row1 = mysql_fetch_array($result);[/b] // this is where it barks every single time and hence there's no array to for the insert statement later I've tried my query with $candidates[$i] and then subsuiting $candidates[$i] for $value to see if that made any difference, I've tried a for loop and and while loop countdown to see if that would help and now I'm stuck at the moment. Your help is appreciated as always (I'm hoping it's something simple and stupid I'm overlooking)
  21. Quick Q, because maybe I'm having a little brain fart.... I'm building a function that's checking to see if a someone has a record on 20 different tables and will then calculate cumulative totals, but I want it to stop if it doesn't find a record on any of the tables as to save processes. would a break; statement work like used on a switch? ex: if($count1==1){ $total++; }else { break; } I know break can be used to break out of loops but will it break out of the function totally? I'm planning to just have this function included on a variety of different pages. thanks
  22. Thanks, I was looking all in the key functions and never even though to look there
  23. Hello, I'm having a little trouble having my smarty template which is generating Here is the main code of the tpl file which is doing the work: {foreach from=$candidates key=myId item=i} <tr> <td align="right"><input type="checkbox" name="candidate[]" value="{$i.applicationID}"> </td> <td align="left"> {$i.firstName} {$i.lastName}</td> <td> <select name="station[]"> {html_options options=$stations} </select> </td> </tr> {/foreach} And here is the code from my php file that is generating the actual page: WHILE ( $row = mysql_fetch_array($result)) { //print_r($row); $candidates[] = $row; } $smarty->assign("stations", $stations); $smarty->assign("assessors", $assessors); $smarty->assign("candidates", $candidates); And finally the row output from a print_r statement (names have been starred out to protect the innocent ) Array ( [0] => Array ( [0] => 8965dd88 [applicationID] => 8965dd88 [1] => S*** [firstName] => S*** [2] => G*** [lastName] => G*** ) ) I've tried building this array about 5 different ways, but nothing seems to be working right for me. I've also noticed that the server I'm using is using PHP 5.1.6 so array_fill_keys wouldn't work for me any ideas are appreciated.
  24. Hi folks, after offering a lot of help here on the CSS board, I was wondering if anyone had a good link to an example of how to make a bunch of data (let's say 20-30 table cells) display in a nice readable format like an excel spreadsheet. I could code this all by hand, but I'm a little under the gun to get this inital part of the project finished, and I'm still writing all the php/mysql backend. So... if anyone knows an article by Snook, or Stu Nicoles, or Eric Meyer, Lynda (or Macromedia fame) that covers this topic - it would be greatly appreciated
  25. I would first just trying your SQL statment in something like phpMyadmin (of course subsutiting variables for somewhat real values) to make sure there isn't an error in your sql statement if you're not getting a die statement that sounds like where the problem is lying
×
×
  • 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.