Results 1 to 6 of 6

Thread: Passing a parameter in the URL

  1. #1
    Junior Member
    Join Date
    Aug 2010
    Posts
    4

    Default Passing a parameter in the URL

    Hi

    as a neophyte developer i am struggling to do this in V10 ...

    create a link to a URL with todays date passed as a parameter. I would like to create a URL that looks like: www.mysite.com?current=2010-08-12

    can somebody help me please with this?

    many thanks

    Mark

  2. #2
    Senior Member gotFusion's Avatar
    Join Date
    Jan 2010
    Location
    www.gotHosting.biz
    Posts
    4,529

    Default

    Quote Originally Posted by mark hobson View Post
    Hi

    as a neophyte developer i am struggling to do this in V10 ...

    create a link to a URL with todays date passed as a parameter. I would like to create a URL that looks like: www.mysite.com?current=2010-08-12

    can somebody help me please with this?

    many thanks

    Mark
    That is how you pass info in a URL.

    You have to do something with it when the page is drawn... Like this.... http://www.gotfusion.com/tutorials/tut.cfm?itemID=4063

    That URL passes itemID #4063 The tut.cfm page then looks up that in my database and presents the requested info on the tut.cfm page when it is drawn.

    So... what do you want to do with the date you are passing?
    NetObjects Fusion Cloud Linux enabled Web Hosting, support + training starts at $14.95
    NetObjects Fusion web Hosting and support + ASP + PHP + ColdFusion + MySQL + MS SQL
    FREE NetObjects Fusion Support & training comes with all web hosting accounts
    NetObjects Fusion Web Hosting: http://www.gotHosting.biz

  3. #3
    Junior Member
    Join Date
    Aug 2010
    Posts
    4

    Default

    I am builidng the front end to our yacht club site.

    We have a back end booking system written in PHP that has been running for several years and is maintained by another member. We want to force all members to visit the new site first so that they see the Latest News section, on which we will put the link to the members log in.

    At present they just bookmark the back end login page avoiding the front end site, so we wanted to pass a parameter to show that they have been to the new site Latest News page first.

    rgds
    Mark

  4. #4
    Junior Member
    Join Date
    Aug 2010
    Posts
    4

    Default

    The difficulty that i am having is inserting the parameter (which i can create in jscript) into the HTML.

    rgds
    Mark

  5. #5
    Senior Member gotFusion's Avatar
    Join Date
    Jan 2010
    Location
    www.gotHosting.biz
    Posts
    4,529

    Default

    Quote Originally Posted by mark hobson View Post
    The difficulty that i am having is inserting the parameter (which i can create in jscript) into the HTML.

    rgds
    Mark
    Not following what you are asking so I will just throw out some things and maybe one will stick.

    If you want to always pass the current date you can get this from the server but you need to get it and store it to a variable.

    <?php $today = date("F j, Y");?> The PHP manual will go over all of the date formating options. Pick the one you want http://php.net/manual/en/function.date.php

    You can then pass the variable in the URL http://www.domain.com/page.php?curDt=$today

    Then on the page that has the date passed to it you can use the variable where you wish

    Make sure that you do NOT use any reserved words such as date http://php.net/manual/en/reserved.php

    My php is a little rusty after 10 years of non use so someone else can step in and sort out the rest if this does not set you on the right path.
    NetObjects Fusion Cloud Linux enabled Web Hosting, support + training starts at $14.95
    NetObjects Fusion web Hosting and support + ASP + PHP + ColdFusion + MySQL + MS SQL
    FREE NetObjects Fusion Support & training comes with all web hosting accounts
    NetObjects Fusion Web Hosting: http://www.gotHosting.biz

  6. #6
    Junior Member
    Join Date
    Aug 2010
    Posts
    4

    Cool solved it

    Thank you Mike

    My apologies for the ambiguity.

    I have solved this problem by using the javascript option in the "Link" field for an image, where i have concatenated the various bits of the date to make the correct string.

    your kind help is much appreciated.

    rgds
    Mark

Posting Permissions

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