Forum Moderators: coopster

Message Too Old, No Replies

passing parameters via the url

         

mysterious guy

10:33 am on Dec 15, 2004 (gmt 0)

10+ Year Member



hello,
i've just started studying php and n need help.
I am trying to pass 2 parameters via the url when calling a php script. I coded as follows:

echo "[ <a href=\"ajouter.php?id=$bookid?prix=$price\">Add</a> ] ";

it doesn't work.the values of '$bookid' and '$price' are concatenated together..

Thx

topr8

10:40 am on Dec 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



ajouter.php?id=$bookid&prix=$price

mysterious guy

10:58 am on Dec 15, 2004 (gmt 0)

10+ Year Member



Thxs topr8 for seeing the bug..

In fact i'm new to php..n would need your help quite often!It's been less than 30 mins that i registered to webmasterworld.Its amazing how quick I got my answer.

Thx again!

Hester

11:49 am on Dec 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can also do away with the variable names and the ampersand altogether!

[webmasterworld.com...]

coopster

12:58 pm on Dec 15, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, mysterious guy.

A GET query string is appended to the URI with a question-mark ("?") as separator and name=value pairs are separated by the ampersand ("&").