Forum Moderators: coopster

Message Too Old, No Replies

Appending random string

captcha code problem

         

kkonline

3:07 am on Sep 10, 2007 (gmt 0)

10+ Year Member



When i write


<?php echo "<img src='/includes/seccode.inc.php?randomString=' . md5(microtime()) . '' width='71' height='21' align='absmiddle'>"?></td>

to append a random string on the secure code (captcha script) in the SOURCE CODE i get

the following

<img src='/includes/seccode.inc.php?randomString=' . md5(microtime()) . '' width='71' height='21' align='absmiddle'></td>

rather than the actual value of randomstring which should be appended.

What is the problem with the code?

eelixduppy

3:34 am on Sep 10, 2007 (gmt 0)



It should be taken out of the quotes like this:

<?php echo "<img src='/includes/seccode.inc.php?randomString=" . md5(microtime()) . "' width='71' height='21' align='absmiddle'>"?></td>

kkonline

3:47 am on Sep 10, 2007 (gmt 0)

10+ Year Member



ya that worked! But i don't know why i always make those kind of mistakes... regarding concatenation or strings...

any good tutorial u'll suggest for it?

eelixduppy

3:56 am on Sep 10, 2007 (gmt 0)



You can read the documentation for strings [us2.php.net].