How to pass array to new window without form

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
shahzad429
Forum Newbie
Posts: 8
Joined: Mon Mar 03, 2008 12:39 pm

How to pass array to new window without form

Post by shahzad429 »

I am working on search result page where all the thumbnail will display and its working fine.

but what my boss wants is when user click on any thumbnail a new window will open with the product image and next and prev button

so that user will navigate search result through new window

so how i can pass all the ID to new window so that this funtionality can be done


thanks in advance..
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: How to pass array to new window without form

Post by VladSun »

Use GET:

newwin.php?id1=453543&id2=5435&id3=543543
There are 10 types of people in this world, those who understand binary and those who don't
xtiano77
Forum Commoner
Posts: 72
Joined: Tue Sep 22, 2009 10:53 am
Location: Texas

Re: How to pass array to new window without form

Post by xtiano77 »

I just read about this very thing a few days ago in the PHP Certification book and this is what I saw:

http://www.yoursiteaddress.com?items[]= ... =whatever3

The outcome will be:

Code: Select all

$_GET[“items”][0] = “whatever1”;
$_GET[“items”][1] = “whatever2”;
$_GET[“items”][2] = “whatever3”;
You do not have to worry about indexing the array because PHP does that automatically for you.

Hope this helps.
Post Reply