Forum Moderators: coopster
<head>
<link rel="stylesheet" href="http://example.com/pbsbam/forums/templates/subSilver/subSilver.css"
type="text/css">
<script language="Javascript">
<!--
function selectAll(theField) {
var tempval=eval("document."+theField)
tempval.focus()
tempval.select()
therange=tempval.createTextRange()
therange.execCommand("Copy")
}
//-->
</script>
</head>
<body> <table width='100%'>
<form name='form'>
$tdcount = 1;
$numtd = 2; // number of cells per row
$idcheck = mysql_query("SELECT * FROM corners
ORDER BY `id` DESC LIMIT 4");
while($row = mysql_fetch_array($idcheck))
{
$imgurl = $row['imgurl'];
$name = $row['name'];
$id = $row['id'];
if ($tdcount == 1)
echo "<tr>";
echo "<td>
<center><img src='http://example.com/pbsbam/images/corners/" . $id . ".png' border='0'/><span class='gensmall'><br>"
. $name . "</span><br>
<a href='javascript:selectAll('form.area" . $id . "')>Select All</a><br>
<textarea rows='7' cols='48' name='area" . $id . "'>
<div style='position:absolute;
z-index:2;
right:0px;
top:0px'>
<a href='http://www.example.com'><img src='http://example.com/pbsbam/images/corners/" . $id . ".png'
border='0' alt='PBSbam.com'/>
</a></div>
</textarea>
<span class='gensmall'><br>Paste this code into you're ''About me'' on Myspace.<br></span>";
echo "___________</center><br><br></td>"; // display as you like
if ($tdcount == $numtd)
{
echo "</tr>";
$tdcount = 1;
} else {
$tdcount++;
}
}
if ($tdcount!= 1)
{
while ($tdcount <= $numtd) {
echo "<td> </td>";
$tdcount++; } echo "</tr>";
}
?>
</form>
</table>
I have a feeling the problem is on this line because my A hrefs always come out wrong like this:
javascript:selectAll(
I think i might have to use double quotes in the php somehow but i honestly havent gotten a clue
the link should be coming out
javascript:selectAll("form.area1")
[edited by: dreamcatcher at 11:12 am (utc) on Dec. 17, 2007]
[edit reason] use example.com / thanks [/edit]
<a href='http://www.example.com'><img src='http://example.com/pbsbam/images/corners/" . $id . ".png'
border='0' alt='example.com.com'/>
ALL HTML attributes need to have ", so you can use ' in the php to echo '...' if you want to avoid having to escape every ", but you cant use ' in your HTML.
[edited by: dreamcatcher at 11:12 am (utc) on Dec. 17, 2007]
[edit reason] use example.com / thanks [/edit]