inferium Posted March 4, 2009 Share Posted March 4, 2009 Hi everyone, I've got a slight problem: When I use rawurlencode as such echo '<img src="http://dbc.eliteautoweb.com/cars/'.rawurlencode($row['cphoto']).'" style="width: 300px;" />'; It works on the actual outputted html, but in the textarea I have at the bottom of the page it only shows up as a space. Does anyone know of a way to fix this? http://clearfrontmarketing.com/createflyer/dbc/index.php Link to comment https://forums.phpfreaks.com/topic/148008-solved-rawurlencode-doesnt-work-in-textarea/ Share on other sites More sharing options...
kenrbnsn Posted March 4, 2009 Share Posted March 4, 2009 Please show us the code that's not working. Ken Link to comment https://forums.phpfreaks.com/topic/148008-solved-rawurlencode-doesnt-work-in-textarea/#findComment-776820 Share on other sites More sharing options...
inferium Posted March 4, 2009 Author Share Posted March 4, 2009 Ah, my bad. Here's the full code of the textarea (which is just a repeat of what's on the page). <TEXTAREA ROWS="20" COLS="70" ID="textarea" READONLY="yes"> <CENTER> <TABLE> <TR> <TD ALIGN="CENTER"> <A HREF="http://www.directbankcredit.com/apply/index.php"><IMG SRC="http://i428.photobucket.com/albums/qq2/onebigredfish/dbcbannerbadcred.gif" BORDER="0"></A> </TD> </TR> <TR> <TD> <TABLE WIDTH="600" STYLE="border:solid 4px #000000;background-color:#f8f8f8"> <TR> <TD> <TABLE WIDTH="600" HEIGHT="20" BORDER="0" CELLPADDING="0"> <TR> <TD style="color:#f0f0f0;background-color:#000000"> <FONT SIZE="5"><b>'.$row['ctitle'].'</b></FONT></TD> </TR> <TR> <TD> <FONT SIZE="4"><b>'.$row['cslogan'].'</b></FONT> </TD> </TR> </TABLE> </TD> </TR> <TR> <TD> <TABLE> <TR> <TD WIDTH="310" ALIGN="center"> '; if($row['cphoto'] == '') { echo '<img src="http://dbc.eliteautoweb.com/nophoto.gif" />'; } elseif($row['cphoto'] != '') { echo '<img src="http://dbc.eliteautoweb.com/cars/'.rawurlencode($row['cphoto']).'" style="width: 300px;" />'; } echo ' </TD> <TD VALIGN="top" WIDTH="290"> <TABLE width="100%" HEIGHT="1" style="background-color:#000000;color:#f0f0f0"><TR><TD><CENTER><b>Features:</b></CENTER></TD></TR></TABLE> <table> <tr> <td style="width: 120px"><b>Make:</b></td> <td><b>'.$row['cmake'].'</b></FONT></td> </tr> <tr> <td style="width: 120px"><b>Year:</b></td> <td><b>'.$row['cyear'].'</b></FONT></td> </tr> <tr> <td style="width: 120px"><b>Model:</td> <td><b>'.$row['cmodel'].'</b></td> </tr> <tr> <td style="width: 120px"><b>Body Style:</td> <td><b>'.$row3['btype'].'</b></td> </tr> <tr> <td style="width: 120px"><b>Exterior Color:</td> <td><b>'.$row['cextcol'].'</b></td> </tr> <tr> <td style="width: 120px"><b>Interior Color:</td> <td><b>'.$row['cintcol'].'</b></td> </tr> <tr> <td style="width: 120px; height: 22px;"><b>Condition:</td> <td style="height: 22px"><b>'.$row['ccondition'].'</b></td> </tr> <tr> <td style="width: 120px; height: 7px;"><b>Drive Type:</td> <td style="height: 7px"><b>'.$row4['dtype'].'</b></td> </tr> </table> </TD> </TR> </TABLE> <TD> </TR> <TR> <TD> <TABLE> <TR> <TD VALIGN="top"> <TABLE> <TR> <TD><b>Location:</TD><TD><b>'.$row['clocation'].'</b></TD> </TR> <TR> <TD><b>Asking Price:<b></TD><TD><b>'.$row['cprice'].'</b></TD> </TR> </TABLE> <table width="305"> <tr> <td HEIGHT="18" ALIGN="center" style="background-color:#000000;color:#f0f0f0"><B>Contact Information:</B></td> </tr> <tr> <td valign="top" HEIGHT="100%"><B>'.$row['caddress'].'</B><br /><FONT COLOR="black"><B>Phone: '.$row['cphone'].'</B></FONT><br /> <br /><A HREF="http://www.directbankcredit.com/apply/index.php"><IMG SRC="http://i428.photobucket.com/albums/qq2/onebigredfish/dbcbannerbadcred.gif" WIDTH="300" HEIGHT="45" BORDER="0"></A> </td> </tr> </table> </TD> <TD><table height="320" VALIGN="top" BORDER="0"> <tr> <td HEIGHT="1" align="center" VALIGN="top" BGCOLOR="black" style="background-color:#000000;color:#f0f0f0"><b>Attributes:</b></FONT></td> </tr> <tr VALIGN="top"> <td valign="top" VALIGN="top" style="height: 292px"><b>Special Financing:</b> <table style="width: 100%" VALIGN="top"> <tr> <td bgcolor="#C0C0C0"><small>'.$row['cext'].'</small></td> </tr> </table> <table style="width: 100%"> </table> <br /><b>Accessories:</span></b> <table style="width: 100%"> <tr> <td bgcolor="#C0C0C0"><small>'.$row['caccess'].'</small></td> </tr> </table> </td> </tr> </table> </TD> </TR> </TABLE> </TD> </TR> </TABLE> </TD> </TR> </TABLE> </CENTER></TEXTAREA> Link to comment https://forums.phpfreaks.com/topic/148008-solved-rawurlencode-doesnt-work-in-textarea/#findComment-776823 Share on other sites More sharing options...
kenrbnsn Posted March 4, 2009 Share Posted March 4, 2009 I'm not sure what you're trying to do, but that does not look like valid HTML -- putting HTML tags inside a <textarea> Ken Link to comment https://forums.phpfreaks.com/topic/148008-solved-rawurlencode-doesnt-work-in-textarea/#findComment-776828 Share on other sites More sharing options...
inferium Posted March 4, 2009 Author Share Posted March 4, 2009 Well, what I've been trying to do is make the html code copy/paste-able so that we can post the advertisements on craigslist and such. Just to save the hassle of view:source every single ad. Is there a more efficient way to achieve this effect through php? Link to comment https://forums.phpfreaks.com/topic/148008-solved-rawurlencode-doesnt-work-in-textarea/#findComment-776830 Share on other sites More sharing options...
kenrbnsn Posted March 4, 2009 Share Posted March 4, 2009 What you probably want to do is integrate a wysiwyg editor into your code. Most of the ones I've seen are Javascript based like TinyMCE or NicEdit. There are many others -- just search in Google. Ken Link to comment https://forums.phpfreaks.com/topic/148008-solved-rawurlencode-doesnt-work-in-textarea/#findComment-776839 Share on other sites More sharing options...
inferium Posted March 4, 2009 Author Share Posted March 4, 2009 Sweet thanks! Also, I finally got the rawurlencode function to work. I'm not sure exactly what I did, but for some reason it seems to function just right now. I'll look into wysiwyg editors promptly though, thank you for the tip Link to comment https://forums.phpfreaks.com/topic/148008-solved-rawurlencode-doesnt-work-in-textarea/#findComment-776843 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.