Jump to content

asylum

Members
  • Posts

    55
  • Joined

  • Last visited

Everything posted by asylum

  1. vi is awesome. I would use ConText but I'm not on windows. I could definitely use an editor with tabs though.
  2. I think he means in aokforums.com's configuration which you can't change from your script.
  3. 1 & 2. Well, to learn about httpd.conf you first need access to the file which no web hosting company aside from serverpowered.com is going to give you access to as it could compromise their entire server. If you do have access to it then I think the best place to start learning is by reading the descriptions of the properties in the file. It will be in the apache folder and in the conf folder there.3. As far as encryption work goes, I wouldn't encrypt things you send in emails because the client will have now way of decrypting it unless you make the key public in which case you're just wasting your time. I would only encrypt things before putting them in the database and decrypting them after getting them from the database. However, a note on passwords and other such things, you need not decrypt them as functions such as md5 will always generate the same value for a give string. So all you need to do to get passwords to work is encrypt their password when they register and then encrypt their password every time they try to log in and check it against the encrypted password in the database.4. I swear by the O'Reilly books. Go to a Borders or something and get the O'Reilly books "Programming PHP" and "Web Database Applications" (which uses php and mysql) and you'll probably be set. Their javascript book is very good as well if you think you want another js book. I have never regretted buying an O'Reilly book.5. I doubt flock() prevents other people from accessing it and I'm almost positive you can't flock() a db connection as it's not a file but a resource.6. In my opinion you should only use external processing pages when either the code in the current page is getting a bit chunky and full or if you need to set a cookie or a header. Otherwise I see no reason to not just use the same page. There are however certain cases where you might want to use a seperate page for a different reason. For example you might want to create a page to handle all forms and actions and centralize things in a sort of way; not my personal preference though.7. If you know the javascript DOM then you're ahead of the game when it comes to oop. Object orientation is basically just a good way to bundle data and functions that act on that data. For example (tell me if this is another incomprehensible example), you may want to create a DB class to manage your db connection and handle queries of specific natures. You may have a forum and in your DB class you have a function that will get all the forums associated with a certain section or get all of the topics associated with a forum.8. My personal preference is to use javascript whenever I can to help prevent the reloading of a page. The benefit of using a server-side langauge against a client-side language for form vallidation is slim to none. So unless you have some data in a file or database to validate information or the format of information against I would just use javascript.9. I know nothing abuot Harden PHP but I would guess the point of it is the same as that of any extension of PHP: to give you more power. I would stay away from hacks you're unfamiliar with as there could be security flaws or just flaws in general and it would really ###### to make a bunch of changes and have your code break and not know how to get back to regular PHP without uninstalling and reinstalling it.10. As for a PHP bible, I don't think there is one but the O'Reilly book "Programming PHP" is very good. It covers the basics and some more advanced topics though I wouldn't call it the PHP bible.11. The positives are that you can dynamically generate php code from variables. This is much like the convention: $v = 'foo';$$v = 'bar';$foo == 'bar'; //true However eval is slow and can be a security risk when used with user input. If you check all your user input then eval is just slow.12. I don't know why he didn't take it out, maybe there's a hidden convenience to being able to pass any parameter at all to a script; the $$v = 'bar' can be an example of this.13. I'm sure you (or at least a person could) hack the scripts so that they don't need register_globals on, it's just a question how much effort vs. value when there are so many other alternatives that don't use register_globals already.14. Well I assume you know that the ! means a logical not so when you say if(!empty($v)) you're saying if variable v contains something then do this. So I'm not sure if that answers your question or not.15. I've never had a problem with isset so I think he may have been mistaken.16. Check php.net17. I am using some moderately advanced joins and table configurations and I'm using 4.1 so 5 should be fine.18. I also don't know anything about PEAR db though I've been meaning to look it up (and I think "Programming PHP" talks about it).I hope I at least answered some of your questions. Probably not as clear or concise as justsomeguy, but oh well.P.S. you're not posting this on php freaks, this is w3schools
  4. Well if you hold your mouse still over it then it wouldn't do that And it's just a prototype menu that I capriciously included.I'm still having problems with IE4+ (aka IE6). For some reason the offsetLeft property isn't working and the obj.getAttribute("id") returns null (I know it doesn't have an id now but I added one and it still said that).If anyone can figure this out I would greatly appreciate it, though I know that's not much incentive
  5. my suggestion, move to awardspace.com or somewhere that isn't freewebs
  6. Including will do that though you can't store the output in a variable.EDIT: I take that back, look at this example: $string = get_include_contents('somefile.php');function get_include_contents($filename) { if (is_file($filename)) { ob_start(); include $filename; $contents = ob_get_contents(); ob_end_clean(); return $contents; } return false;}
  7. Just make a blank html page that contains an image tag with no src. Then when you want to display an image in a new window open that html page instead and then rewrite the src of that img tag in the page to be the src of the desired image.Does that make more sense?
  8. I struggled with this problem for a long time a while ago and decided I wasn't going to make an html page for each window so I just made one html page with a blank img tag and every time I opened that html page in the window and substituted the blank img tag for whatever src image I wanted. Try that.
  9. The only array I was using was the $_POST array which contains all of your form data and that's what I was looping through, then I was adding errors to the string appropriately and printing all the errors at the end and show the repopulated form again. If there were no errors then I would send the email.As far as I can tell it's not the fact that you're doing it on the same page that's causing the problem and if you want to keep the look and feel of the code you had before then try this: $err = 0;if (isset($_POST['send'])){if (empty($_POST['name'])){$err++;print('The name field has been left blank<br />');}if (empty($_POST['emailaddress'])){$err++;print('The Email Address field was left blank<br />');}if (empty($_POST['verifyemail'])){$err++;print('The Verify Email Field was left blank<br />');}if ($_POST['emailaddress'] != $_POST['verifyemail']){$err++;print('The Email Addresses do not match, please fix this<br />');}if (empty($_POST['description'])){$err++;print('The Description Field was left blank<br />');}if($err) {//reprint form code goes here} else {//sending the email code goes here} I hope it's starting to make more sense.
  10. Did you try what I said with the foreach loop? Because that's how I would do it.
  11. Hello everyone, I'm preparing to go "live" with my website and I need to make sure it works in IE but I've been informed by a friend that the menu doesn't slide because of some error. So I would like to knw what I'm doing wrong. Undoubtedly it is related to the way I am attempting to get the style properties so here's that piece of code: function getStyleT(obj,s){ if(document.all) return obj.style.getPropertyValue(s); else return document.defaultView.getComputedStyle(obj,"").getPropertyValue(s);} It works fine in FF obviously so I just need some people with IE know-how to help me out here. The website is unnaturalfusion.com
  12. Yes, I didn't notice that but echo isn't a function it's a language construct so it's more like a keyword than a function.
  13. $err = '';foreach($_POST as $k => $v) if(empty($v)) $err .= "Please fill out the field named $v<br/>";if(empty($err)) mail(...);else echo $err; echo $form_code_repopulated;
  14. if (empty($_POST['description'])){print('The Description Field was left blank<br />');}else {... That is why you only need the description, because that's all that the else statement is on, that's why I said I would handle the errors completely differently, because your way doesn't work.
  15. Why convert it to a txt? Just right click it and say open with... then choose notepad and you can edit it without changing the extension.
  16. Well first of all, it isn't disappearing when an email is sent because you don't have the form code inside of an else statement that says if(sent) then ok else print form.I'm not sure what you mean about your third problem but for your first I would not use the value property of textarea as I didn't know that existed, but rather put the text in between the textarea tags.
  17. did you decline to overwrite the original file? Cause that might have named it something different. Not really sure, I'm not a windows guy so I couldn't tell you what notepad would do *shrugs*. But I've heard that cache related problems are usually solved by reloading the browser (which might reload your settings too).
  18. To me it looks like "if !isset($_POST['submit']) then send an email". Look at the else statement after your error checking.I would suggest doing it differently, compile your errors in a string and if the string is empty then send an email else display the errors. That's just what I would do.
  19. Well since the page isn't working at the moment I can only guess as to what exactly you want centered (the "wrapbottom" or just the list) but margin: 0 auto; position: relative; centers things for me. Have you tried that?
  20. Doesn't matter, I found what might be a solution. Perl is awesome, that's all I'll say...C + the web = da bomb.
  21. I want to get all the div elements and print their attributes (name value) style but I get an XPath parse error when I load it in firefox 1.5. Does anyone support XPath 2.0 yet or am I just doing something wrong? <xsl:for-each select="div"> <xsl:value-of select="for $n in @* return concat(local-name($n),$n)"/></xsl:for-each>
  22. Reason for making:To learn the GIMPThings about this image I might change: I'm not sure, maybe add something besides just a black background
  23. Actually there is a way to do what you're asking but it might be more work than you're up for. But it's XML. javascript can import XML files and read their document tree (though it can't write them so forget a dynamically updatable database) and all the information therein.What you seem to be trying to do with the arrays is something like this: var arr = [["babooon","cat"],["hairy","4 legs"],["stupid", "2 legs"]];function select(animal){ var text = ''; for(var i=0; i<arr.length; ++i) if(arr[i]==animal) for(var j=i+1; j<arr.length; ++j) text += arr[j[i] + " "; document.getElementById("container").innerHTML = text;}<body onload="select('baboon')"> <div id="container"></div></body>
  24. Well you were right to change the && to an and as I don't think you can use the &&. Try this: /bookstore/book[child::order > 1 and child::order < 4]/title *shrugs* just try all the permutaions you can think of. If that doesn't work take off the /title and then take off one of the conditions.
×
×
  • Create New...