Simple HTML GET variable question

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
rhecker
Forum Contributor
Posts: 178
Joined: Fri Jul 11, 2008 5:49 pm

Simple HTML GET variable question

Post by rhecker »

I want to send two values to a new page using the GET method, but only the first one shows up. This is what I am doing:

<a href="student_print.php?student_id=<?php echo $user['student_id'];?>;course_id=<?php echo $course_id;?>">Print</a>

As you can see, I am trying to send the value of student_id and course_id to the page student_print.php. In the above code, I had separated the two values with a simicolon but I have also tried a comma and a space. No matter what I do, only the first value is sent. I am assuming that I can indeed send multiple values using GET.

Thoughts? Thanks.
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Simple HTML GET variable question

Post by califdon »

You would have saved yourself a lot of time and trouble by looking in the manual: the separator is the ampersand &.
rhecker
Forum Contributor
Posts: 178
Joined: Fri Jul 11, 2008 5:49 pm

Re: Simple HTML GET variable question

Post by rhecker »

Actually Califdon, I apparently wasted a lot of time and trouble by looking in the manual, as well as by doing a google search. So thanks for the answer. I appreciate it.

R
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Simple HTML GET variable question

Post by Benjamin »

rhecker wrote:Actually Califdon, I apparently wasted a lot of time and trouble by looking in the manual, as well as by doing a google search. So thanks for the answer. I appreciate it.

R
Well that's a bit sarcastic. It's not very hard to find a website with more than one get variable though.. ;)
Post Reply