generating data in a browser page- 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
sauron98
Forum Newbie
Posts: 16
Joined: Mon Jun 30, 2003 1:42 pm

generating data in a browser page- please help

Post by sauron98 »

Hi All

Im still having this horrible problem...

currently when a user selects a cd image, the script calls a function, opens a window and presents the data in a preformated page heres the script:

function view(cd_id,cd_title,cd_image)
{
win1=window.open("view_cd_image.php?cd_id="+cd_id+"&cd_title="+cd_title+"&cd_image="+cd_image,"","width=650,height=250,top=100,bottom=100,left=100")
}


The problem is I need the data and the page 'view_cd_image.php' to be presented in a normal _blank browser window. Can anyone help me change this...ive tried everything.

Thanks a lot
Dan
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

If I understand you correctly, you want a "normal" browser-window with toolbar, menubar, statusbar etc.?

If so, use this

Code: Select all

function view(cd_id,cd_title,cd_image)
{
win1=window.open("view_cd_image.php?cd_id="+cd_id+"&cd_title="+cd_title+"&cd_image="+cd_image,"","width=650,height=250,top=100,bottom=100,left=100,toolbar=yes,menubar=yes,status=yes,location=yes")
}
P.S.: This is Javascript, not PHP - would have been better to post it in the client-side forum :)
sauron98
Forum Newbie
Posts: 16
Joined: Mon Jun 30, 2003 1:42 pm

still not working

Post by sauron98 »

Hi thanks very uch for that..yes youre right this is script..maybe i should have posted on the different forum...

I used that exactly...as quoted and its still throwing up a window with no status bar etc..

what i really want is to do is just have the data presented in a standard browser page..in a chosen frame...

excuse my ignorance
Dan
User avatar
liljester
Forum Contributor
Posts: 400
Joined: Tue May 20, 2003 4:49 pm

Post by liljester »

in a frame?

you need to tell the window where to open =)

window.open("URL", "window or frame name", "options");
User avatar
liljester
Forum Contributor
Posts: 400
Joined: Tue May 20, 2003 4:49 pm

Post by liljester »

tho ive never tried it in a frame.... the only other way i can think to do it is to just use a link with the TARGET attribute...

<A HREF="mypage.php" TARGET="frame name">link</A>

hope that helps
sauron98
Forum Newbie
Posts: 16
Joined: Mon Jun 30, 2003 1:42 pm

Post by sauron98 »

thanks mate

Ive tried to construct the line as you said...but just cant do it...im new to this

how would i corectly present the script above but adding the link attribute
cheers Dan
sauron98
Forum Newbie
Posts: 16
Joined: Mon Jun 30, 2003 1:42 pm

Post by sauron98 »

Can this:

function view(cd_id,cd_title,cd_image)
{
win1=window.open("view_cd_image.php?cd_id="+cd_id+"&cd_title="+cd_title+"&cd_image="+cd_image,"","width=650,height=250,top=100,bottom=100,left=100")
}

be changed to open in a articular frame and normal browser window?
cheers Dan
User avatar
liljester
Forum Contributor
Posts: 400
Joined: Tue May 20, 2003 4:49 pm

Post by liljester »

hrm... lemme check
User avatar
liljester
Forum Contributor
Posts: 400
Joined: Tue May 20, 2003 4:49 pm

Post by liljester »

below where you seen "FRAME NAME", replace that with the name of the frame you want the page to open in.

win1=window.open("view_cd_image.php?cd_id="+cd_id+"&cd_title="+cd_title+"&cd_image="+cd_image,"FRAME NAME","");

if that still isnt what you're after, ill have to see the page your working on... cause im not sure what you are trying to do =)
sauron98
Forum Newbie
Posts: 16
Joined: Mon Jun 30, 2003 1:42 pm

Post by sauron98 »

GREAT! for the first time it worked!!...ive been trying to sort this little problem for 2 days!

one more thing...how would add the page permissions to that line you gave me...i mean allow scroll bars etc...

cheers your the boss!
Post Reply