PDA

View Full Version : passing variables in URL


titchlou
06-04-2003, 11:39 PM
hopefully somebody here can set me right here :p

I have made a member system/discussion board and it all works to the point where I need a link to add a reply to a subject. You can see the whole thing here (http://www.whatparentswant.co.uk/members2) (use test for user and password) then once in click on discussion boards, then board 1, pick any subject title and it'll list the messages in that subject (add subject works fine), at the bottom it has a link to add a message (a reply) this link needs to pass the subject id no, which obviously varies according to which subject you are reading, in the url.

I know I am carrying the variables across to this page (view_message.php) as I can echo them (above the messages table it gives the subject tilte and ID no) but I can not for the life of me work out how to make sure the correct ID is carried across to the next page with the add-message url link.

I am quite probably missing something really silly here ( it wont be the first time :rolleyes: )but would really appreciatte any help.

bjorn
06-05-2003, 02:47 AM
instad of linking to add_message.php, try linking to add_message.php?threadID=$id and then in the add_message.php script it will be accessible as $_GET['threadID'] - or stick it in the session?

hth

edit
(ooops, perl forum, dunno how variables work there, but you'll get the picture?)

titchlou
06-05-2003, 09:29 AM
oops my error should be in php forum :rolleyes: (no smilie for bluching furiously with embarassment - it was late :o ) - anybody able to move it to correct place?

I was trying that last night and it was having none of it, tried it in the sessions as well but that confused other stuff. Will try again now in case something else was wrong or I was just being supremely slow and thick since you suggest the same as i had thought the implication seems to be I was doing it right - it just wasn't working - hmmmmmm, I'll keep trying - I will get there.

Thank you!