Page 1 of 1

php pop up link please help!

Posted: Fri Oct 08, 2010 2:30 pm
by jemiBaker
hi guys! really need help here...
Can you help me link to pop up window inside in the php code <?php put a link to call pop up?.... ?>
the problem here is when I click the link it will just link to a new tab not pop window...please help
here is my code:

Code: Select all

echo "<th>Position</th>";
echo "<th>Name</th>";
echo "<th>Party</th>";
echo "<th colspan=2>Action</th>";

echo "</tr>";
$tempQuery2 = "Select c.*,s.* from tbluser s,tblCandidatesInfo c where c.fldCanId=s.fldIDNum and fldElecCode='$_REQUEST[reqID]' order by c.fldNum";
$resultTemp2 = mysql_query($tempQuery2) or die('Error: '.mysql_error ());
while ($row1 = mysql_fetch_array($resultTemp2)){
     echo "<tr>";
    
 echo "<td>" .$row1['fldPosName']. "</td>";
 echo "<td>" .$row1['fldFname']." ".$row1['fldMI']." ".$row1['fldLname']. "</td>";
 echo "<td>" .$row1['fldParty']. "</td>";

  echo "<td><a href='editCanPage.php?reqID='$row[fldElecCode]'  onclick='popUp(editCanPage.php,'console',400,200); return false;'  target='_blank'>".'Edit'."</a></td>";

 echo "</tr>";
}

Re: php pop up link please help!

Posted: Fri Oct 08, 2010 3:02 pm
by twinedev
if that is the exact code, then your problem is most likely an issue with the quotes in your onclick. You need to wrap the onclick setting with \" instead of a single quote.

-Greg

Re: php pop up link please help!

Posted: Fri Oct 08, 2010 6:01 pm
by loCode
Look at this .'Edit'., that does nothing.

Re: php pop up link please help!

Posted: Sun Oct 10, 2010 11:32 am
by s.dot
Your issue is definitely the quotes.
Review string concatenation.

Re: php pop up link please help!

Posted: Sun Oct 10, 2010 11:40 am
by jemiBaker
loCode wrote:Look at this .'Edit'., that does nothing.


how can you say that it does not do anything?...

Re: php pop up link please help!

Posted: Sun Oct 10, 2010 11:41 am
by jemiBaker
twinedev wrote:if that is the exact code, then your problem is most likely an issue with the quotes in your onclick. You need to wrap the onclick setting with \" instead of a single quote.

-Greg
hey greg..thanks for that!...but can you give me example for this concatenation...really appreciate your answer..

Re: php pop up link please help!

Posted: Sun Oct 10, 2010 11:46 am
by John Cartwright
It doesn't hurt to google for examples, but here are a couple quick string concatenations.

Code: Select all

$foo = 'my foobar string';
$foo .= ' just got a little longer';
$foo .= ' but guess what, it just got even longer';
echo $foo; //my foobar string just got a little longer but guess what, it just got even longer
Can be simplified to

Code: Select all

$foo = 'my foobar string' 
    . ' just got a little longer'
    . ' but guess what, it just got even longer';

Re: php pop up link please help!

Posted: Mon Oct 11, 2010 9:06 pm
by jemiBaker
hey guyz...thanks a lot!..I get it..

this is my code:

echo "<tr>";
echo "<td>" .$row1['fldCanId']. "</td>";
echo "<td>" .$row1['fldPosName']. "</td>";
echo "<td>" .$row1['fldFname']." ".$row1['fldMI']." ".$row1['fldLname']. "</td>";
echo "<td>" .$row1['fldParty']. "</td>";
?>


<td><a href="editCanPage.php?reqID=<?=$row1[fldCanId] ?>" onClick="return popup(this, 'notes')">Edit</a></td>
<?php