SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    India
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    drop down search

    I tried to make a drop down search as its here in the left side
    http://www.indianartcollectors.com/v...s.php?arid=818

    my trial is here:
    http://www.jalsaghar.com/test.php

    but it's not working... can anyone suggest what's wrong?

  2. #2
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Any relevant php code?
    Saul

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    India
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    whatever i have done can be seen in the Source Code of browser ..... nothing much in php .......

  4. #4
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Then what is wrong with it?
    Saul

  5. #5
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    India
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    on submitting I m trying to call function displayArtist()
    which I have written inside HEAD

    <SCRIPT>
    function displayArtist()
    {
    <?php
    echo("1234");
    ?>
    }
    </SCRIPT>

    but it seems to be not calling the function......

    here's the complete code:
    PHP Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>

    <head>
        <title>
             Jalsaghar: Artist and their Works
        </title>

        <SCRIPT>
                function displayArtist()
                {
                    <?php
                        
    echo("1234");
                    
    ?>
                }
        </SCRIPT>
    </head>

    <body>

    <?php

        $sql 
    $db_object->query("Select distinct artistid from image");

        echo(
    "<form name=\"frmSearch\" action=\"\" method=\"POST\" enctype=\"multipart/form-data\" onsubmit=\"javascript:displayArtist();\">");

            echo(
    "<select name=\"vchArtist\">");
            while(
    $row $sql->fetchRow())
            {
                
    $ArtistId $row["artistid"];
                echo(
    "<option value=\"$ArtistId\">$ArtistId</option>");
            }
            echo(
    "</select>");

            echo(
    "<input type=\"submit\" name=\"submit\" value=\"Submit\">");

        echo(
    "</form>");

    ?>

    </body>

    </html>

  6. #6
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Look at the source, you've got:

    Code:
    function displayArtist()
    			{
    				1234			}
    All you've got is a syntax error there. You want to run a php script server-side, look up Ajax.
    Saul

  7. #7
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    India
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by php_daemon View Post

    All you've got is a syntax error there. You want to run a php script server-side, look up Ajax.

    can u give me some link where I can learn how to do that .....

    though printing 1234 was not my intention for drop down search, I put it to know whether it was calling function displayArtist

  8. #8
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Saul


Bookmarks

Posting Permissions

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