473,418 Members | 2,039 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

link to a child window inside a php tag?

127 100+
this is my update link.
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. ...
  3. ...
  4. ...
  5. <a href='updatestatus.php?id=$id'>Update</a>
  6. ?>
  7.  
when i click the update link,updatestatus page should be open in a child window? how its Possible?
Jul 31 '10 #1
5 2862
Atli
5,058 Expert 4TB
Simplest version: (recommended)
- Right-click -> Open in new tab :)

Slightly less simple version:
- <a href="test.php" target="_blank">

Complex version: (not recommended!)
- <a href="javascript:void(0);" onclick="window.open('test.php')">


The reason why I recommend the manual version is because you really should try not to force your users to do things like open links in new windows. It should be their call whether they want it in a new window or not.

But then again, you may have an excellent reason why you want to force their hand, in which case I would recommend the second method. The target attribute will be "practically" equivalent to the JavaScript version in most browsers. That is; they will open both in a new tab rather than in a new window.

You can, however, use the window.open function to customize how the window will be displayed, so if you need that sort of functionality you should look into that.
Jul 31 '10 #2
impin
127 100+
@Atli
this is my code... plz help.
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. print "<tr>
  3. <td>$cname</td>
  4. <td><a href='mailto:$email'>$email</td>
  5. <td>$qual</td>
  6. <td>$skills</td>
  7. <td><img src='images/download.gif'>&nbsp;<a href='download.php?id=$filename'>$filename</a></td>
  8. <td><img src='images/email.png'>&nbsp;<a href='mailto:'>Forward</a></td>
  9. <td><img src='images/update.png'>&nbsp;<a href='updatestatus.php?id=$id'>Update</a></td>
  10. </tr>";
  11. ?>
  12. /
i want to open a small child window when i click the update link...
what u have suggested is not working inside the php print statement..... its shows parse error.
Aug 2 '10 #3
impin
127 100+
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. print "<tr>
  3. <td>$cname</td>
  4. <td><a href='mailto:$email'>$email</td>
  5. <td>$qual</td>
  6. <td>$skills</td>
  7. <td><img src='images/download.gif'>&nbsp;<a href='download.php?id=$filename'>$filename</a></td>
  8. <td><img src='images/email.png'>&nbsp;<a href='mailto:'>Forward</a></td>
  9. <td><img src='images/update.png'>&nbsp;<a href='updatestatus.php?id=$id'>Update</a></td>
  10. </tr>";
  11. ?>
  12.  
Aug 2 '10 #4
impin
127 100+
i want to open a child window when i click the update link which is inside the php print statment...

the code is

Expand|Select|Wrap|Line Numbers
  1. print "<tr>
  2. <td>$cname</td>
  3. <td><a href='mailto:$email'>$email</td>
  4. <td>$qual</td>
  5. <td>$skills</td>
  6. <td><img src='images/download.gif'>&nbsp;<a href='download.php?id=$filename'>$filename</a></td>
  7. <td><img src='images/email.png'>&nbsp;<a href='mailto:'>Forward</a></td>
  8. <td><img src='images/update.png'>&nbsp;<a href='updatestatus.php?id=$id'>Update</a></td>
  9. </tr>";
  10.  
plz help...
i tried html code inside print statement... i get parse error....

<a href="javascript:void(0);"
NAME="My Window Name" title=" My title here "
onClick=window.open("window-child.html","Ratting","width=550,height=170,0,stat us=0,");>link</a>
Aug 2 '10 #5
Atli
5,058 Expert 4TB
Did you just copy/paste that HTML, including the double quotes, into the PHP strings, which is delimited by double quotes?

Do you not see the logical fallacy there?

PHP can not tell the difference between a double-quote meant to close the string and a double-quote meant to be a part of the string. So if you want a double quote to be a part of a string, it needs to be escaped or the string need be delimited by single quotes.

Try reading through the string section of the tizag.com PHP tutorial. They explain this there.
Aug 2 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Xing Rong | last post by:
I have an asp page to authenticate users by checking their uid and password: --------------------------------------- If (request("UID") = "user" and request("Password") = "pwd") then...
9
by: Randell D. | last post by:
Folks, I'm working on a contact name/address database whereby a slimed down list is shown in the main window. When a record is selected, the complete record is displayed in a new window via a...
1
by: H2 | last post by:
Hi all, Any one know how to open a new windows in a child window using javascript? What I need to do is that, in my main page, there is a button, onclick, it opens one child windows. In the child...
8
by: mike | last post by:
I have a parent window where I open a child window. In that child window I have some js that creates a row in the parent window, it looks like: if ( self.opener.document.update ) { var...
2
by: swarnap | last post by:
The onUnload event is not triggered when the child window is closed using the 'X' button on the right hand top corner of the window. The onUnload works fine when the window is closed with the help of...
1
by: wlevins | last post by:
I have a simple script which has worked flawlessly for years - it copies a bit of data from a child window down into a form field in the parent window that opened the child. But now in Firefox 2.0...
5
by: chytanya | last post by:
Hi, I have a link in a window; on click of this link a child window is opened; the child window has frames in it; when i try to refresh the parent window from any of the frames in the child...
2
RamananKalirajan
by: RamananKalirajan | last post by:
Hi, I am creating a child window in a html page using window.open() on click of a link. I am minimizing that child window (not closing it). Again I am clicking the same link which opens that child...
1
by: btreddy | last post by:
Hii all.., I have one query not able to find a solution. I've one javascript page(parent)on which upon clicking one link it willopen one more page(child page). here my question is how to...
4
HaLo2FrEeEk
by: HaLo2FrEeEk | last post by:
I have an application that has 2 forms, a child and a parent. I want to make sure that the parent window can never be inside the child window in any way, so the code will need to check if any part...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.