onekoolman Posted June 8, 2006 Share Posted June 8, 2006 Heres the code:[code]<?phpif($_POST['$value'] == 'a' || 'b' || 'c' || 'd' || 'e' || 'f' || 'g' || 'h' || 'i' || 'j' || 'k' || 'l' || 'm' || 'n' || 'o' || 'p' || 'q' || 'r' || 's' || 't' || 'u' || 'v' || 'w' || 'x' || 'y' || 'z')echo "<img src='http://www.domain.com/styles/1/images";echo "/";echo "$value";echo ".gif'>";?>[/code]Is there a way, so that ANY time a letter is typed in a textarea it is posted as an image? If theres a space I want blank.gif to display.Example:"I Type This"I want: (To be displayed)[code]<img src="http://www.domain.com/styles/1/images/i.gif"><img src="http://www.domain.com/styles/1/images/blank.gif"><img src="http://www.domain.com/styles/1/images/t.gif"><img src="http://www.domain.com/styles/1/images/y.gif"><img src="http://www.domain.com/styles/1/images/p.gif"><img src="http://www.domain.com/styles/1/images/e.gif"><img src="http://www.domain.com/styles/1/images/blank.gif"><img src="http://www.domain.com/styles/1/images/t.gif"><img src="http://www.domain.com/styles/1/images/h.gif"><img src="http://www.domain.com/styles/1/images/i.gif"><img src="http://www.domain.com/styles/1/images/s.gif">[/code]The form[code]<form action="post.php" method="POST"><text area name="value" rows="50" cols="10"></textarea></form>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/11499-php-postecho-help/ Share on other sites More sharing options...
.josh Posted June 8, 2006 Share Posted June 8, 2006 [code]<?php $blah = "I type this"; $blah = strtolower($blah); $letters = preg_split('//', $blah, -1, PREG_SPLIT_NO_EMPTY); foreach ($letters as $val) { if ($val == " ") { $val = "blank"; } echo "<img src='http://www.domain.com/styles/1/images/".$val.".gif'>"; }?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/11499-php-postecho-help/#findComment-43250 Share on other sites More sharing options...
SharkBait Posted June 8, 2006 Share Posted June 8, 2006 I know its a bit more advanced but you can get PHP's GD2 to 'draw' the letter as an image for you.I dont have the code in front of me, but thats how those Captcha (security code images) work. Quote Link to comment https://forums.phpfreaks.com/topic/11499-php-postecho-help/#findComment-43251 Share on other sites More sharing options...
onekoolman Posted June 8, 2006 Author Share Posted June 8, 2006 Wow, fast reply, and it works, thank you very much. Quote Link to comment https://forums.phpfreaks.com/topic/11499-php-postecho-help/#findComment-43253 Share on other sites More sharing options...
onekoolman Posted June 8, 2006 Author Share Posted June 8, 2006 I am having trouble getting $blah from the form, (Im a noobie) Quote Link to comment https://forums.phpfreaks.com/topic/11499-php-postecho-help/#findComment-43263 Share on other sites More sharing options...
.josh Posted June 8, 2006 Share Posted June 8, 2006 [code]<?php $blah = $_POST['example']; //$blah = "I type this"; $blah = strtolower($blah); $letters = preg_split('//', $blah, -1, PREG_SPLIT_NO_EMPTY); foreach ($letters as $val) { if ($val == " ") { $val = "blank"; } echo "<img src='http://www.domain.com/styles/1/images/".$val.".gif'>"; }?><form action="<?= $PHP_SELF ?>" method="POST"> example: <input type='text' name='example'><input type='submit'></form>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/11499-php-postecho-help/#findComment-43268 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.