Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Aug 2005
    Posts
    365
    Thanks
    7
    Thanked 1 Time in 1 Post

    Question How to pass info with URL

    I have a list of some books. I want when somebody clicks any of the book, the next page should display its contents & the URL in the address bar should b like this...

    http://mysite.com/book.htm?id=123&name=abc

    Please somebody tell me how can I pass Book's ID & NAME with URL??????

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Query string

    This sort of thing is typically used with server side scripting, although you could hand-code all the links of course. You'd still need some form of processing on the side of the page these links point to; this could be done using JavaScript, but then all the information of all of the books has to be available on this page.

    It would make more sense to store this information on the server somehow and use a server side script to process the query string, pull the desired information and create a result page.
    Regards,
    Ronald.
    ronaldvanderwijden.com

  • #3
    Regular Coder
    Join Date
    Aug 2005
    Posts
    365
    Thanks
    7
    Thanked 1 Time in 1 Post
    Can u please gi'me any sample code for this. I could easily pick the method from the source code.

  • #4
    New Coder
    Join Date
    Aug 2006
    Posts
    64
    Thanks
    0
    Thanked 1 Time in 1 Post
    where you have the list of books, each link from a book should look something like:

    <a href="http://mysite.com/book.htm?id=123&name=abc">Book abc item nmber 123</a>


    if you use serverside scripting to dynamically create the page with the list of books, then you create each book link with the books reference data.

  • #5
    Regular Coder
    Join Date
    Aug 2005
    Posts
    365
    Thanks
    7
    Thanked 1 Time in 1 Post
    Thats the problem Sir.
    I dont know how to do this.
    I'm sorry that I'm bothering u all but..... I'm very keen to learn this...
    I've tried to find out any institute in my area but in vain
    So please...... guide me if u can.....
    I'll b very much thankfull 2 u all.

  • #6
    New Coder
    Join Date
    Aug 2006
    Posts
    64
    Thanks
    0
    Thanked 1 Time in 1 Post
    If you want to populate the page automatically with the book details and links with the correct product id etc, then you will need to learn a server side programming language. One of the most popular is PHP which is a scripting language. It is usually combined with MySQL which is a database where you would store your data. In this case, that would be your list of books with title, product id etc. PHP code is embeded in the html file but before the html file is sent from the server to the users browser, the php code is parsed/executed on the server. Typically the PHP would fetch the data from the MySQL database and embed it in the html including building links with the data you want. As the php codes executes it dynamically builds the html and it is that html which is sent to the users browser. The php code is stripped out of the html file before its sent to the browser so the user never sees the php code. The user sees the output from the php code which is the dynamically built html.

    In other words, you have a long and steep learning curve because you need to understand the relationships between html, PHP and MySql. Your best option is to buy a good book on PHP programming and then progress to MySQL.

    The HTML is the easy bit. I suggest you ask in the PHP forum which is the server side forum. This is the client side forum which is not really dealing with PHP and MySQL.

  • #7
    Regular Coder
    Join Date
    Aug 2005
    Posts
    365
    Thanks
    7
    Thanked 1 Time in 1 Post
    Thank You Very Much Sir !


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •