variable issue.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hozyali
    New Member
    • Mar 2007
    • 5

    variable issue.

    I have a form to dispaly some drop downs. one of the dropdown needs to show value depending on the QueryString in the URL. and it should set the combo value to 1 if the query string is empty.

    I tried different things to play with php but it keeps on giving me errors if the querystring is empty. Can some one please tell me how to get it done.

    Regards
    Ali
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    #2
    QueryString in the URL.
    Do you mean you are passing the query as a string within a URL variable?
    I tried different things to play with php but it keeps on giving me errors if the querystring is empty.
    Test the string first with
    [PHP]if(empty($_GET['querystring'])){
    //ERROR
    } [/PHP]

    Comment

    • hozyali
      New Member
      • Mar 2007
      • 5

      #3
      Originally posted by code green
      Do you mean you are passing the query as a string within a URL variable?
      Test the string first with
      [PHP]if(empty($_GET['querystring'])){
      //ERROR
      } [/PHP]
      It worked. thanks a lot.

      One more issue I have is at http://projects.starco msystems.net/golfcenter/
      when you open the combo for SELECT TEE TIME, it shows times as 08:00:00, means it is including seconds. instead I want to show the time as "08:00 AM"...
      Can you please tell me how to get this done? please note that the values in this combo are being fetched by a mysql database.

      Thanks again

      Ali

      Comment

      • code green
        Recognized Expert Top Contributor
        • Mar 2007
        • 1726

        #4
        How are you filling your combo. If using php you can use
        [PHP]$combovalue = date('h a',$dbDate);[/PHP]for 12hr or capital H for 24hr, but this function requires $dbDate to be a timestamp. If not you may need [PHP]$dbDate = strtotime($dbDa te);[/PHP]

        Comment

        Working...