john010117
Members-
Posts
492 -
Joined
-
Last visited
Never
Everything posted by john010117
-
Expanding on that, it's used primarily by JavaScript for identifying specific fields in the form.
-
First problem I saw: use: if(insert_order($_POST)!==false) instead of: if(insert_order($_POST)!=false)
-
Why would you want to remove it? You should give credit to the people who built the script.
-
Contact your host.
-
setcookie() And do a simple if/else statement to see if the cookie is set.
-
error_reporting(E_ALL); turns the error reporting on. Put that at the very top of your script.
-
First of all, make sure your server has a mail server installed.
-
http://www.DebateATopic.com - Now Live!
john010117 replied to clanstyles's topic in Beta Test Your Stuff!
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". -
[SOLVED] can't make the simplest PHP work!!!
john010117 replied to starscream.pt's topic in PHP Coding Help
View source. Does it output the full PHP code? Then you need a webserver. WAMP is good for Windows. -
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?
-
Make sure the cookie name is correct.
-
As people before you have said twice, that is not possible.
-
[SOLVED] Help with template class - include statements
john010117 replied to john010117's topic in PHP Coding Help
Ok, thank you very much, Mad Techie and teng84. The last solution solved my problem. I appreciate all of your time. -
[SOLVED] Help with template class - include statements
john010117 replied to john010117's topic in PHP Coding Help
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? -
[SOLVED] Help with template class - include statements
john010117 replied to john010117's topic in PHP Coding Help
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. -
[SOLVED] Help with template class - include statements
john010117 replied to john010117's topic in PHP Coding Help
Can you please elaborate on that a bit more? I'm confused as to what you're implying. -
[SOLVED] Help with template class - include statements
john010117 replied to john010117's topic in PHP Coding Help
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. -
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.
-
[SOLVED] Uploading a dynamically-generated image
john010117 replied to john010117's topic in PHP Coding Help
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. -
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?
-
[SOLVED] Calculating birthdate by given age
john010117 replied to john010117's topic in PHP Coding Help
Ok, thanks. -
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?
-
None of the links work...
-
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.
-
I can relate to that many times.