Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Building the querystring

From: Dynamic Dreamweaver Websites: Creating Login Areas

Video: Building the querystring

We now have our members' table setup to display all the information for each member that are stored in our database. So, we have this table setup to display all the users' information. The next step in this process is to take the user ID for a member and make it a hyperlink to the admin user update page and we need the user ID attached as a query string to that hyperlink.

Building the querystring

We now have our members' table setup to display all the information for each member that are stored in our database. So, we have this table setup to display all the users' information. The next step in this process is to take the user ID for a member and make it a hyperlink to the admin user update page and we need the user ID attached as a query string to that hyperlink.

So, in case none of that made sense to you, if you're new to all of this, don't worry. We'll walk through the process, and then I'll do a review once again, once we're done. So, how do we go about making this a hyperlink to the Admin User Update with some information attached to it? The first piece I'm going to do is delete that data that's presently in that area. So, I simply selected it and hit the Delete key. Now, that we have no information within this area, I'm going to add just an x x within there.

I just need some kind of information, so I can make it a hyperlink before we do this process. So, I typed in, it doesn't matter what you type, as long as you have a couple of characters in there, so it's easy to access. I'm going to make it a link down here, just by hitting the letter A. So, we're setting up a mock hyperlink first. So, I have this as a hyperlink now. If I click this area, you can see it's a hyperlink with just two letters. Now, I'm going to take that hyperlink and select that area. I'll go over to Split View to do that.

So, here is my hyperlink with the letter A. And here is my fake text. So, I'm going to select the fake text. Now, I'm going to go over to my Bindings panel and I'm going to say OK. Now that that hyperlink is selected, you can see my A is showing down in the link area. I want to attach something to it. And what we're going to attach is the user ID. Now that I have user ID chosen here, make sure ref shows up in this area. And that's why we made it a hyperlink first.

So, ref should be showing. In case it's not, there is a drop down list here, where you can choose it. So, ref is listed here. User ID is chosen and I click Bind. Now that I've done that, you can see my link area looks very different. Here it is in Code View. Now, it's a matter of setting up the text here to show the correct information. But we have attached the user ID as a hyperlink.

What I want to do now is within this area in the link, I'm going to hit the Home key. So, the Home key on your keyboard. It takes me to the very first character within the link area. You can see my cursor is now blinking right here. So, I'm going to type out where I want that hyperlink to go. And that is going to be adminuserupdate.php. Then I'm going to add a question mark. The question mark segregates the URL on the left-hand side of the question mark with the data on the right.

Now, Dreamweaver added that user ID information to create the user ID. We are going to say user ID, and make sure you were key sensitive. We need to type it out just like it is on our database. So, user ID equals, and whatever that number is. So, the rest of the code here, this piece here is going to be populated by Dreamweaver. I will hit enter or return to register that information and let me show it to you within Code View, it will be a little bit easier to see.

Here is our hyperlink, up in our code for that user ID. We now have them going to the userupdatepage.php. And we are attaching the user ID equals. And then, PHP will process out that number. Let's make sure that that really works. So, I'm going to put this in the browser. E-mail. I do have to type out and log in each time. Oops. I will put unique vacations.

I have to do it exactly as my member is in the database. Hit Tab and candice, all lowercase, is the password. Now, if you keep your Browser window open, you don't have to log in each time. Click Log In. You can see if I highlight over this, let me move this down a little, what you want to watch is this area of the page. As I highlight each one of these, you can see it says user ID equals and the number for that user ID, for each user. So, that information is all correct.

Now, we have x x representing that information right now. That's not exactly what we want to have to show to the user. So, what I can do instead of using x x, I can drag out user ID into this area. We have all of the information setup in order to do that. So, I'll click in Design View. Put my cursor in this area. And what I'm going to do is select user ID here. And that's what I want to insert into this area that shows.

