Welcome to Tech Support Forum home to more then 136,000 problems solved. Issues have included: Spyware, Malware, Virus Issues, Windows, Microsoft, Linux, Networking, Security, Hardware, and Gaming Getting your problem solved is as easy as:
1. Registering for a free account
2. Asking your question
3. Receiving an answer

Registered members:
* Get free support
* Communicate privately with other members (PM).
* Removal of this message
* See fewer ads.
* And much more..

 



Want to know how to post a question? click here Having problems with spyware and pop-ups? First Steps
Go Back   Tech Support Forum > Design Forum > Web Design & Programming
User Name
Password
Site Map Register Donate Rules Blogs Mark Forums Read


Web Design & Programming Discussion of web design, and server-side & client-side scripting

Reply
 
LinkBack Thread Tools
Old 04-19-2008, 03:30 AM   #1 (permalink)
Registered User
 
Join Date: Apr 2008
Posts: 5
OS: Windows Vista Service Pack 1 (32 bit)


PHP new browser window ?

Hi,

I have a PHP page of the following structure :

if(condition is true)
{
echo "<html><--HTML Block1--></html>";
}
else
{
//condition is false
echo "<html><--HTML Block2--></html>";
}

I basically want the HTML Block1 to open up in the same browser window but HTML Block2 to open up in a new tab/window when the script is executed (the script is called by clicking on the "Submit Form" button of a webpage). Is this possible with PHP ? Tried to google.. no help :(

Thanx in advance...
abhinav_kishore is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Important Information
Join the #1 Tech Support Forum Today - It's Totally Free!

TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free.

Join TechSupportforum.com Today - Click Here

Old 04-19-2008, 11:50 AM   #2 (permalink)
Cymru am byth
 
DumberDrummer's Avatar
 
Join Date: Oct 2003
Location: Oregon
Posts: 5,385
OS: Windows XP Pro SP2

My System

Send a message via AIM to DumberDrummer Send a message via Yahoo to DumberDrummer
Re: PHP new browser window ?

Make HTML Block2 its own file, and throw in this javascript.
Code:
<script type="text/javascript">
window.open('URL of HTML Block2');
</script>
PHP is server side, so unfortunately I don't think it can create new windows, just render HTML out of the language.

Keep in mind too that firefox will block that new window javascript unless you put it in a button of some kind to prevent pop ups, but you said its a "Submit Form" button, so you should be just fine.
__________________

Living with Louie dog's the only way to stay sane
_____________________________________________

... and with those words so begins my lifetime of longing for the devil's warm embrace
DumberDrummer is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 04-20-2008, 12:02 PM   #3 (permalink)
Registered User
 
Join Date: Apr 2008
Posts: 5
OS: Windows Vista Service Pack 1 (32 bit)


Re: PHP new browser window ?

Quote:
Originally Posted by DumberDrummer View Post
Make HTML Block2 its own file, and throw in this javascript.
Code:
<script type="text/javascript">
window.open('URL of HTML Block2');
</script>
PHP is server side, so unfortunately I don't think it can create new windows, just render HTML out of the language.

Keep in mind too that firefox will block that new window javascript unless you put it in a button of some kind to prevent pop ups, but you said its a "Submit Form" button, so you should be just fine.
Hi DD,

Thanx for the response. But I have another concern. The "Submit" button of mine is getting some form data from the previous HTML page which is being processed by this PHP and displayed in HTML tables. If I create a different html file for the Block2, then I'll need to figure out some way of passing all these form values to that new page. Woudln't that be too cumbersome ?

Cheers...
abhinav_kishore is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 04-20-2008, 12:32 PM   #4 (permalink)
Cymru am byth
 
DumberDrummer's Avatar
 
Join Date: Oct 2003
Location: Oregon
Posts: 5,385
OS: Windows XP Pro SP2

My System

Send a message via AIM to DumberDrummer Send a message via Yahoo to DumberDrummer
Re: PHP new browser window ?

It may be, but I know of no way to get php to open up a new window.
__________________

Living with Louie dog's the only way to stay sane
_____________________________________________

... and with those words so begins my lifetime of longing for the devil's warm embrace
DumberDrummer is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -7. The time now is 02:01 PM.



Copyright 2001 - 2009, Tech Support Forum
Home Tips Plus | Outdoor Basecamp | Automotive Support Forum

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85