Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

Conditional "target=_blank" ?

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Watch

dabb

Established Member
Impact
7
I have a form and 90% of the time I want the results to pop up in a new browser window. However, sometimes under certain circumstances I want the results to go ahead and appear in the current window instead of opening a new browser window. Is there any way to implement this sort of conditional browser window control in the forms action PHP file?

Thanks!
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
I am not sure how easy this would be to implement into your script, but something like this would work.

PHP:
<?php if ($value == true): ?>

<a href="link.html" target="_blank">link</a>

<?php else: ?>

<a href="link.html">link</a>

<? php endif; ?>

Hope that helps. :)
 
0
Close
The problem is that it is form results that I either want to show in a new window (ie: show a page from another website in a new window leaving the form on my site in the original window), or redisplay the form in the same window with an error message if bogus parameters are entered.

So I need to make this decision on the fly from the forms action script.
 
0
Close
Appraise.net

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back