If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Feb 2010
    Member #
    Hi, I'm relatively new to web programming and i'm completely new to these forums (hi).

    I'm looking to be able to do something specific for an HTML page. What I want to be able to do is this:

    - have 2 variables in the address bar on the browser
    - be able to display the value of these variables throughout an HTML page


    in address bar something like this"peanuts";var2=Butter"

    On the webpage something like this

    My favorite foods are: Peanuts and Butter

    (the 'Peanuts' and 'butter' terms are called from the address bar).

    If I change var1 and var2 it should be reflected in the text. If anyone could help me out or point me in the right direction, that would be amazing!

    Thanks !


  3. #2
    Junior Member Azmisov's Avatar
    Join Date
    Feb 2010
    Member #
    I would probably use them as get variables. If you're familiar with php coding you can access url variables with the $_GET[var_name] command. To pass variables to a page, link to the page like so:

    Variable foo would then be equal to bar. To send multiple variables, simply separate them with an & symbol. I don't know if xml or perl have an equivalent $_GET[] method. For me, I would just use php. It isn't actually as hard as it sounds, especially if all you need is to get variables.

    Simple example (somepage.php):
    PHP Code:
    <div id='contents'>

    $var2 $_GET['var2'];
    "My favorite foods are:".$var1."and".$var2

    Of course, for any server scripting language, you'll need to install a localhost, which isn't that hard. I'm using XAMPP right now.

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
All times are GMT -6. The time now is 12:13 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: