Search found 34 matches

by ronverdonk
Tue Aug 22, 2006 6:32 am
Forum: PHP - Code
Topic: How to close this "little" hole in my code?
Replies: 8
Views: 1506

I also found an entry at the Dutch PHP resource http://www.scriptsearch.com/cgi-bin/jump.cgi?ID=1796 <?php function prevent_multi_submit($type = "post", $excl = "validator") { $string = ""; foreach ($_POST as $key => $val) { // this test is new in version 1.01 to exclud...
by ronverdonk
Tue Aug 22, 2006 6:28 am
Forum: PHP - Code
Topic: How to close this "little" hole in my code?
Replies: 8
Views: 1506

Hack no. 55 (page 230).
by ronverdonk
Tue Aug 22, 2006 6:17 am
Forum: PHP - Code
Topic: How to close this "little" hole in my code?
Replies: 8
Views: 1506

I have the code for the prevention of double submits using a transaction identifier. It comes from the book "PHP Hacks" (O'Reilly). According to the preface I can give you the code. Because it is quite some code, I better not put it here in the forum, but can send it to your email. Send a ...
by ronverdonk
Tue Aug 22, 2006 5:58 am
Forum: PHP - Code
Topic: dynamically insert an HTML code in the file, before mailing
Replies: 7
Views: 1372

Remember that str_ireplace only works with PHP5!
by ronverdonk
Tue Aug 22, 2006 4:57 am
Forum: PHP - Code
Topic: How to close this "little" hole in my code?
Replies: 8
Views: 1506

This is not a so 'little' hole. You can have 2 reasons for preventing a double submit: 1. You don't want a user (or a web-robot) to be able to submit more times because it can flood you and is annoying. 2. you want to prevent it because e.g. an order has been placed and you don't want double orders....
by ronverdonk
Tue Aug 22, 2006 4:47 am
Forum: PHP - Code
Topic: dynamically insert an HTML code in the file, before mailing
Replies: 7
Views: 1372

Using str_replace or some other replacement function (think of case sensitivity) will do that:

Code: Select all

$MessMast = str_replace('</html>', $YourText.'</html>', $MessMast);
by ronverdonk
Tue Aug 22, 2006 4:17 am
Forum: PHP - Code
Topic: dynamically insert an HTML code in the file, before mailing
Replies: 7
Views: 1372

Now what is the question or the problem?
by ronverdonk
Tue Aug 15, 2006 10:05 am
Forum: PHP - Code
Topic: loading content into editor
Replies: 3
Views: 844

Just sent you some code that will accomplish what you are looking for. Because it is a little much (3 files) I sent them via separate mail.
by ronverdonk
Mon Aug 14, 2006 6:04 pm
Forum: PHP - Code
Topic: Noob's ignorance: Just basic php code question
Replies: 2
Views: 3690

Well, it is not so much a PHP question as an SQL question. You must have something that you can use to order your rows. E.g. if you are using an auto_increment key or a date of insertion of your table rows, you can use that by simply sorting on that column (let's call it your_sortable_field) DESCEND...
by ronverdonk
Tue Aug 08, 2006 5:25 pm
Forum: PHP - Code
Topic: Allow only <br>, <p>, and <a href in form ent
Replies: 2
Views: 1271

When you let users type data that you are echoing back, you'd better make sure that you validate everything! Have a look at the "Input filter" class at http://www.phpclasses.org/browse/package/2189.html . This class can filter input of stray or malicious PHP, Javascript or HTML tags and to...
by ronverdonk
Tue Aug 08, 2006 4:44 pm
Forum: PHP - Code
Topic: using php to perform http POST
Replies: 2
Views: 937

A good site to start cURL is http://curl.haxx.se/libcurl/php/ . A sample of what you are looking for is the following piece of code. One program does the POST, the other one is posted. Remember, it is just a sample I copied from the mentioned site, the way you have to adapt and use it is up to you! ...
by ronverdonk
Sat Aug 05, 2006 5:30 am
Forum: PHP - Code
Topic: poll management
Replies: 2
Views: 808

Look at the MiniPoll class at phpclasses.org, link http://www.phpclasses.org/browse/package/1453.html This package is meant to create online surveys. It lets you create Web based polls with a single question for which the users can only pick one answer of multiple answers. There is no limit of possi...
by ronverdonk
Fri Aug 04, 2006 7:47 am
Forum: PHP - Code
Topic: Dynamic Meta Title Proplem
Replies: 4
Views: 2917

Why do you start 3 threads on the same problem? Please stick to your original one.
by ronverdonk
Thu Aug 03, 2006 11:02 am
Forum: PHP - Code
Topic: Passing variables from php script to another
Replies: 3
Views: 785

If the one script does not call the other one directly, you can pass variables from one to the other via the session ($_SESSION vars). You need to start a session in each script and pass the var by copying it e.g. $_SESSION['myvariable'] = $var. The second script can then retrieve the variable by is...
by ronverdonk
Mon Jul 31, 2006 5:42 am
Forum: PHP - Code
Topic: Countdown between two dates
Replies: 23
Views: 3984

That is what the TIMEDIFF() function is for! Same MySql document chapter 12.5. Date and Time Functions.