Jump to content

kreut

Members
  • Posts

    99
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

kreut's Achievements

Member

Member (2/5)

0

Reputation

  1. Hello, I'm trying to sanitize user input and have been banging my head over HTMLpurifier the last several days (some weird encoding issues). So...I decided to try out HTMLawed. Using the following code: require_once('htmLawed/htmLawed.php'); $text ='<script type="text/javascript">This is bad stuff</script><p>hello how are < you?'; $out = htmLawed($text); echo $out; I would think that it would get rid of my javascript. But, in the browser $text looked exactly the same. This is such a newbie question that I'm embarrassed to ask it as the HTMLawed documentation "looked" great. Can someone please explain the error of my ways? Thanks so much, Eric
  2. Hello! I'm using MAMP version 1.9.4 which has PHP 5.3.2 on it. However, I'd like to use version PHP 5.3.6 instead so that I can match my production version PHP. Has anyone installed a new version of PHP with their MAMP? Thank you, Eric
  3. Hello! I'm trying to understand exactly how http requests relate to a php script. 1) What would be considered a large amount? 2) How can I see how many I have for a given page? Thank you, Eric
  4. Hmmm..I'm not sure what you mean by "skip the grants". If it helps, the exact error that I get is: "DROP command denied to user 'root'@'localhost' for table 'examples'" Isn't this saying that as a root user I don't have the access? This doesn't really make sense to be because I thought that the root user was the "superuser". If you could clarify your answer, I'd appreciate it. Thanks! -Eric
  5. Hello! Somehow (as if by magic...) I changed my local testing environment MAMP root permissions so that I could no longer DROP tables. Well, now I'd like to DROP tables, but it won't let me change my root user (permission denied/password needed). Since I'm not asked for a password in the first place I'm not quite sure how to do this, nor what password to use. Any help would be appreciated...I'd hate to have to reinstall it all. Thanks so much, Eric
  6. Thanks so much for your help! This seems way better than using reCaptcha from a customer service point of view. Why doesn't everyone do it this way? -Eric
  7. Thanks for responding to my post. To detect logged in members I'm using the Zend_Auth adapter with hasIdentity() to see if a user is correctly logged in and is of the appropriate user type; this is after they log in using Zend_Auth in conjunction with matching the credentials to my database using Zend_Auth_Adapter_DbTable. And, from what you said on your post, it sounds like the idea of dynamically generating a mathematical question then outputting it as an image could be an alternative to using Captcha ---do I understand you correctly? I feel pretty comfortable with php but have never output text as an image. Might you have a resource that could get me started?
  8. Thanks for the response! But, can they get to things INSIDE my site? In other words, let's say a user has to register --AND PAY-- to use my site. Once in the site, they have a "Send me comments form". Could the spammer spam that if the "Send me comments form" is only accessible to paying users? Thanks again....
  9. Hello, I'm currently using Captcha as a means to prevent Spam on my website for user's comments in a "Contact Us" form. The more I think about it, the more I wonder why the heck I'd use such a difficult to read (annoying?) method as opposed to something like: Create a php script that generates two random numbers between 1 and 10 (x and y). Ask the user "Please prove you're human by telling me the sum of x and y.". If they don't, then the form won't be submitted. Also, I feel like I don't even really understand exactly HOW someone can spam my site: if, for example, there's an email form within my site on a secure page (in other words, after the user logs in), would a spamster be able to get to that? Thank you, Eric
  10. Hello, I began programming several months ago with PHP and am beginning to feel comfortable with the programming aspect (it's the first language I've used). I'm now looking into optimizing my website and have found CloudFlare to (easily) use to cache my javascript/css files. I've now learned that I can use APC to do the same thing with my php files. But, this is uncharted territory, and I feel a bit of a noob. But, you've got to start somewhere! 1. By APC "caching unchanging php files", what does this mean exactly? For example, my understanding would be that if I have a php script that defines functions, that this would be cached since the script won't change. However, in another script that dynamically generates variables, would the script itself sans the changing variables be cached as well? And does "caching" the script mean that 1 user who visits multiple times won't have the script recompiled? Or, once cached, any user who uses that script will use the cached version? Seems a bit like withcraft at this point. 2. This article: http://www.debian-administration.org/articles/574 made it seem "simple" to install --- that is, except for someone who doesn't know how to get to the "input screen". (I do have cPanel and have the option to install Pear packages, but never have done so). If someone could help pull away the curtain of the behind the scenes world of APC, I'd appreciate it! Thank you, Eric
  11. Hello, I'm using: header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=\"$filename\""); to download a file from my server. After this happens, I'd like to use header("Location:/index.php") to redirect the user. I'm finding that if I add in the redirect, then this is the only thing that it does (in other words it executes the last header). Is there anyway to have two headers which do 2 different things, namely download and then redirect? Thanks so much, Eric
  12. Hello! Thanks to everyone's suggestions, I've almost found my solution. Basically, I took my array and transformed it into a ";" delimeter format. As you can see from the output below, it ALMOST works. I say almost, because the first column on each row is a little "wacky": notice that Name has no quotes around it and the there's a quote at the end of each line as opposed to being part of the next line. The net result is that in excel, all columns look great, but the first column looks like: Name Student, Perfect" Brown, Justina " school, home" school, home" Any additional thoughts on how to fix the first column would be appreciated. Thanks again.... -Eric $fp = fopen('filetest.csv', 'w') or die("can't open file"); //write to a file $output = ''; //start with blank output foreach ($list as $fields) { $new_array =array(); foreach ($fields as $key => $value) { array_push($new_array,$value); } foreach($new_array as $line){ $output .=$line.'|'; /separate each element in the array } $output .="\n"; /start a new line } $output = explode("|",$output); fputcsv($fp, $output,';'); //use the semicolon delimeter Name;"Types of Real Numbers";"Variables and Equations";"The Number Line and Graphs";Functions;"Review of The Language of Algebra";"Quiz #1 ";"Tables, Equations, and Graphs";"The Slope and y-intercept of a line";"Standard Form of a Line";"Linear Inequalities";"Solving Linear Systems of Equations";"Parallel and Perpendicular Lines";"Review of Linear Relationships";"Quiz #2";"Distance From the Origin";"Distance Between Two Points";"Absolute Value Inequalities";Total;" Student, Perfect";100%;100%;100%;100%;100%;100%;100%;100%;100%;100%;100%;100%;100%;100%;100%;100%;100%;100%;" Brown, Justina ";0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;" school, home";0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;" school, home";0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;" "
  13. Still no file..no error...but now I have this output: int(470) int(109) int(126) int(123) int(123) Was this part of error checking? PS I definitely would like the CSV output to keep possibilities open.
×
×
  • 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.