Welcome to Dream.In.Code
Become an Expert!

Join 149,515 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,347 people online right now. Registration is fast and FREE... Join Now!




Passing values

 
Reply to this topicStart new topic

Passing values

Pradeepk
24 Jun, 2007 - 09:37 PM
Post #1

New D.I.C Head
*

Joined: 22 Jun, 2007
Posts: 20


My Contributions
i have the following code written for creating menus in javascript.....


Menu1=new Array("Movies","http://","",4,30,140);
Menu1_1=new Array("Hindi","http://localhost/movie.php?id=Hindi","",0,30,140);
Menu1_2=new Array("Tamil","http://localhost/movie.php","",0,30,140);
Menu1_3=new Array("Telugu","http://","",0,30,0);
Menu1_4=new Array("Others","http://","",4,30,0);
Menu1_4_1=new Array("Punjabi","http://","",0,30,140);
Menu1_4_2=new Array("Gujarati","http://","",0,30,140);
Menu1_4_3=new Array("Malayalam","http://","",0,30,140);
Menu1_4_4=new Array("Kannada","http://","",0,30,0);

whenever the user clicks on hindi or telugu.....
how shld i pass the value(hindi or telugu) to the next page(movie.php).




User is offlineProfile CardPM
+Quote Post

DilutedImage
RE: Passing Values
24 Jun, 2007 - 09:48 PM
Post #2

D.I.C Addict
Group Icon

Joined: 20 Nov, 2006
Posts: 643



Thanked: 6 times
Dream Kudos: 25
My Contributions
movie.php?clicked=hindi
User is offlineProfile CardPM
+Quote Post

Pradeepk
RE: Passing Values
24 Jun, 2007 - 09:58 PM
Post #3

New D.I.C Head
*

Joined: 22 Jun, 2007
Posts: 20


My Contributions
QUOTE(DilutedImage @ 24 Jun, 2007 - 10:48 PM) *

movie.php?clicked=hindi


http://localhost/movie.php?clicked=Hindi

The value is being displayed in the above format in URL.But the thing is that we need to print that value in the page(Echoing).....


User is offlineProfile CardPM
+Quote Post

Pradeepk
RE: Passing Values
24 Jun, 2007 - 11:08 PM
Post #4

New D.I.C Head
*

Joined: 22 Jun, 2007
Posts: 20


My Contributions
QUOTE(Pradeepk @ 24 Jun, 2007 - 10:58 PM) *

QUOTE(DilutedImage @ 24 Jun, 2007 - 10:48 PM) *

movie.php?clicked=hindi


http://localhost/movie.php?clicked=Hindi

The value is being displayed in the above format in URL.But the thing is that we need to print that value in the page(Echoing).....



I Got It.....
User is offlineProfile CardPM
+Quote Post

DilutedImage
RE: Passing Values
25 Jun, 2007 - 12:00 AM
Post #5

D.I.C Addict
Group Icon

Joined: 20 Nov, 2006
Posts: 643



Thanked: 6 times
Dream Kudos: 25
My Contributions
Cool.

Also, if you want to pass more than one variable, then just separate them with an ampersand. ..

somepage.php?variable1=hello&variable2=world

User is offlineProfile CardPM
+Quote Post

Pradeepk
RE: Passing Values
25 Jun, 2007 - 09:33 PM
Post #6

New D.I.C Head
*

Joined: 22 Jun, 2007
Posts: 20


My Contributions
QUOTE(DilutedImage @ 25 Jun, 2007 - 01:00 AM) *

Cool.

Also, if you want to pass more than one variable, then just separate them with an ampersand. ..

somepage.php?variable1=hello&variable2=world



Thanks.......
User is offlineProfile CardPM
+Quote Post

ahmad_511
RE: Passing Values
25 Jun, 2007 - 09:48 PM
Post #7

D.I.C Regular
Group Icon

Joined: 28 Apr, 2007
Posts: 351



Thanked: 8 times
Dream Kudos: 400
My Contributions
Hi my freind
I saw something about echoing your select , if that's what you want here is what to do

in you movie.php
CODE

echo $_GET['checked'];// checked is the variable you send using "movie.php?checked=hindi" for example


You can use $_GET to recieve any variables sent to your php file using get method
And you will use $_POST when using post method

I hope this is what you need

Regards
User is offlineProfile CardPM
+Quote Post

Pradeepk
RE: Passing Values
25 Jun, 2007 - 10:59 PM
Post #8

New D.I.C Head
*

Joined: 22 Jun, 2007
Posts: 20


My Contributions
QUOTE(ahmad_511 @ 25 Jun, 2007 - 10:48 PM) *

Hi my freind
I saw something about echoing your select , if that's what you want here is what to do

in you movie.php
CODE

echo $_GET['checked'];// checked is the variable you send using "movie.php?checked=hindi" for example


You can use $_GET to recieve any variables sent to your php file using get method
And you will use $_POST when using post method

I hope this is what you need

Regards


\

Thanks.....i did it in tht way only....

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 08:01PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month