Jump to content

displaying text


imarockstar

Recommended Posts

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 ?>


 

 

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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  ;)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.