stupid little syntax error - javascript and php

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

User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

No sorry I don't have any of those.... got any other ideas on how to do what I'm trying to accomplish...

All I want to do is have the picture be a link, and pass the variables to picture.php.. simple enough .. rigte?
User avatar
andre_c
Forum Contributor
Posts: 412
Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah

Post by andre_c »

Your using internet explorer right? Try double-clicking on error on page at the bottom left and tell me what the error is (you're getting an error on page right?)
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

it sais syntax error ! thats it...........
line 13 which is this line
User avatar
andre_c
Forum Contributor
Posts: 412
Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah

Post by andre_c »

can you post your new code?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Code: Select all

<a href="javascript:window.open("picture.php?<? echo "type=$type&picture=$picture&title=$title"; ?>", ","Picture Viewer","toolbar=0,status=0,menubar=0,scrollbars=no,resizable=no");> <img src=" <? echo "portfolio/$type/$picture"; ?>" width="450" height="410" border="1"></a>
Same as before.. no changes
User avatar
andre_c
Forum Contributor
Posts: 412
Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah

Post by andre_c »

I thought you changed it to href='#' onclick='window.open etc

... also you have

Code: Select all

, ",  
// needs to be
, "",
// actually i think it just needs to be
,
Last edited by andre_c on Mon Mar 22, 2004 10:33 pm, edited 1 time in total.
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

Try:

<a href="javascript:window.open('picture.php?<? echo "type=$type&picture=$picture&title=$title"; ?>', 'Picture Viewer','toolbar=0,status=0,menubar=0,scrollbars=no,resizable=no');"> <img src=" <? echo "portfolio/$type/$picture"; ?>" width="450" height="410" border="1"></a>
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Oh yea..... I changed it back because I was getting the link

http://www.domain.com/page.php?variable=398293# and was only returning the page to the top.. without any errors.....

I just was checking the errors for u

Code: Select all

<a href="#" onclick="window.open("picture.php?<? echo "type=$type&picture=$picture&title=$title"; ?>", ","Picture Viewer","toolbar=0,status=0,menubar=0,scrollbars=no,resizable=no");> <img src=" <? echo "portfolio/$type/$picture"; ?>" width="450" height="410" border="1"></a>
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Mark: on mouseover that actually shows the proper link witha ll the variables etc etc

but when clicked on gives the error: Invalid Argument :S
User avatar
andre_c
Forum Contributor
Posts: 412
Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah

Post by andre_c »

did you fix this

Code: Select all

...ure&title=$title"; ?>", ","Picture...

to this

...ure&title=$title"; ?>" ,"Picture...
and add a " right before closing the onclick (or href, wherever you're doing it)
Last edited by andre_c on Mon Mar 22, 2004 10:42 pm, edited 1 time in total.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Code: Select all

<a href="javascript:window.open('picture.php?<? echo "type=$type&picture=$picture&title=$title"; ?>', 'Picture Viewer','toolbar=0,status=0,menubar=0,scrollbars=no,resizable=no');"><img src=" <? echo "portfolio/$type/$picture"; ?>" width="450" height="410" border="1"></a>
yes.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

K I changed it to this and it is working fine except when I click on the picture and the popup appears fine, the original page reloads and it blank except for it sais [object].. jsut a white page that sais [object]

this is the new code I used

Code: Select all

<a href="javascript:window.open('picture.php?<? echo "type=$type&picture=$picture&title=$title"; ?>',toolbar='0',status='0',menubar='0',scrollbars='no',resizable='no');"><img src=" <? echo "portfolio/$type/$picture"; ?>" width="450" height="410" border="1"></a>
I change to onclick thing and it seems to be working fine.. thanks guys
User avatar
andre_c
Forum Contributor
Posts: 412
Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah

Post by andre_c »

I think i figured out what was wrong, it seems to work for me if i get rid of the space in Picture Viewer:
Picture_Viewer

hope that helps
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

A bit late... and that was PART of the problem.. thanks again for ur help :)
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Code: Select all

<? $size= getimagesize("portfolio/$type/$picture");
?>
<a href="#" onclick="window.open('picture.php?<? echo "type=$type&picture=$picture&title=$title"; ?>',width='<? echo "$size[0]"; ?>',toolbar='0',status='0',menubar='0',scrollbars='no',resizable='no',width='<? echo "$size[1]"; ?>');"><img src=" <? echo "portfolio/$type/$picture"; ?>" width="450" height="410" border="1"></a>
The problem is that no matter what I change any of the variables in the javascript... height... scrollbar....resizable... anything is does not take effect. The width is always the same.. height... no scroll.. non resizable even if I set them to TRUE.
Post Reply