imarockstar Posted August 18, 2008 Share Posted August 18, 2008 I have a TEXTAREA form field ... and I need to display the text just how its pasted into the field . look at this link : http://franklinspirko.com/sites/dwf/resume_view.php?resumeid=18 the RESUME and COMMENTS should have paragraph breaks in them. I looked at the field in phpAdmin an the paragaph breaks are showing there ... here is my code : resume paste prompt Paste your Resume here <br> <textarea name=resume class=resume></textarea> viewing the resume <?php if ( $resumeid > 0) { //select the table $result = mysql_query("select * from resume where resumeid='$resumeid'"); } else { //select the table $result = mysql_query("select * from resume"); } //grab all the content while($r=mysql_fetch_array($result)) { //the format is $variable = $r["nameofmysqlcolumn"]; //modify these to match your mysql table columns $date =$r["date"]; $resumeid =$r["resumeid"]; $jobtitle =$r["jobtitle"]; $title =$r["title"]; $fname =$r["fname"]; $lname =$r["lname"]; $address =$r["address"]; $city =$r["city"]; $state =$r["state"]; $zipcode =$r["zipcode"]; $phone1 =$r["phone1"]; $phone2 =$r["phone2"]; $email =$r["email"]; $salary =$r["salary"]; $rate =$r["rate"]; $eligibility =$r["eligibility"]; $travel =$r["travel"]; $startdate =$r["startdate"]; $notice =$r["notice"]; $heard =$r["heard"]; $resume =$r["resume"]; $comments =$r["comments"]; ?> <h2 class=>Resume for <?=$title ?> <?=$fname ?> <?=$lname ?></h2> <div class=resumeinfo1> <h4 class=resumehead>Date Applied</h4> <span class=info><?=$date ?></span> </div> <div class=resumeinfo2> <h4 class=resumehead>Interested In</h4> <span class=info><?=$jobtitle ?></span> </div> <div class=resumeinfo3> <h4 class=resumehead>Start date</h4> <span class=info><?=$startdate ?></span> </div> <br class=clear> <div class=resumeinfo1> <h4 class=resumehead>Address</h4> <span class=info> <?=$address ?> </span> </div> <div class=resumeinfo2> <h4 class=resumehead>City,St,Zipcode</h4> <span class=info><?=$city ?>, <?=$state ?> <?=$zipcode ?></span> </div> <div class=resumeinfo3> <h4 class='resumehead body'>Phone 1 (<a onmouseover="tooltip.show('<?=$phone2 ?>', 200);" onmouseout="tooltip.hide();" href="">2</a>)</h4> <span class=info><?=$phone1 ?></span> </div> <br><br class=clear> <div class=resumeinfo1> <h4 class=resumehead>Desired Salary</h4> <span class=info><?=$salary ?></span> </div> <div class=resumeinfo2> <h4 class=resumehead>Desired Rate</h4> <span class=info><?=$rate ?></span> </div> <div class=resumeinfo3> <h4 class=resumehead>Eligibility</h4> <span class=info><?=$eligibility ?></span> </div> <br><br class=clear> <div class=resumeinfo1> <h4 class=resumehead>Start date</h4> <span class=info><?=$startdate ?></span> </div> <div class=resumeinfo2> <h4 class=resumehead>Will Travel</h4> <span class=info><?=$travel ?></span> </div> <div class=resumeinfo3> <h4 class=resumehead>Notice</h4> <span class=info><?=$notice ?></span> </div> <br><br class=clear> <h2 class=>Resume</h2> <?=$resume ?> <br><br> <h2 class=>Comments</h2> <?=$comments ?> Quote Link to comment https://forums.phpfreaks.com/topic/120267-displaying-text/ Share on other sites More sharing options...
DeanWhitehouse Posted August 18, 2008 Share Posted August 18, 2008 where you echo the textarea text do echo nl2br($textareatext); Quote Link to comment https://forums.phpfreaks.com/topic/120267-displaying-text/#findComment-619582 Share on other sites More sharing options...
Fadion Posted August 18, 2008 Share Posted August 18, 2008 Shouldnt attributes be wrapped in double quotes? this <textarea name="resume" class="resume"></textarea> instead of <textarea name=resume class=resume></textarea> Not that this gives you the problem, as Blade suggested how to fix it, but it's the right way of writing html. Quote Link to comment https://forums.phpfreaks.com/topic/120267-displaying-text/#findComment-619598 Share on other sites More sharing options...
DeanWhitehouse Posted August 18, 2008 Share Posted August 18, 2008 Yer , soz didnt read the code just said how to do it , but everything like that should be in tags unless numeric , then it doesnt really matter. Quote Link to comment https://forums.phpfreaks.com/topic/120267-displaying-text/#findComment-619604 Share on other sites More sharing options...
imarockstar Posted August 19, 2008 Author Share Posted August 19, 2008 ya I know about the ""'s .... I just get lazy sometimes i don't put them in for a few reasons .. but I am am doing code for a client or code that needs to be WC3 compliant then I will of-course code to the standards of the gods .. lol Quote Link to comment https://forums.phpfreaks.com/topic/120267-displaying-text/#findComment-620069 Share on other sites More sharing options...
imarockstar Posted August 19, 2008 Author Share Posted August 19, 2008 this is what I put and it displayed nothing ... <h2 class=>Resume</h2> <?= nl2br($textareatext) ?> Quote Link to comment https://forums.phpfreaks.com/topic/120267-displaying-text/#findComment-620072 Share on other sites More sharing options...
adam291086 Posted August 19, 2008 Share Posted August 19, 2008 what does the text look like in the database? is it correct there? Quote Link to comment https://forums.phpfreaks.com/topic/120267-displaying-text/#findComment-620079 Share on other sites More sharing options...
imarockstar Posted August 19, 2008 Author Share Posted August 19, 2008 ya it looks normal ... a crap load of text with a few paragraph breaks ... here is the link to the page http://franklinspirko.com/sites/dwf/resume_view.php?resumeid=18 the text should be displaying under the header RESUME here is a screen shot of the db .. http://franklinspirko.com/db.png Quote Link to comment https://forums.phpfreaks.com/topic/120267-displaying-text/#findComment-620091 Share on other sites More sharing options...
Fadion Posted August 19, 2008 Share Posted August 19, 2008 Your text looks fine, it has newlines, so nl2br() should correctly display them in the textarea. I usually prefer inserting html formatted content in db, so you can give it a shot and convert newlines (/n) to line breaks (< br />) or paragraphs. PS: By the way, the site looks pretty good Quote Link to comment https://forums.phpfreaks.com/topic/120267-displaying-text/#findComment-620101 Share on other sites More sharing options...
imarockstar Posted August 19, 2008 Author Share Posted August 19, 2008 thanks man .. ya I like the site .. its coming together .. lol .. but I think I am displaying the <?= nl2br($resume); ?> wrong ... I am not using an echo to display it ... this is what is being displayed ... <?= nl2br($resume); ?> that does not look correct, and, its not working lol .. so I think I am doing something wrong .. and when i say not working i mean it is not displaying anything at all ... like there is nothing in the db Quote Link to comment https://forums.phpfreaks.com/topic/120267-displaying-text/#findComment-620198 Share on other sites More sharing options...
lostprophetpunk Posted August 19, 2008 Share Posted August 19, 2008 Try making the '<?=' a '<?php' instead, as the first I have never seen as a PHP opening tag, only '<?php' and '<?'. Quote Link to comment https://forums.phpfreaks.com/topic/120267-displaying-text/#findComment-620204 Share on other sites More sharing options...
imarockstar Posted August 19, 2008 Author Share Posted August 19, 2008 I fixed it .. im a moron .. i copied and pasted your $textareatext var .. lol .. and didnt put my $resume one back in there . haha im a moron . thanks for solving this for me !!!! bobby Quote Link to comment https://forums.phpfreaks.com/topic/120267-displaying-text/#findComment-620206 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.