Jump to content


  • Posts

  • Joined

  • Last visited


Everything posted by john010117

  1. Expanding on that, it's used primarily by JavaScript for identifying specific fields in the form.
  2. First problem I saw: use: if(insert_order($_POST)!==false) instead of: if(insert_order($_POST)!=false)
  3. Why would you want to remove it? You should give credit to the people who built the script.
  4. setcookie() And do a simple if/else statement to see if the cookie is set.
  5. error_reporting(E_ALL); turns the error reporting on. Put that at the very top of your script.
  6. First of all, make sure your server has a mail server installed.
  7. The only bug I could find is vulnerability in the search engine. Enter this code: "><script>alert('hi')</script> into the engine, and it'll alert saying "hi".
  8. View source. Does it output the full PHP code? Then you need a webserver. WAMP is good for Windows.
  9. Hello. I have a simple 2-column full-CSS layout (meaning: no tables). While putting the borders in, I have noticed that they do not show to the extent of the parent div. Let me show you what I mean: #overall_div { width: 100%; } #column_1 { width: 25%; float: left; border-right: 1px solid #c2c2c2; } #column_2 { width: 75%; float: left; } <div id="overall_div"> <div id="column_1"> ...random content... </div> <div id="column_2"> ...random content... </div> </div> Please note that that is the simplified code that I'm working with. Anyways, if column #1 is "taller" than column #2, than the border will show fine. However, if column #2 is taller than column #1, the border only reaches up to the point where column #1's content ends. Now, I'm aware that CSS is supposed to do this, but is there any workaround?
  10. Make sure the cookie name is correct.
  11. As people before you have said twice, that is not possible.
  12. Ok, thank you very much, Mad Techie and teng84. The last solution solved my problem. I appreciate all of your time.
  13. Ok, I tried that method, but that outputted no difference. To make sure, I've echo'ed the value of $IM within the loop, and it shows what it's supposed to show. Here's the updated code: <?php class template { var $template_root = './template'; var $output; function _include_template($filename) { ob_start(); include($this->template_root . '/' . $filename); $content = ob_get_contents(); ob_end_clean(); return $content; } function compile($filename) { $this->output = @file_get_contents($this->template_root . '/' . $filename); preg_match_all('#<!-- INCLUDE ([a-zA-Z0-9\_\-\+\./]+) -->#', $this->output, $include_matches); if(!empty($include_matches[1])) { foreach($include_matches[1] as $IM) { $this->output = preg_replace('#<!-- INCLUDE ([a-zA-Z0-9\_\-\+\./]+) -->#', $this->_include_template($IM), $this->output); } } echo $this->display(); } function display() { return $this->output; } } ?> I'm just guessing, but could the problem lie in the _include_template() function with the output buffering?
  14. I'm sorry for double-posting, but I'm still in need of help. I have tried other array functions, but most of them returns the same result.
  15. Can you please elaborate on that a bit more? I'm confused as to what you're implying.
  16. What I mean is this: Let's say I had the template file "index_body.html" (called from index.php). Then, in that template file, I include "index_2.html". So far, so good. But, if I include "index_3.html" or any other file below the first include statement, only "index_2.html" shows up within "index_body.html". That happens the number of include statements (stated in index_body.html) times.
  17. I have managed to build a small template class that can so far parse template variables. Now, to move one step further, I have begun to put in a template include part (includes separate templates within a template file). Here's what I have so far (only the include parts are shown): <?php class template { var $template_root = './template'; var $output; function _include_template($filename) { ob_start(); include($this->template_root . '/' . $filename); $content = ob_get_contents(); ob_end_clean(); return $content; } function compile($filename) { $this->output = @file_get_contents($this->template_root . '/' . $filename); // Locates all the include statements (looks like: <!-- INCLUDE some_file.html -->) preg_match_all('#<!-- INCLUDE ([a-zA-Z0-9\_\-\+\./]+) -->#', $this->output, $include_matches); if(!empty($include_matches[1])) { for($i = 0, $size = sizeof($include_matches[1]); $i < $size; $i++) { $this->output = preg_replace('#<!-- INCLUDE ([a-zA-Z0-9\_\-\+\./]+) -->#', $this->_include_template($include_matches[1][0]), $this->output); array_shift($include_matches[1]); } } echo $this->display(); } function display() { return $this->output; } } ?> If I include one file in a template file, the file shows up fine. However, if I include two or more files, the first file that was included in the template keeps on getting included over and over again. Does anyone see a problem with this code? Help will be much appreciated.
  18. I'm using the basic image functions like "imagecreatefrompng()" and "imagepng()" (but with customization in between). Oh, wait, now to come to think of it, I can use "imagepng()" to put it somewhere. Duh! Thanks, though.
  19. I have a script that generates an image based on users' inputs. How would I make it so that the script automatically uploads that image to a different folder on the server? I'm stumped on this one. Does anybody have any ideas?
  20. I already have a method of calculating the age by a given birthdate, but I have no idea how to do that in reverse. Here's my method on calculating the age by given birthdate: <?php function calculate_age($month, $day, $year) { global $month, $day, $year; $time = time(); $new_date = mktime(0, 0, 0, $month, $day, $year); $age = ($new_date < 0) ? ($time + ($new_date * -1)) : $time - $new_date; $year = 60 * 60 * 24 * 365; $return_age = $age / $year; return floor($return_age); } ?> But my question is how do you reverse this process so it outputs the birthdate?
  21. Eh, it doesn't filter these: fuck3d sh17 @ss @ssh013 b17ch but then, I don't know if it's supposed to filter "1337" words.
  • 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.