Jump to content

Djagloi

New Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by Djagloi

  1. 18 hours ago, ginerjm said:

    Change the action attribute on your form to be the url you want.

    And stop using mysql db interface.  It is way out of date!  Strongly suggest switching to PDO - it is pretty easy.

    I did that.  The problem is the special characters.  I asked for help with the CODE, not the interface.

  2. 20 minutes ago, gw1500se said:

    The first thing you need to do is remove the deprecated mysql code and replace it with PDO or at least mysqli. That you can even use mysql implies that your version of PHP is long ago obsolete.

    Ok, but can you assist with the code I have up there?

  3. I have this code:

    Quote

    $result = mysql_query($sql);
    echo " <form action='https://test.com/forum/index.php?/search/&q=". $row['record_meta_keywords'] ." &type=cms_records7&search_and_or=and&search_in=titles'> ";
    echo " <select  name='/search/&q=". $row['record_meta_keywords'] ." 
    &type=cms_records7&search_and_or=and&search_in=titles'> ";
    while ($row = mysql_fetch_array($result)) {
        echo "<option value='" . $row['record_meta_keywords'] ."'>" . $row['record_meta_keywords'] ."</option>";
    }
    echo " </select> ";
    echo " <br><br> ";
    echo " <input type='submit'> ";
    echo " </form> ";
    ?>

    The problem is that when I choose an option from the dropdown (in this case Majestic Lanes) and click submit, it sends me to this URL:

    https://test.com/forum/index.php?%2Fsearch%2F%26q%3D+%0D%0A%26type%3Dcms_records7%26search_and_or%3Dand%26search_in%3Dtitles=Majestic+Lanes

    I need it to send me to this URL:

    https://test.com/forum/index.php?/search/&q=Majestic%20Lanes%20&type=cms_records7&search_and_or=and&search_in=titles

    I don't know PHP well enough to fix the code myself.  Can anyone assist with this please?

×
×
  • 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.