Skip to main content
Participating Frequently
June 27, 2011
Answered

Sending an id to the next page

  • June 27, 2011
  • 1 reply
  • 1033 views

Hi,

Need more assistance please. Ok so I've created this database driven site. Everything works perfectly but when my pages redirect it does not send the id value to the next page if i add "?id=5" manually in the browser address bar then it displays the correct details for that particular id. How do I use dreamweaver to send the valuefor me so that the site functions correctly? Do I have to physically code the php or is there a Dreamweaver function that can do this for me?

Please can you assist.

Thanks,

Owen

This topic has been closed for replies.
Correct answer

Thanks Shocker, but question remains. How do I do that?


Owen,

Provide your query for a more thorough recommendation. Shooting in the dark is not desired by volunteer contributors of this forum. Ideally the session for user id should be created upon login, not defined based off the result of a query later on.

You wrote:

So what I want to do is once a user registers on the register page the page needs to redirect to a success page and have a message "Thanks User X for registering."

You can also do this by simply echoing the post value on registration success page of the username 'name' that was 'named' whatever in the registration form. If registration form field for username is named username then echo on success page by entering this php

Thanks <?php echo $_POST['username']; ?> for registering.

Post values only survive the duration of one pageload. After that they are destroyed. So if you want to retain the data to display later on then you must create a session variable for the post value. Google the term how to create session variable or similar term and you will undoubtedly find countless resources that completely explain the process.

Keep in mind that by default Dreamweaver login server behavior automagically creates SESSION['MM_Username'] for the username of the logged in user. Simply echo the SESSION['MM_Username'] to display the username for the logged in user.

Look here: http://cookbooks.adobe.com/post_Display_user_s_name_and_other_details_after_login-16672.html

best,

Shocker

1 reply

Participating Frequently
June 27, 2011

Need more info. What server behaviour are you working with? In some, there is a checkbox that you can select to pass a value in the querystring.

What does this ID represent in your application?

Participating Frequently
June 27, 2011

The "id" is the auto-increment primary key which I want to use to identify users on the site. It is automatically created and users cannot edit the id field. So what I want to do is once a user registers on the register page the page needs to redirect to a success page and have a message "Thanks for registering."

The site redirects to the success page but it does not send the user data across. Once I manually edit in the address field by typing, "?id=2" then it does bring up the data for user where id = 2. I want dreamweaver to send that "id =2" automatically to the browser address bar.

June 27, 2011

Your method is a bad idea for at least two reasons: 1. it adds parameter to the URL, which = ugly. 2. Without additional coding anyone can change the URL parameter to see other results.

Preferred method is to create a session variable for logged in user id then filter your query where session = id, not URL parameter.

best,

Shocker