php pop up link please help!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jemiBaker
Forum Newbie
Posts: 4
Joined: Fri Oct 08, 2010 2:23 pm

php pop up link please help!

Post 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>";
}
Last edited by Benjamin on Fri Oct 08, 2010 2:47 pm, edited 1 time in total.
Reason: Added [syntax=php] tags.
User avatar
twinedev
Forum Regular
Posts: 984
Joined: Tue Sep 28, 2010 11:41 am
Location: Columbus, Ohio

Re: php pop up link please help!

Post 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
loCode
Forum Newbie
Posts: 9
Joined: Fri Oct 08, 2010 2:24 am

Re: php pop up link please help!

Post by loCode »

Look at this .'Edit'., that does nothing.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Re: php pop up link please help!

Post by s.dot »

Your issue is definitely the quotes.
Review string concatenation.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
jemiBaker
Forum Newbie
Posts: 4
Joined: Fri Oct 08, 2010 2:23 pm

Re: php pop up link please help!

Post by jemiBaker »

loCode wrote:Look at this .'Edit'., that does nothing.


how can you say that it does not do anything?...
jemiBaker
Forum Newbie
Posts: 4
Joined: Fri Oct 08, 2010 2:23 pm

Re: php pop up link please help!

Post 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..
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: php pop up link please help!

Post 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';
jemiBaker
Forum Newbie
Posts: 4
Joined: Fri Oct 08, 2010 2:23 pm

Re: php pop up link please help!

Post 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
Post Reply