Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening up hyperlink in new window PHP 1

Status
Not open for further replies.

richfield

IS-IT--Management
Jan 6, 2005
23
GB
Hi,

I want to try and open up a hyperlink in a new window and am having a little difficulty below is my code:

echo "<a href = 'get_landlord_details_unregistered.php?userID=" . $userID . "'>";


I have tried including target="_blank" but I get error messages can anyone point me in the right direction?, also what are the properties to control the size of the opened up browser, for the link?

Thanks

Rich
 
ok, what error messages aer you getting? If you are literally adding target="_blank" to the echo statement then it will cause a parse error. You would need to escape the opena dn close double quotes:

Code:
echo "<a href ='get_landlord_details_unregistered.php?userID=" . $userID . "' target=\"_blank\">";

Alternatively, just wrap the string in a single quote fo the echo statement so you can use double quotes in the HTML.

Code:
echo '<a href ="get_landlord_details_unregistered.php?userID=' . $userID . '" target="_blank">';

Either should do the trick!

Westbury

If it aint broke, redesign it!
 
Thanks, things are so simple when you know how!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top