Jump to content

marcus

Members
  • Posts

    1,842
  • Joined

  • Last visited

Posts posted by marcus

  1. Change

     

    <select onchange="document.location.href=this.options[this.selectedIndex].value;">
    

     

    to

     

    <select onchange="document.location.href=this.options[this.selectedIndex].value;" name="stationid">
    

     

    You simply left out the drop downs' name so it wouldn't pass the variable because it wasn't given.

  2. You could something like this, naming all your files like page1.php page2.php

     

    <?php
    $page = $_GET['page'];
    
    if(isset($page)){
    $page = "$page.php";
    
    if(file_exists($page)){
    include($page);
    }else {
    echo "page does not exist";
    }
    }else {
    include('index.php');
    }
    ?>
    

  3. If you're using a mysql query this can be easily done while selecting it from the database.

    [code=php:0]
    $string = $_POST['string'];
    $array = array('*');
    if(in_array($string,$array)){
    $sql = "SELECT * FROM `tablename` WHERE `blah` LIKE($string)";
    $res = mysql_query($sql) or die(mysql_error());
      while($row = mysql_fetch_assoc($res)){
      //search contents
      }
    }else {
    $sql = "SELECT * FROM `tablename` WHERE `blah` ='$string'";
    $res = mysql_query($sql) or die(mysql_error());
      while($row = mysql_fetch_assoc($res)){
      //search contents
      }
    }
    [/code]
  4. [quote author=yogibear link=topic=123684.msg511554#msg511554 date=1169576651]
    [quote author=jesirose link=topic=123684.msg511547#msg511547 date=1169576103]
    This is why you don't just copy and paste code without understanding it. [b] isn't php, that's a bold tag.
    Take that stuff out, and in the future POST the error, not just that you got one.
    [/quote]

    hi i did post the error it was in my second post and i also tried it with and without the bold tag i didnt just Copy and Paste but that is why people get help because they dont understand

    thanks for help
    [/quote]

    Posting the error would be like the error you posted before ERRORNAME on LINE ### on FILENAME
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.