Now, I can drag this information out into this area. So, if I click on it, I can drag it out. But because the x x is already showing, that becomes a bit of an issue. So, what we're doing is replacing this information with our user ID up here. Since it's already bound, it doesn't want to add, but notice if I click on it and drag it here into Code View, it's a little bit easier. So, what I did was replace the x x with this information. In case it doesn't work to drag it within the Design View, you can always select it and drag within Code View.

This should be fully functional now. Let's test it out. I did close my browser. So, I do have to log in. I'm getting very good at typing this. (LAUGH) The downside of setting up the log in section before you set up these types of areas is it does activate, you having to log in, in order to do your testing. I will click Log In. Now you can see each users' user ID is showing, within the table. If I click number 2, we only have a number 2. So, my page, somehow is eliminated when I dragged this out, and this is something to watch for.

It's not that big of deal to fix. Let me show you what happened. We have our user ID information. So, dreamweaver, or should I say, Dreamweaver created the code for PHP to be able to add the number. What we have lost is the page name. So, I simply need to add that once again. So, if you only see the number, don't panic it's working correctly. You just need to add the front portion of the page and build the rest of the query string.

So, I have adminuserupdate.php?userid=. That's the piece we had typed out when we had the x x as the code within the user ID. And that x x was the hyperlink. So, I hit Enter or Return to register that piece. Save my page. And I will go back out to the browser and log in to test this out.

Click Log In. Here is our information. Now, you can see, if you look down in this area, when I hover over this, it now says the page name along with the user ID. So, if I click on number 5, it takes me out to Admin User Update, attaching the user ID information. Now, we need to get this page using this user ID to query the database and populate our form. So that's the next piece of this process.

Show transcript

This video is part of

Image for Dynamic Dreamweaver Websites: Creating Login Areas
Dynamic Dreamweaver Websites: Creating Login Areas

43 video lessons · 1734 viewers

Candyce Mairs
Author

 
Expand all | Collapse all
  1. 1m 32s
    1. Welcome
      1m 32s
  2. 2m 57s
    1. Course overview
      1m 16s
    2. The course environment
      1m 41s
  3. 26m 58s
    1. Static vs. dynamic requests
      4m 8s
    2. Installing XAMPP on a Windows system
      8m 54s
    3. Installing MAMP on a Mac system
      4m 29s
    4. Using admin consoles
      3m 54s
    5. Installing the course files
      5m 33s
  4. 18m 36s
    1. Overview of the Dreamweaver interface
      6m 22s
    2. Setting up the course site
      6m 20s
    3. Previewing pages
      5m 54s
  5. 33m 38s
    1. Creating PHP pages
      5m 45s
    2. Adding PHP code
      5m 44s
    3. Displaying variables
      4m 45s
    4. Commenting your code
      5m 30s
    5. Working with includes
      5m 58s
    6. Building the course templates
      5m 56s
  6. 35m 13s
    1. What is a database?
      5m 2s
    2. Adding database tables
      7m 34s
    3. Connecting to the database
      8m 28s
    4. Getting data from a database: Part one
      8m 25s
    5. Getting data from a database: Part two
      5m 44s
  7. 1h 16m
    1. Planning the login process
      7m 25s
    2. Creating a login form
      7m 45s
    3. Adding form validation: Part one
      9m 22s
    4. Adding form validation: Part two
      1m 37s
    5. Exploring the registration page
      7m 17s
    6. Correcting table fields
      6m 1s
    7. Setting up the login landing page
      4m 1s
    8. Using server behaviors
      3m 36s
    9. Inserting new members
      8m 48s
    10. User authentication
      10m 3s
    11. Restricting access to pages
      5m 17s
    12. Testing the login
      4m 53s
  8. 1h 6m
    1. Admin area overview
      5m 9s
    2. Adding new users
      5m 19s
    3. Restricting access
      12m 25s
    4. Planning the admin update area
      5m 19s
    5. Building the members table listing
      6m 55s
    6. Building the querystring
      9m 14s
    7. Populating the update form
      6m 33s
    8. Updating the database data
      11m 28s
    9. Testing the admin update process
      3m 47s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ .

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Dynamic Dreamweaver Websites: Creating Login Areas.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member ?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferences from the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.