Jump to content

php/java problem


squiblo

Recommended Posts

<?php
$about_me_query = mysql_query("SELECT * FROM page_set_data WHERE username='$username'");

while ($row = mysql_fetch_assoc($about_me_query))
{
$about_me = $row['about_me'];
}

if (!$about_me)
{
$about_me = "";
$nothing = "Write about yourself";
}
?>
<script type="text/javascript">
function toggle_visibility(id)
{	
var div = document.getElementById(id);	
var text = document.getElementById("about_me_text");		

if(div.style.display == 'block' ) 
	{		
	div.style.display = 'none';		
	text.innerHTML = "<?php echo $nothing.$about_me; ?>";

	}	
	else 
	{		
	div.style.display = 'block';
	text.innerHTML = "<?php echo $about_error; ?><form action='' method='POST'><textarea cols='23' rows='6' name='textarea_about' id='textarea_about' style='font-family:arial;font-size:13px;overflow:hidden'><?php echo "$about_me";?></textarea><br><input type='submit' name='submit_about' value='Save'>   <input type='button' name='cancel_about' value='Cancel' onClick=\"window.location.href='content.php?content=myhub&myhub=mypage&mypage=mypage&cont=<?php echo $cont; ?>'\"></form>";	
	}
}
</script>

 

Whenever the variable name "$about_me" has any tags in it, the following like does not work...

 

<a href='#' onclick="toggle_visibility('about_me_popup');"><font color='CornflowerBlue'>Edit</font></a>

 

What am i doing wrong? Thanks

 

Link to comment
Share on other sites

slight change of plan.....

please visit this link and explain why the user has to click "edit" twise before the text changes, if i can resolve this, i believe i could solve my problem above.

 

 

www.squiblo.com/test.php

 

 

thanks

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.